diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..6137bef2a --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,8 @@ +# Code owners file. +# This file controls who is tagged for review for any given pull request. + +# For syntax help see: +# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax + +# The java-samples-reviewers team is the default owner for samples changes +samples/**/*.java @googleapis/java-samples-reviewers diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..0c2c361e9 --- /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-dialogflow-cx/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. dialogflow-cx 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 000000000..754e30c68 --- /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 000000000..995869032 --- /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 000000000..edbd1ffcd --- /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-dialogflow-cx/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 000000000..dce2c8450 --- /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 000000000..f247d5c78 --- /dev/null +++ b/.github/trusted-contribution.yml @@ -0,0 +1,2 @@ +trustedContributors: +- renovate-bot \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..683022075 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,79 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + units: + runs-on: ubuntu-latest + strategy: + matrix: + java: [7, 8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + - name: coverage + uses: codecov/codecov-action@v1 + with: + name: actions ${{matrix.java}} + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.bat + env: + JOB_TYPE: test + dependencies: + runs-on: ubuntu-latest + strategy: + matrix: + java: [8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/dependencies.sh + linkage-monitor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/linkage-monitor.sh + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint + clirr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..cc0bc34a3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ + +.flattened-pom.xml \ No newline at end of file diff --git a/.kokoro/build.bat b/.kokoro/build.bat new file mode 100644 index 000000000..05826ad93 --- /dev/null +++ b/.kokoro/build.bat @@ -0,0 +1,3 @@ +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 000000000..fd1efbe9e --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,111 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java version +java -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) +fi + +RETURN_CODE=0 +set +e + +case ${JOB_TYPE} in +test) + mvn test -B -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? + ;; +lint) + mvn com.coveo:fmt-maven-plugin:check + RETURN_CODE=$? + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc + RETURN_CODE=$? + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +samples) + if [[ -f samples/pom.xml ]] + then + pushd samples + mvn -B \ + -Penable-samples \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + popd + else + echo "no sample pom.xml found - skipping sample tests" + fi + ;; +clirr) + mvn -B -Denforcer.skip=true clirr:check + RETURN_CODE=$? + ;; +*) + ;; +esac + +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +if [[ "${ENABLE_BUILD_COP}" == "true" ]] +then + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop + ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-dialogflow-cx +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 000000000..5cf7ba49e --- /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 000000000..6f989a138 --- /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-dialogflow-cx/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-dialogflow-cx/.kokoro/build.sh" +} diff --git a/.kokoro/common.sh b/.kokoro/common.sh new file mode 100644 index 000000000..a8d0ea04d --- /dev/null +++ b/.kokoro/common.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +function retry_with_backoff { + attempts_left=$1 + sleep_seconds=$2 + shift 2 + command=$@ + + + # store current flag state + flags=$- + + # allow a failures to continue + set +e + echo "${command}" + ${command} + exit_code=$? + + # restore "e" flag + if [[ ${flags} =~ e ]] + then set -e + else set +e + fi + + if [[ $exit_code == 0 ]] + then + return 0 + fi + + # failure + if [[ ${attempts_left} > 0 ]] + then + echo "failure (${exit_code}), sleeping ${sleep_seconds}..." + sleep ${sleep_seconds} + new_attempts=$((${attempts_left} - 1)) + new_sleep=$((${sleep_seconds} * 2)) + retry_with_backoff ${new_attempts} ${new_sleep} ${command} + fi + + return $exit_code +} + +## Helper functionss +function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } +function msg() { println "$*" >&2; } +function println() { printf '%s\n' "$(now) $*"; } \ No newline at end of file diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg new file mode 100644 index 000000000..9c0f3e5f4 --- /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-dialogflow-cx/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-dialogflow-cx/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg new file mode 100644 index 000000000..495cc7bac --- /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/dependencies.sh b/.kokoro/dependencies.sh new file mode 100755 index 000000000..c91e5a569 --- /dev/null +++ b/.kokoro/dependencies.sh @@ -0,0 +1,89 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java +java -version +echo $JOB_TYPE + +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" + +# this should run maven enforcer +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true + +echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" +## Run dependency list completeness check +function completenessCheck() { + # Output dep list with compile scope generated using the original pom + # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. + # This is stripped from the output as it is not present in the flattened pom. + # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. + msg "Generating dependency list using original pom..." + mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt + + # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) + msg "Generating dependency list using flattened pom..." + mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt + + # Compare two dependency lists + msg "Comparing dependency lists..." + diff .org-list.txt .new-list.txt >.diff.txt + if [[ $? == 0 ]] + then + msg "Success. No diff!" + else + msg "Diff found. See below: " + msg "You can also check .diff.txt file located in $1." + cat .diff.txt + return 1 + fi +} + +# Allow failures to continue running the script +set +e + +error_count=0 +for path in $(find -name ".flattened-pom.xml") +do + # Check flattened pom in each dir that contains it for completeness + dir=$(dirname "$path") + pushd "$dir" + completenessCheck "$dir" + error_count=$(($error_count + $?)) + popd +done + +if [[ $error_count == 0 ]] +then + msg "All checks passed." + exit 0 +else + msg "Errors found. See log statements above." + exit 1 +fi \ No newline at end of file diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh new file mode 100755 index 000000000..759ab4e2c --- /dev/null +++ b/.kokoro/linkage-monitor.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail +# Display commands being run. +set -x + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java version +java -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true + +# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR +JAR=linkage-monitor-latest-all-deps.jar +curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" + +# Fails if there's new linkage errors compared with baseline +java -jar ${JAR} com.google.cloud:libraries-bom diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg new file mode 100644 index 000000000..9c0f3e5f4 --- /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-dialogflow-cx/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-dialogflow-cx/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg new file mode 100644 index 000000000..0048c8ece --- /dev/null +++ b/.kokoro/nightly/integration.cfg @@ -0,0 +1,37 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg new file mode 100644 index 000000000..709f2b4c7 --- /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 000000000..cb24f44ee --- /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 000000000..91cdb80e9 --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-dialogflow-cx/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 000000000..b6a9206c7 --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-dialogflow-cx/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg new file mode 100644 index 000000000..495cc7bac --- /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/samples.cfg b/.kokoro/nightly/samples.cfg new file mode 100644 index 000000000..f25429314 --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh new file mode 100755 index 000000000..f52514257 --- /dev/null +++ b/.kokoro/populate-secrets.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright 2020 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} +function msg { println "$*" >&2 ;} +function println { printf '%s\n' "$(now) $*" ;} + + +# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: +# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com +SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" +msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" +mkdir -p ${SECRET_LOCATION} +for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") +do + msg "Retrieving secret ${key}" + docker run --entrypoint=gcloud \ + --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ + gcr.io/google.com/cloudsdktool/cloud-sdk \ + secrets versions access latest \ + --project cloud-devrel-kokoro-resources \ + --secret ${key} > \ + "${SECRET_LOCATION}/${key}" + if [[ $? == 0 ]]; then + msg "Secret written to ${SECRET_LOCATION}/${key}" + else + msg "Error retrieving secret ${key}" + fi +done diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg new file mode 100644 index 000000000..ec572442e --- /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 000000000..e1dfb1935 --- /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-dialogflow-cx/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-dialogflow-cx/.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 000000000..6c9757794 --- /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-dialogflow-cx/.kokoro/dependencies.sh" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg new file mode 100644 index 000000000..dded67a9d --- /dev/null +++ b/.kokoro/presubmit/integration.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg new file mode 100644 index 000000000..709f2b4c7 --- /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 000000000..cb24f44ee --- /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 000000000..91cdb80e9 --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-dialogflow-cx/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 000000000..b6a9206c7 --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-dialogflow-cx/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg new file mode 100644 index 000000000..495cc7bac --- /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 000000000..3e1fe97a7 --- /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-dialogflow-cx/.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 000000000..6d323c8ae --- /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 000000000..01e096004 --- /dev/null +++ b/.kokoro/presubmit/samples.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} \ No newline at end of file diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 000000000..e71978bd9 --- /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-dialogflow-cx/.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-dialogflow-cx/.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 000000000..02a310b9b --- /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-dialogflow-cx/.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 000000000..6e3f65999 --- /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 000000000..c44d3af71 --- /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-dialogflow-cx/.kokoro/release/drop.sh" +} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh new file mode 100755 index 000000000..5c4551efa --- /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 000000000..e90fea37e --- /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-dialogflow-cx/.kokoro/release/promote.sh" +} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh new file mode 100755 index 000000000..1fa95fa53 --- /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 000000000..cc4e0d47a --- /dev/null +++ b/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,29 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" + +env_vars: { + key: "STAGING_BUCKET" + value: "docs-staging" +} + +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2-staging" + # Production will be at: docs-staging-v2 +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-dialogflow-cx/.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 000000000..39626584b --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# Copyright 2019 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET}" ]]; then + echo "Need to set STAGING_BUCKET environment variable" + exit 1 +fi + +if [[ -z "${STAGING_BUCKET_V2}" ]]; then + echo "Need to set STAGING_BUCKET_V2 environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +NAME=google-cloud-dialogflow-cx +VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B -q + +pushd target/site/apidocs + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET} + +popd + +# V2 +mvn clean site -B -q -Ddevsite.template="${KOKORO_GFILE_DIR}/java/" + +pushd target/devsite + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2} diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg new file mode 100644 index 000000000..4999d85e5 --- /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-dialogflow-cx/.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 000000000..098168a73 --- /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 000000000..24aed2ce0 --- /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-dialogflow-cx/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-dialogflow-cx/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-dialogflow-cx" + } +} + +# 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 000000000..3c482cbc5 --- /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 000000000..9da0f8398 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT + +$(dirname $0)/populate-secrets.sh # Secret Manager secrets. +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 000000000..fa031dc3a --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "name": "dialogflow-cx", + "name_pretty": "Dialogflow CX", + "product_documentation": "https://cloud.google.com/dialogflow/cx/docs", + "api_description": "provides a new way of designing agents, taking a state machine approach to agent design. This gives you clear and explicit control over a conversation, a better end-user experience, and a better development workflow.", + "client_documentation": "https://googleapis.dev/java/google-cloud-dialogflow-cx/latest/index.html", + "release_level": "beta", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-dialogflow-cx", + "repo_short": "java-dialogflow-cx", + "distribution_name": "com.google.cloud:google-cloud-dialogflow-cx", + "api_id": "dialogflow-cx.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 000000000..6b2238bb7 --- /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 000000000..f2dbdee06 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,139 @@ +# 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. + +### Code Formatting + +Code in this repo is formatted with +[google-java-format](https://github.com/google/google-java-format). +To run formatting on your project, you can run: +``` +mvn com.coveo:fmt-maven-plugin:format +``` + +### Profile Activation + +To include code samples when building and testing the project, enable the +`enable-samples` Maven profile. + +#### Command line + +To activate the Maven profile on the command line add `-Penable-samples` to your +Maven command. + +#### Maven `settings.xml` + +To activate the Maven profile in your `~/.m2/settings.xml` add an entry of +`enable-samples` following the instructions in [Active Profiles][2]. + +This method has the benefit of applying to all projects you build (and is +respected by IntelliJ IDEA) and is recommended if you are going to be +contributing samples to several projects. + +#### IntelliJ IDEA + +To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in +[Activate Maven profiles][3] to activate `enable-samples`. + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..d64569567 --- /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 000000000..006e25900 --- /dev/null +++ b/README.md @@ -0,0 +1,143 @@ +# Google Dialogflow CX Client for Java + +Java idiomatic client for [Dialogflow CX][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, add this to your pom.xml file: + +```xml + + com.google.cloud + google-cloud-dialogflow-cx + 0.0.0 + +``` + +[//]: # ({x-version-update-start:google-cloud-dialogflow-cx:released}) + +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-dialogflow-cx:0.0.0' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-dialogflow-cx" % "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 Dialogflow CX [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Dialogflow CX. +[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-dialogflow-cx` library. See the [Quickstart](#quickstart) section +to add `google-cloud-dialogflow-cx` as a dependency in your code. + +## About Dialogflow CX + + +[Dialogflow CX][product-docs] provides a new way of designing agents, taking a state machine approach to agent design. This gives you clear and explicit control over a conversation, a better end-user experience, and a better development workflow. + +See the [Dialogflow CX client library docs][javadocs] to learn how to +use this Dialogflow CX Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Dialogflow CX 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/dialogflow/cx/docs +[javadocs]: https://googleapis.dev/java/google-cloud-dialogflow-cx/latest/index.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-dialogflow-cx/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-dialogflow-cx/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-dialogflow-cx/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-dialogflow-cx/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-dialogflow-cx/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-dialogflow-cx/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-dialogflow-cx/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-dialogflow-cx/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-dialogflow-cx/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-dialogflow-cx/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-dialogflow-cx.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-dialogflow-cx&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-dialogflow-cx/blob/master/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-dialogflow-cx/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-dialogflow-cx/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=dialogflow-cx.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 000000000..5724ea947 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/google-cloud-dialogflow-cx-bom/pom.xml b/google-cloud-dialogflow-cx-bom/pom.xml new file mode 100644 index 000000000..7d83c889d --- /dev/null +++ b/google-cloud-dialogflow-cx-bom/pom.xml @@ -0,0 +1,97 @@ + + + 4.0.0 + com.google.cloud + google-cloud-dialogflow-cx-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.9.2 + + + Google Dialogflow CX BOM + https://github.com/googleapis/java-dialogflow-cx + + BOM for Dialogflow CX + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-dialogflow-cx.git + scm:git:git@github.com:googleapis/java-dialogflow-cx.git + https://github.com/googleapis/java-dialogflow-cx + + + + true + + + + + 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-dialogflow-cx + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-dialogflow-cx-v3beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-dialogflow-cx-v3beta1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + \ No newline at end of file diff --git a/google-cloud-dialogflow-cx/pom.xml b/google-cloud-dialogflow-cx/pom.xml new file mode 100644 index 000000000..b51202e9c --- /dev/null +++ b/google-cloud-dialogflow-cx/pom.xml @@ -0,0 +1,111 @@ + + + 4.0.0 + com.google.cloud + google-cloud-dialogflow-cx + 0.0.1-SNAPSHOT + jar + Google Dialogflow CX + https://github.com/googleapis/java-dialogflow-cx + provides a new way of designing agents, taking a state machine approach to agent design. This gives you clear and explicit control over a conversation, a better end-user experience, and a better development workflow. + + com.google.cloud + google-cloud-dialogflow-cx-parent + 0.0.1-SNAPSHOT + + + google-cloud-dialogflow-cx + + + + 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-dialogflow-cx-v3beta1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + org.threeten + threetenbp + + + + + junit + junit + test + 4.13 + + + + com.google.api.grpc + grpc-google-cloud-dialogflow-cx-v3beta1 + test + + + + com.google.api + gax-grpc + testlib + test + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java new file mode 100644 index 000000000..169f393a7 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java @@ -0,0 +1,916 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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.cloud.dialogflow.cx.v3beta1.stub.AgentsStub; +import com.google.cloud.dialogflow.cx.v3beta1.stub.AgentsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Struct; +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 managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent]. + * + *

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 (AgentsClient agentsClient = AgentsClient.create()) {
+ *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+ *   Agent response = agentsClient.getAgent(name);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * AgentsSettings agentsSettings =
+ *     AgentsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AgentsClient agentsClient =
+ *     AgentsClient.create(agentsSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * AgentsSettings agentsSettings =
+ *     AgentsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AgentsClient agentsClient =
+ *     AgentsClient.create(agentsSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AgentsClient implements BackgroundResource { + private final AgentsSettings settings; + private final AgentsStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of AgentsClient with default settings. */ + public static final AgentsClient create() throws IOException { + return create(AgentsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AgentsClient, 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 AgentsClient create(AgentsSettings settings) throws IOException { + return new AgentsClient(settings); + } + + /** + * Constructs an instance of AgentsClient, using the given stub for making calls. This is for + * advanced usage - prefer to use AgentsSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final AgentsClient create(AgentsStub stub) { + return new AgentsClient(stub); + } + + /** + * Constructs an instance of AgentsClient, 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 AgentsClient(AgentsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AgentsStubSettings) 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 AgentsClient(AgentsStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final AgentsSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AgentsStub 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 + /** + * Returns the list of all agents in the specified location. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Agent element : agentsClient.listAgents(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The location to list all agents for. Format: `projects/<Project + * ID>/locations/<Location ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAgentsPagedResponse listAgents(LocationName parent) { + ListAgentsRequest request = + ListAgentsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listAgents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all agents in the specified location. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Agent element : agentsClient.listAgents(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The location to list all agents for. Format: `projects/<Project + * ID>/locations/<Location ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAgentsPagedResponse listAgents(String parent) { + ListAgentsRequest request = ListAgentsRequest.newBuilder().setParent(parent).build(); + return listAgents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all agents in the specified location. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListAgentsRequest request = ListAgentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Agent element : agentsClient.listAgents(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 ListAgentsPagedResponse listAgents(ListAgentsRequest request) { + return listAgentsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all agents in the specified location. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListAgentsRequest request = ListAgentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListAgentsPagedResponse> future = agentsClient.listAgentsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Agent element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listAgentsPagedCallable() { + return stub.listAgentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all agents in the specified location. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListAgentsRequest request = ListAgentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListAgentsResponse response = agentsClient.listAgentsCallable().call(request);
+   *     for (Agent element : response.getAgentsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listAgentsCallable() { + return stub.listAgentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified agent. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Agent response = agentsClient.getAgent(name);
+   * }
+   * 
+ * + * @param name Required. The name of the agent. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Agent getAgent(AgentName name) { + GetAgentRequest request = + GetAgentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getAgent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified agent. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Agent response = agentsClient.getAgent(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the agent. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Agent getAgent(String name) { + GetAgentRequest request = GetAgentRequest.newBuilder().setName(name).build(); + return getAgent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified agent. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   GetAgentRequest request = GetAgentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Agent response = agentsClient.getAgent(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 Agent getAgent(GetAgentRequest request) { + return getAgentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified agent. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   GetAgentRequest request = GetAgentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Agent> future = agentsClient.getAgentCallable().futureCall(request);
+   *   // Do something
+   *   Agent response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getAgentCallable() { + return stub.getAgentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an agent in the specified location. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Agent agent = Agent.newBuilder().build();
+   *   Agent response = agentsClient.createAgent(parent, agent);
+   * }
+   * 
+ * + * @param parent Required. The location to create a agent for. Format: `projects/<Project + * ID>/locations/<Location ID>`. + * @param agent Required. The agent to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Agent createAgent(LocationName parent, Agent agent) { + CreateAgentRequest request = + CreateAgentRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setAgent(agent) + .build(); + return createAgent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an agent in the specified location. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Agent agent = Agent.newBuilder().build();
+   *   Agent response = agentsClient.createAgent(parent.toString(), agent);
+   * }
+   * 
+ * + * @param parent Required. The location to create a agent for. Format: `projects/<Project + * ID>/locations/<Location ID>`. + * @param agent Required. The agent to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Agent createAgent(String parent, Agent agent) { + CreateAgentRequest request = + CreateAgentRequest.newBuilder().setParent(parent).setAgent(agent).build(); + return createAgent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an agent in the specified location. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Agent agent = Agent.newBuilder().build();
+   *   CreateAgentRequest request = CreateAgentRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setAgent(agent)
+   *     .build();
+   *   Agent response = agentsClient.createAgent(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 Agent createAgent(CreateAgentRequest request) { + return createAgentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an agent in the specified location. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Agent agent = Agent.newBuilder().build();
+   *   CreateAgentRequest request = CreateAgentRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setAgent(agent)
+   *     .build();
+   *   ApiFuture<Agent> future = agentsClient.createAgentCallable().futureCall(request);
+   *   // Do something
+   *   Agent response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createAgentCallable() { + return stub.createAgentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified agent. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   Agent agent = Agent.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Agent response = agentsClient.updateAgent(agent, updateMask);
+   * }
+   * 
+ * + * @param agent Required. The agent to update. + * @param updateMask The mask to control which fields get updated. If the mask is not present, all + * fields will be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Agent updateAgent(Agent agent, FieldMask updateMask) { + UpdateAgentRequest request = + UpdateAgentRequest.newBuilder().setAgent(agent).setUpdateMask(updateMask).build(); + return updateAgent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified agent. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   Agent agent = Agent.newBuilder().build();
+   *   UpdateAgentRequest request = UpdateAgentRequest.newBuilder()
+   *     .setAgent(agent)
+   *     .build();
+   *   Agent response = agentsClient.updateAgent(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 Agent updateAgent(UpdateAgentRequest request) { + return updateAgentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified agent. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   Agent agent = Agent.newBuilder().build();
+   *   UpdateAgentRequest request = UpdateAgentRequest.newBuilder()
+   *     .setAgent(agent)
+   *     .build();
+   *   ApiFuture<Agent> future = agentsClient.updateAgentCallable().futureCall(request);
+   *   // Do something
+   *   Agent response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateAgentCallable() { + return stub.updateAgentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified agent. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   agentsClient.deleteAgent(name);
+   * }
+   * 
+ * + * @param name Required. The name of the agent to delete. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAgent(AgentName name) { + DeleteAgentRequest request = + DeleteAgentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteAgent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified agent. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   agentsClient.deleteAgent(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the agent to delete. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAgent(String name) { + DeleteAgentRequest request = DeleteAgentRequest.newBuilder().setName(name).build(); + deleteAgent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified agent. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   DeleteAgentRequest request = DeleteAgentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   agentsClient.deleteAgent(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 deleteAgent(DeleteAgentRequest request) { + deleteAgentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified agent. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   DeleteAgentRequest request = DeleteAgentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = agentsClient.deleteAgentCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteAgentCallable() { + return stub.deleteAgentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports the specified agent to a ZIP file. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ExportAgentRequest request = ExportAgentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ExportAgentResponse response = agentsClient.exportAgentAsync(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 exportAgentAsync( + ExportAgentRequest request) { + return exportAgentOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports the specified agent to a ZIP file. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ExportAgentRequest request = ExportAgentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<ExportAgentResponse, Struct> future = agentsClient.exportAgentOperationCallable().futureCall(request);
+   *   // Do something
+   *   ExportAgentResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + exportAgentOperationCallable() { + return stub.exportAgentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports the specified agent to a ZIP file. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ExportAgentRequest request = ExportAgentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = agentsClient.exportAgentCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable exportAgentCallable() { + return stub.exportAgentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Restores the specified agent from a ZIP file. + * + *

Note that all existing intents, intent routes, entity types, pages and webhooks in the agent + * will be deleted. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   agentsClient.restoreAgentAsync(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 restoreAgentAsync(RestoreAgentRequest request) { + return restoreAgentOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Restores the specified agent from a ZIP file. + * + *

Note that all existing intents, intent routes, entity types, pages and webhooks in the agent + * will be deleted. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Empty, Struct> future = agentsClient.restoreAgentOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + restoreAgentOperationCallable() { + return stub.restoreAgentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Restores the specified agent from a ZIP file. + * + *

Note that all existing intents, intent routes, entity types, pages and webhooks in the agent + * will be deleted. + * + *

Sample code: + * + *


+   * try (AgentsClient agentsClient = AgentsClient.create()) {
+   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = agentsClient.restoreAgentCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable restoreAgentCallable() { + return stub.restoreAgentCallable(); + } + + @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 ListAgentsPagedResponse + extends AbstractPagedListResponse< + ListAgentsRequest, + ListAgentsResponse, + Agent, + ListAgentsPage, + ListAgentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAgentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListAgentsPagedResponse apply(ListAgentsPage input) { + return new ListAgentsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListAgentsPagedResponse(ListAgentsPage page) { + super(page, ListAgentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAgentsPage + extends AbstractPage { + + private ListAgentsPage( + PageContext context, + ListAgentsResponse response) { + super(context, response); + } + + private static ListAgentsPage createEmptyPage() { + return new ListAgentsPage(null, null); + } + + @Override + protected ListAgentsPage createPage( + PageContext context, + ListAgentsResponse response) { + return new ListAgentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAgentsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAgentsRequest, + ListAgentsResponse, + Agent, + ListAgentsPage, + ListAgentsFixedSizeCollection> { + + private ListAgentsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAgentsFixedSizeCollection createEmptyCollection() { + return new ListAgentsFixedSizeCollection(null, 0); + } + + @Override + protected ListAgentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAgentsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsSettings.java new file mode 100644 index 000000000..5659d6fcf --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsSettings.java @@ -0,0 +1,278 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.AgentsClient.ListAgentsPagedResponse; + +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.dialogflow.cx.v3beta1.stub.AgentsStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.Struct; +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 AgentsClient}. + * + *

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

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

+ * 
+ * AgentsSettings.Builder agentsSettingsBuilder =
+ *     AgentsSettings.newBuilder();
+ * agentsSettingsBuilder
+ *     .getAgentSettings()
+ *     .setRetrySettings(
+ *         agentsSettingsBuilder.getAgentSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AgentsSettings agentsSettings = agentsSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AgentsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listAgents. */ + public PagedCallSettings + listAgentsSettings() { + return ((AgentsStubSettings) getStubSettings()).listAgentsSettings(); + } + + /** Returns the object with the settings used for calls to getAgent. */ + public UnaryCallSettings getAgentSettings() { + return ((AgentsStubSettings) getStubSettings()).getAgentSettings(); + } + + /** Returns the object with the settings used for calls to createAgent. */ + public UnaryCallSettings createAgentSettings() { + return ((AgentsStubSettings) getStubSettings()).createAgentSettings(); + } + + /** Returns the object with the settings used for calls to updateAgent. */ + public UnaryCallSettings updateAgentSettings() { + return ((AgentsStubSettings) getStubSettings()).updateAgentSettings(); + } + + /** Returns the object with the settings used for calls to deleteAgent. */ + public UnaryCallSettings deleteAgentSettings() { + return ((AgentsStubSettings) getStubSettings()).deleteAgentSettings(); + } + + /** Returns the object with the settings used for calls to exportAgent. */ + public UnaryCallSettings exportAgentSettings() { + return ((AgentsStubSettings) getStubSettings()).exportAgentSettings(); + } + + /** Returns the object with the settings used for calls to exportAgent. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + exportAgentOperationSettings() { + return ((AgentsStubSettings) getStubSettings()).exportAgentOperationSettings(); + } + + /** Returns the object with the settings used for calls to restoreAgent. */ + public UnaryCallSettings restoreAgentSettings() { + return ((AgentsStubSettings) getStubSettings()).restoreAgentSettings(); + } + + /** Returns the object with the settings used for calls to restoreAgent. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings restoreAgentOperationSettings() { + return ((AgentsStubSettings) getStubSettings()).restoreAgentOperationSettings(); + } + + public static final AgentsSettings create(AgentsStubSettings stub) throws IOException { + return new AgentsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AgentsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AgentsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AgentsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AgentsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AgentsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AgentsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AgentsStubSettings.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 AgentsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AgentsSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(AgentsStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(AgentsStubSettings.newBuilder()); + } + + protected Builder(AgentsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AgentsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public AgentsStubSettings.Builder getStubSettingsBuilder() { + return ((AgentsStubSettings.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 listAgents. */ + public PagedCallSettings.Builder + listAgentsSettings() { + return getStubSettingsBuilder().listAgentsSettings(); + } + + /** Returns the builder for the settings used for calls to getAgent. */ + public UnaryCallSettings.Builder getAgentSettings() { + return getStubSettingsBuilder().getAgentSettings(); + } + + /** Returns the builder for the settings used for calls to createAgent. */ + public UnaryCallSettings.Builder createAgentSettings() { + return getStubSettingsBuilder().createAgentSettings(); + } + + /** Returns the builder for the settings used for calls to updateAgent. */ + public UnaryCallSettings.Builder updateAgentSettings() { + return getStubSettingsBuilder().updateAgentSettings(); + } + + /** Returns the builder for the settings used for calls to deleteAgent. */ + public UnaryCallSettings.Builder deleteAgentSettings() { + return getStubSettingsBuilder().deleteAgentSettings(); + } + + /** Returns the builder for the settings used for calls to exportAgent. */ + public UnaryCallSettings.Builder exportAgentSettings() { + return getStubSettingsBuilder().exportAgentSettings(); + } + + /** Returns the builder for the settings used for calls to exportAgent. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + exportAgentOperationSettings() { + return getStubSettingsBuilder().exportAgentOperationSettings(); + } + + /** Returns the builder for the settings used for calls to restoreAgent. */ + public UnaryCallSettings.Builder restoreAgentSettings() { + return getStubSettingsBuilder().restoreAgentSettings(); + } + + /** Returns the builder for the settings used for calls to restoreAgent. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + restoreAgentOperationSettings() { + return getStubSettingsBuilder().restoreAgentOperationSettings(); + } + + @Override + public AgentsSettings build() throws IOException { + return new AgentsSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java new file mode 100644 index 000000000..b52e299fd --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java @@ -0,0 +1,760 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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.cloud.dialogflow.cx.v3beta1.stub.EntityTypesStub; +import com.google.cloud.dialogflow.cx.v3beta1.stub.EntityTypesStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +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 managing + * [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType]. + * + *

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 (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
+ *   EntityType response = entityTypesClient.getEntityType(name);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * EntityTypesSettings entityTypesSettings =
+ *     EntityTypesSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * EntityTypesClient entityTypesClient =
+ *     EntityTypesClient.create(entityTypesSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * EntityTypesSettings entityTypesSettings =
+ *     EntityTypesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * EntityTypesClient entityTypesClient =
+ *     EntityTypesClient.create(entityTypesSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class EntityTypesClient implements BackgroundResource { + private final EntityTypesSettings settings; + private final EntityTypesStub stub; + + /** Constructs an instance of EntityTypesClient with default settings. */ + public static final EntityTypesClient create() throws IOException { + return create(EntityTypesSettings.newBuilder().build()); + } + + /** + * Constructs an instance of EntityTypesClient, 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 EntityTypesClient create(EntityTypesSettings settings) throws IOException { + return new EntityTypesClient(settings); + } + + /** + * Constructs an instance of EntityTypesClient, using the given stub for making calls. This is for + * advanced usage - prefer to use EntityTypesSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final EntityTypesClient create(EntityTypesStub stub) { + return new EntityTypesClient(stub); + } + + /** + * Constructs an instance of EntityTypesClient, 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 EntityTypesClient(EntityTypesSettings settings) throws IOException { + this.settings = settings; + this.stub = ((EntityTypesStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected EntityTypesClient(EntityTypesStub stub) { + this.settings = null; + this.stub = stub; + } + + public final EntityTypesSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public EntityTypesStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all entity types in the specified agent. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   for (EntityType element : entityTypesClient.listEntityTypes(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The agent to list all entity types for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListEntityTypesPagedResponse listEntityTypes(AgentName parent) { + ListEntityTypesRequest request = + ListEntityTypesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listEntityTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all entity types in the specified agent. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   for (EntityType element : entityTypesClient.listEntityTypes(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The agent to list all entity types for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListEntityTypesPagedResponse listEntityTypes(String parent) { + ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder().setParent(parent).build(); + return listEntityTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all entity types in the specified agent. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (EntityType element : entityTypesClient.listEntityTypes(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 ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest request) { + return listEntityTypesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all entity types in the specified agent. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListEntityTypesPagedResponse> future = entityTypesClient.listEntityTypesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (EntityType element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listEntityTypesPagedCallable() { + return stub.listEntityTypesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all entity types in the specified agent. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListEntityTypesResponse response = entityTypesClient.listEntityTypesCallable().call(request);
+   *     for (EntityType element : response.getEntityTypesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listEntityTypesCallable() { + return stub.listEntityTypesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified entity type. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
+   *   EntityType response = entityTypesClient.getEntityType(name);
+   * }
+   * 
+ * + * @param name Required. The name of the entity type. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type + * ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final EntityType getEntityType(EntityTypeName name) { + GetEntityTypeRequest request = + GetEntityTypeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getEntityType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified entity type. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
+   *   EntityType response = entityTypesClient.getEntityType(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the entity type. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type + * ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final EntityType getEntityType(String name) { + GetEntityTypeRequest request = GetEntityTypeRequest.newBuilder().setName(name).build(); + return getEntityType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified entity type. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
+   *   GetEntityTypeRequest request = GetEntityTypeRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   EntityType response = entityTypesClient.getEntityType(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 EntityType getEntityType(GetEntityTypeRequest request) { + return getEntityTypeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified entity type. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
+   *   GetEntityTypeRequest request = GetEntityTypeRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<EntityType> future = entityTypesClient.getEntityTypeCallable().futureCall(request);
+   *   // Do something
+   *   EntityType response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getEntityTypeCallable() { + return stub.getEntityTypeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an entity type in the specified agent. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   EntityType entityType = EntityType.newBuilder().build();
+   *   EntityType response = entityTypesClient.createEntityType(parent, entityType);
+   * }
+   * 
+ * + * @param parent Required. The agent to create a entity type for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @param entityType Required. The entity type to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final EntityType createEntityType(AgentName parent, EntityType entityType) { + CreateEntityTypeRequest request = + CreateEntityTypeRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setEntityType(entityType) + .build(); + return createEntityType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an entity type in the specified agent. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   EntityType entityType = EntityType.newBuilder().build();
+   *   EntityType response = entityTypesClient.createEntityType(parent.toString(), entityType);
+   * }
+   * 
+ * + * @param parent Required. The agent to create a entity type for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @param entityType Required. The entity type to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final EntityType createEntityType(String parent, EntityType entityType) { + CreateEntityTypeRequest request = + CreateEntityTypeRequest.newBuilder().setParent(parent).setEntityType(entityType).build(); + return createEntityType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an entity type in the specified agent. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   EntityType entityType = EntityType.newBuilder().build();
+   *   CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setEntityType(entityType)
+   *     .build();
+   *   EntityType response = entityTypesClient.createEntityType(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 EntityType createEntityType(CreateEntityTypeRequest request) { + return createEntityTypeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an entity type in the specified agent. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   EntityType entityType = EntityType.newBuilder().build();
+   *   CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setEntityType(entityType)
+   *     .build();
+   *   ApiFuture<EntityType> future = entityTypesClient.createEntityTypeCallable().futureCall(request);
+   *   // Do something
+   *   EntityType response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createEntityTypeCallable() { + return stub.createEntityTypeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified entity type. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   EntityType entityType = EntityType.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   EntityType response = entityTypesClient.updateEntityType(entityType, updateMask);
+   * }
+   * 
+ * + * @param entityType Required. The entity type to update. + * @param updateMask The mask to control which fields get updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final EntityType updateEntityType(EntityType entityType, FieldMask updateMask) { + UpdateEntityTypeRequest request = + UpdateEntityTypeRequest.newBuilder() + .setEntityType(entityType) + .setUpdateMask(updateMask) + .build(); + return updateEntityType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified entity type. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   EntityType entityType = EntityType.newBuilder().build();
+   *   UpdateEntityTypeRequest request = UpdateEntityTypeRequest.newBuilder()
+   *     .setEntityType(entityType)
+   *     .build();
+   *   EntityType response = entityTypesClient.updateEntityType(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 EntityType updateEntityType(UpdateEntityTypeRequest request) { + return updateEntityTypeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified entity type. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   EntityType entityType = EntityType.newBuilder().build();
+   *   UpdateEntityTypeRequest request = UpdateEntityTypeRequest.newBuilder()
+   *     .setEntityType(entityType)
+   *     .build();
+   *   ApiFuture<EntityType> future = entityTypesClient.updateEntityTypeCallable().futureCall(request);
+   *   // Do something
+   *   EntityType response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateEntityTypeCallable() { + return stub.updateEntityTypeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified entity type. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
+   *   entityTypesClient.deleteEntityType(name);
+   * }
+   * 
+ * + * @param name Required. The name of the entity type to delete. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type + * ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteEntityType(EntityTypeName name) { + DeleteEntityTypeRequest request = + DeleteEntityTypeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteEntityType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified entity type. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
+   *   entityTypesClient.deleteEntityType(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the entity type to delete. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type + * ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteEntityType(String name) { + DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder().setName(name).build(); + deleteEntityType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified entity type. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
+   *   DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   entityTypesClient.deleteEntityType(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 deleteEntityType(DeleteEntityTypeRequest request) { + deleteEntityTypeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified entity type. + * + *

Sample code: + * + *


+   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
+   *   DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = entityTypesClient.deleteEntityTypeCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteEntityTypeCallable() { + return stub.deleteEntityTypeCallable(); + } + + @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 ListEntityTypesPagedResponse + extends AbstractPagedListResponse< + ListEntityTypesRequest, + ListEntityTypesResponse, + EntityType, + ListEntityTypesPage, + ListEntityTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListEntityTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListEntityTypesPagedResponse apply(ListEntityTypesPage input) { + return new ListEntityTypesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListEntityTypesPagedResponse(ListEntityTypesPage page) { + super(page, ListEntityTypesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListEntityTypesPage + extends AbstractPage< + ListEntityTypesRequest, ListEntityTypesResponse, EntityType, ListEntityTypesPage> { + + private ListEntityTypesPage( + PageContext context, + ListEntityTypesResponse response) { + super(context, response); + } + + private static ListEntityTypesPage createEmptyPage() { + return new ListEntityTypesPage(null, null); + } + + @Override + protected ListEntityTypesPage createPage( + PageContext context, + ListEntityTypesResponse response) { + return new ListEntityTypesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListEntityTypesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListEntityTypesRequest, + ListEntityTypesResponse, + EntityType, + ListEntityTypesPage, + ListEntityTypesFixedSizeCollection> { + + private ListEntityTypesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListEntityTypesFixedSizeCollection createEmptyCollection() { + return new ListEntityTypesFixedSizeCollection(null, 0); + } + + @Override + protected ListEntityTypesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListEntityTypesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesSettings.java new file mode 100644 index 000000000..08ef354c6 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesSettings.java @@ -0,0 +1,228 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.EntityTypesClient.ListEntityTypesPagedResponse; + +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.dialogflow.cx.v3beta1.stub.EntityTypesStubSettings; +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 EntityTypesClient}. + * + *

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

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

+ * 
+ * EntityTypesSettings.Builder entityTypesSettingsBuilder =
+ *     EntityTypesSettings.newBuilder();
+ * entityTypesSettingsBuilder
+ *     .getEntityTypeSettings()
+ *     .setRetrySettings(
+ *         entityTypesSettingsBuilder.getEntityTypeSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * EntityTypesSettings entityTypesSettings = entityTypesSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class EntityTypesSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listEntityTypes. */ + public PagedCallSettings< + ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> + listEntityTypesSettings() { + return ((EntityTypesStubSettings) getStubSettings()).listEntityTypesSettings(); + } + + /** Returns the object with the settings used for calls to getEntityType. */ + public UnaryCallSettings getEntityTypeSettings() { + return ((EntityTypesStubSettings) getStubSettings()).getEntityTypeSettings(); + } + + /** Returns the object with the settings used for calls to createEntityType. */ + public UnaryCallSettings createEntityTypeSettings() { + return ((EntityTypesStubSettings) getStubSettings()).createEntityTypeSettings(); + } + + /** Returns the object with the settings used for calls to updateEntityType. */ + public UnaryCallSettings updateEntityTypeSettings() { + return ((EntityTypesStubSettings) getStubSettings()).updateEntityTypeSettings(); + } + + /** Returns the object with the settings used for calls to deleteEntityType. */ + public UnaryCallSettings deleteEntityTypeSettings() { + return ((EntityTypesStubSettings) getStubSettings()).deleteEntityTypeSettings(); + } + + public static final EntityTypesSettings create(EntityTypesStubSettings stub) throws IOException { + return new EntityTypesSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return EntityTypesStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return EntityTypesStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return EntityTypesStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return EntityTypesStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return EntityTypesStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return EntityTypesStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return EntityTypesStubSettings.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 EntityTypesSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for EntityTypesSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(EntityTypesStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(EntityTypesStubSettings.newBuilder()); + } + + protected Builder(EntityTypesSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(EntityTypesStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public EntityTypesStubSettings.Builder getStubSettingsBuilder() { + return ((EntityTypesStubSettings.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 listEntityTypes. */ + public PagedCallSettings.Builder< + ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> + listEntityTypesSettings() { + return getStubSettingsBuilder().listEntityTypesSettings(); + } + + /** Returns the builder for the settings used for calls to getEntityType. */ + public UnaryCallSettings.Builder getEntityTypeSettings() { + return getStubSettingsBuilder().getEntityTypeSettings(); + } + + /** Returns the builder for the settings used for calls to createEntityType. */ + public UnaryCallSettings.Builder + createEntityTypeSettings() { + return getStubSettingsBuilder().createEntityTypeSettings(); + } + + /** Returns the builder for the settings used for calls to updateEntityType. */ + public UnaryCallSettings.Builder + updateEntityTypeSettings() { + return getStubSettingsBuilder().updateEntityTypeSettings(); + } + + /** Returns the builder for the settings used for calls to deleteEntityType. */ + public UnaryCallSettings.Builder deleteEntityTypeSettings() { + return getStubSettingsBuilder().deleteEntityTypeSettings(); + } + + @Override + public EntityTypesSettings build() throws IOException { + return new EntityTypesSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java new file mode 100644 index 000000000..c6fec5e31 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java @@ -0,0 +1,1102 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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.cloud.dialogflow.cx.v3beta1.stub.EnvironmentsStub; +import com.google.cloud.dialogflow.cx.v3beta1.stub.EnvironmentsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Struct; +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 managing + * [Environments][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

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 (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+ *   Environment response = environmentsClient.getEnvironment(name);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * EnvironmentsSettings environmentsSettings =
+ *     EnvironmentsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * EnvironmentsClient environmentsClient =
+ *     EnvironmentsClient.create(environmentsSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * EnvironmentsSettings environmentsSettings =
+ *     EnvironmentsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * EnvironmentsClient environmentsClient =
+ *     EnvironmentsClient.create(environmentsSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class EnvironmentsClient implements BackgroundResource { + private final EnvironmentsSettings settings; + private final EnvironmentsStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of EnvironmentsClient with default settings. */ + public static final EnvironmentsClient create() throws IOException { + return create(EnvironmentsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of EnvironmentsClient, 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 EnvironmentsClient create(EnvironmentsSettings settings) throws IOException { + return new EnvironmentsClient(settings); + } + + /** + * Constructs an instance of EnvironmentsClient, using the given stub for making calls. This is + * for advanced usage - prefer to use EnvironmentsSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final EnvironmentsClient create(EnvironmentsStub stub) { + return new EnvironmentsClient(stub); + } + + /** + * Constructs an instance of EnvironmentsClient, 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 EnvironmentsClient(EnvironmentsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((EnvironmentsStubSettings) 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 EnvironmentsClient(EnvironmentsStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final EnvironmentsSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public EnvironmentsStub 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 + /** + * Returns the list of all environments in the specified + * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   for (Environment element : environmentsClient.listEnvironments(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all + * environments for. Format: `projects/<Project ID>/locations/<Location + * ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListEnvironmentsPagedResponse listEnvironments(AgentName parent) { + ListEnvironmentsRequest request = + ListEnvironmentsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listEnvironments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all environments in the specified + * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   for (Environment element : environmentsClient.listEnvironments(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all + * environments for. Format: `projects/<Project ID>/locations/<Location + * ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListEnvironmentsPagedResponse listEnvironments(String parent) { + ListEnvironmentsRequest request = + ListEnvironmentsRequest.newBuilder().setParent(parent).build(); + return listEnvironments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all environments in the specified + * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Environment element : environmentsClient.listEnvironments(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 ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequest request) { + return listEnvironmentsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all environments in the specified + * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListEnvironmentsPagedResponse> future = environmentsClient.listEnvironmentsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Environment element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listEnvironmentsPagedCallable() { + return stub.listEnvironmentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all environments in the specified + * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListEnvironmentsResponse response = environmentsClient.listEnvironmentsCallable().call(request);
+   *     for (Environment element : response.getEnvironmentsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listEnvironmentsCallable() { + return stub.listEnvironmentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+   *   Environment response = environmentsClient.getEnvironment(name);
+   * }
+   * 
+ * + * @param name Required. The name of the + * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/environments/<Environment ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Environment getEnvironment(EnvironmentName name) { + GetEnvironmentRequest request = + GetEnvironmentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getEnvironment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+   *   Environment response = environmentsClient.getEnvironment(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the + * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/environments/<Environment ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Environment getEnvironment(String name) { + GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder().setName(name).build(); + return getEnvironment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+   *   GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Environment response = environmentsClient.getEnvironment(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 Environment getEnvironment(GetEnvironmentRequest request) { + return getEnvironmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+   *   GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Environment> future = environmentsClient.getEnvironmentCallable().futureCall(request);
+   *   // Do something
+   *   Environment response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getEnvironmentCallable() { + return stub.getEnvironmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified + * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Environment environment = Environment.newBuilder().build();
+   *   Environment response = environmentsClient.createEnvironmentAsync(parent, environment).get();
+   * }
+   * 
+ * + * @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an + * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. + * @param environment Required. The environment to create. + * @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 createEnvironmentAsync( + AgentName parent, Environment environment) { + CreateEnvironmentRequest request = + CreateEnvironmentRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setEnvironment(environment) + .build(); + return createEnvironmentAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified + * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Environment environment = Environment.newBuilder().build();
+   *   Environment response = environmentsClient.createEnvironmentAsync(parent.toString(), environment).get();
+   * }
+   * 
+ * + * @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an + * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. + * @param environment Required. The environment to create. + * @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 createEnvironmentAsync( + String parent, Environment environment) { + CreateEnvironmentRequest request = + CreateEnvironmentRequest.newBuilder().setParent(parent).setEnvironment(environment).build(); + return createEnvironmentAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified + * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Environment environment = Environment.newBuilder().build();
+   *   CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setEnvironment(environment)
+   *     .build();
+   *   Environment response = environmentsClient.createEnvironmentAsync(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 createEnvironmentAsync( + CreateEnvironmentRequest request) { + return createEnvironmentOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified + * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Environment environment = Environment.newBuilder().build();
+   *   CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setEnvironment(environment)
+   *     .build();
+   *   OperationFuture<Environment, Struct> future = environmentsClient.createEnvironmentOperationCallable().futureCall(request);
+   *   // Do something
+   *   Environment response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + createEnvironmentOperationCallable() { + return stub.createEnvironmentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified + * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Environment environment = Environment.newBuilder().build();
+   *   CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setEnvironment(environment)
+   *     .build();
+   *   ApiFuture<Operation> future = environmentsClient.createEnvironmentCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createEnvironmentCallable() { + return stub.createEnvironmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   Environment environment = Environment.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Environment response = environmentsClient.updateEnvironmentAsync(environment, updateMask).get();
+   * }
+   * 
+ * + * @param environment Required. The environment to update. + * @param updateMask Required. The mask to control which fields get updated. + * @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 updateEnvironmentAsync( + Environment environment, FieldMask updateMask) { + UpdateEnvironmentRequest request = + UpdateEnvironmentRequest.newBuilder() + .setEnvironment(environment) + .setUpdateMask(updateMask) + .build(); + return updateEnvironmentAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   Environment environment = Environment.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateEnvironmentRequest request = UpdateEnvironmentRequest.newBuilder()
+   *     .setEnvironment(environment)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Environment response = environmentsClient.updateEnvironmentAsync(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 updateEnvironmentAsync( + UpdateEnvironmentRequest request) { + return updateEnvironmentOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   Environment environment = Environment.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateEnvironmentRequest request = UpdateEnvironmentRequest.newBuilder()
+   *     .setEnvironment(environment)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   OperationFuture<Environment, Struct> future = environmentsClient.updateEnvironmentOperationCallable().futureCall(request);
+   *   // Do something
+   *   Environment response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + updateEnvironmentOperationCallable() { + return stub.updateEnvironmentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   Environment environment = Environment.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateEnvironmentRequest request = UpdateEnvironmentRequest.newBuilder()
+   *     .setEnvironment(environment)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Operation> future = environmentsClient.updateEnvironmentCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateEnvironmentCallable() { + return stub.updateEnvironmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+   *   environmentsClient.deleteEnvironment(name);
+   * }
+   * 
+ * + * @param name Required. The name of the + * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/environments/<Environment ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteEnvironment(EnvironmentName name) { + DeleteEnvironmentRequest request = + DeleteEnvironmentRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteEnvironment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+   *   environmentsClient.deleteEnvironment(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the + * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/environments/<Environment ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteEnvironment(String name) { + DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder().setName(name).build(); + deleteEnvironment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+   *   DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   environmentsClient.deleteEnvironment(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 deleteEnvironment(DeleteEnvironmentRequest request) { + deleteEnvironmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+   *   DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = environmentsClient.deleteEnvironmentCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteEnvironmentCallable() { + return stub.deleteEnvironmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Looks up the history of the specified + * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+   *   for (Environment element : environmentsClient.lookupEnvironmentHistory(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param name Required. Resource name of the environment to look up the history for. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/environments/<Environment ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory( + EnvironmentName name) { + LookupEnvironmentHistoryRequest request = + LookupEnvironmentHistoryRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return lookupEnvironmentHistory(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Looks up the history of the specified + * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+   *   for (Environment element : environmentsClient.lookupEnvironmentHistory(name.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param name Required. Resource name of the environment to look up the history for. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/environments/<Environment ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory(String name) { + LookupEnvironmentHistoryRequest request = + LookupEnvironmentHistoryRequest.newBuilder().setName(name).build(); + return lookupEnvironmentHistory(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Looks up the history of the specified + * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+   *   LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   for (Environment element : environmentsClient.lookupEnvironmentHistory(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 LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory( + LookupEnvironmentHistoryRequest request) { + return lookupEnvironmentHistoryPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Looks up the history of the specified + * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+   *   LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<LookupEnvironmentHistoryPagedResponse> future = environmentsClient.lookupEnvironmentHistoryPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Environment element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + lookupEnvironmentHistoryPagedCallable() { + return stub.lookupEnvironmentHistoryPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Looks up the history of the specified + * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample code: + * + *


+   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+   *   LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   while (true) {
+   *     LookupEnvironmentHistoryResponse response = environmentsClient.lookupEnvironmentHistoryCallable().call(request);
+   *     for (Environment element : response.getEnvironmentsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + lookupEnvironmentHistoryCallable() { + return stub.lookupEnvironmentHistoryCallable(); + } + + @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 ListEnvironmentsPagedResponse + extends AbstractPagedListResponse< + ListEnvironmentsRequest, + ListEnvironmentsResponse, + Environment, + ListEnvironmentsPage, + ListEnvironmentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListEnvironmentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListEnvironmentsPagedResponse apply(ListEnvironmentsPage input) { + return new ListEnvironmentsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListEnvironmentsPagedResponse(ListEnvironmentsPage page) { + super(page, ListEnvironmentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListEnvironmentsPage + extends AbstractPage< + ListEnvironmentsRequest, ListEnvironmentsResponse, Environment, ListEnvironmentsPage> { + + private ListEnvironmentsPage( + PageContext context, + ListEnvironmentsResponse response) { + super(context, response); + } + + private static ListEnvironmentsPage createEmptyPage() { + return new ListEnvironmentsPage(null, null); + } + + @Override + protected ListEnvironmentsPage createPage( + PageContext context, + ListEnvironmentsResponse response) { + return new ListEnvironmentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListEnvironmentsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListEnvironmentsRequest, + ListEnvironmentsResponse, + Environment, + ListEnvironmentsPage, + ListEnvironmentsFixedSizeCollection> { + + private ListEnvironmentsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListEnvironmentsFixedSizeCollection createEmptyCollection() { + return new ListEnvironmentsFixedSizeCollection(null, 0); + } + + @Override + protected ListEnvironmentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListEnvironmentsFixedSizeCollection(pages, collectionSize); + } + } + + public static class LookupEnvironmentHistoryPagedResponse + extends AbstractPagedListResponse< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + Environment, + LookupEnvironmentHistoryPage, + LookupEnvironmentHistoryFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + LookupEnvironmentHistoryPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public LookupEnvironmentHistoryPagedResponse apply(LookupEnvironmentHistoryPage input) { + return new LookupEnvironmentHistoryPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private LookupEnvironmentHistoryPagedResponse(LookupEnvironmentHistoryPage page) { + super(page, LookupEnvironmentHistoryFixedSizeCollection.createEmptyCollection()); + } + } + + public static class LookupEnvironmentHistoryPage + extends AbstractPage< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + Environment, + LookupEnvironmentHistoryPage> { + + private LookupEnvironmentHistoryPage( + PageContext + context, + LookupEnvironmentHistoryResponse response) { + super(context, response); + } + + private static LookupEnvironmentHistoryPage createEmptyPage() { + return new LookupEnvironmentHistoryPage(null, null); + } + + @Override + protected LookupEnvironmentHistoryPage createPage( + PageContext + context, + LookupEnvironmentHistoryResponse response) { + return new LookupEnvironmentHistoryPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class LookupEnvironmentHistoryFixedSizeCollection + extends AbstractFixedSizeCollection< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + Environment, + LookupEnvironmentHistoryPage, + LookupEnvironmentHistoryFixedSizeCollection> { + + private LookupEnvironmentHistoryFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static LookupEnvironmentHistoryFixedSizeCollection createEmptyCollection() { + return new LookupEnvironmentHistoryFixedSizeCollection(null, 0); + } + + @Override + protected LookupEnvironmentHistoryFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new LookupEnvironmentHistoryFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsSettings.java new file mode 100644 index 000000000..608ddfaa4 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsSettings.java @@ -0,0 +1,283 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.ListEnvironmentsPagedResponse; +import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.LookupEnvironmentHistoryPagedResponse; + +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.dialogflow.cx.v3beta1.stub.EnvironmentsStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.Struct; +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 EnvironmentsClient}. + * + *

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

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

+ * 
+ * EnvironmentsSettings.Builder environmentsSettingsBuilder =
+ *     EnvironmentsSettings.newBuilder();
+ * environmentsSettingsBuilder
+ *     .getEnvironmentSettings()
+ *     .setRetrySettings(
+ *         environmentsSettingsBuilder.getEnvironmentSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * EnvironmentsSettings environmentsSettings = environmentsSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class EnvironmentsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listEnvironments. */ + public PagedCallSettings< + ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> + listEnvironmentsSettings() { + return ((EnvironmentsStubSettings) getStubSettings()).listEnvironmentsSettings(); + } + + /** Returns the object with the settings used for calls to getEnvironment. */ + public UnaryCallSettings getEnvironmentSettings() { + return ((EnvironmentsStubSettings) getStubSettings()).getEnvironmentSettings(); + } + + /** Returns the object with the settings used for calls to createEnvironment. */ + public UnaryCallSettings createEnvironmentSettings() { + return ((EnvironmentsStubSettings) getStubSettings()).createEnvironmentSettings(); + } + + /** Returns the object with the settings used for calls to createEnvironment. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + createEnvironmentOperationSettings() { + return ((EnvironmentsStubSettings) getStubSettings()).createEnvironmentOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateEnvironment. */ + public UnaryCallSettings updateEnvironmentSettings() { + return ((EnvironmentsStubSettings) getStubSettings()).updateEnvironmentSettings(); + } + + /** Returns the object with the settings used for calls to updateEnvironment. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + updateEnvironmentOperationSettings() { + return ((EnvironmentsStubSettings) getStubSettings()).updateEnvironmentOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteEnvironment. */ + public UnaryCallSettings deleteEnvironmentSettings() { + return ((EnvironmentsStubSettings) getStubSettings()).deleteEnvironmentSettings(); + } + + /** Returns the object with the settings used for calls to lookupEnvironmentHistory. */ + public PagedCallSettings< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + LookupEnvironmentHistoryPagedResponse> + lookupEnvironmentHistorySettings() { + return ((EnvironmentsStubSettings) getStubSettings()).lookupEnvironmentHistorySettings(); + } + + public static final EnvironmentsSettings create(EnvironmentsStubSettings stub) + throws IOException { + return new EnvironmentsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return EnvironmentsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return EnvironmentsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return EnvironmentsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return EnvironmentsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return EnvironmentsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return EnvironmentsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return EnvironmentsStubSettings.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 EnvironmentsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for EnvironmentsSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(EnvironmentsStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(EnvironmentsStubSettings.newBuilder()); + } + + protected Builder(EnvironmentsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(EnvironmentsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public EnvironmentsStubSettings.Builder getStubSettingsBuilder() { + return ((EnvironmentsStubSettings.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 listEnvironments. */ + public PagedCallSettings.Builder< + ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> + listEnvironmentsSettings() { + return getStubSettingsBuilder().listEnvironmentsSettings(); + } + + /** Returns the builder for the settings used for calls to getEnvironment. */ + public UnaryCallSettings.Builder getEnvironmentSettings() { + return getStubSettingsBuilder().getEnvironmentSettings(); + } + + /** Returns the builder for the settings used for calls to createEnvironment. */ + public UnaryCallSettings.Builder + createEnvironmentSettings() { + return getStubSettingsBuilder().createEnvironmentSettings(); + } + + /** Returns the builder for the settings used for calls to createEnvironment. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createEnvironmentOperationSettings() { + return getStubSettingsBuilder().createEnvironmentOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateEnvironment. */ + public UnaryCallSettings.Builder + updateEnvironmentSettings() { + return getStubSettingsBuilder().updateEnvironmentSettings(); + } + + /** Returns the builder for the settings used for calls to updateEnvironment. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateEnvironmentOperationSettings() { + return getStubSettingsBuilder().updateEnvironmentOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteEnvironment. */ + public UnaryCallSettings.Builder deleteEnvironmentSettings() { + return getStubSettingsBuilder().deleteEnvironmentSettings(); + } + + /** Returns the builder for the settings used for calls to lookupEnvironmentHistory. */ + public PagedCallSettings.Builder< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + LookupEnvironmentHistoryPagedResponse> + lookupEnvironmentHistorySettings() { + return getStubSettingsBuilder().lookupEnvironmentHistorySettings(); + } + + @Override + public EnvironmentsSettings build() throws IOException { + return new EnvironmentsSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java new file mode 100644 index 000000000..1aba5a124 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java @@ -0,0 +1,880 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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.cloud.dialogflow.cx.v3beta1.stub.FlowsStub; +import com.google.cloud.dialogflow.cx.v3beta1.stub.FlowsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Struct; +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 managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow]. + * + *

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 (FlowsClient flowsClient = FlowsClient.create()) {
+ *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+ *   Flow flow = Flow.newBuilder().build();
+ *   Flow response = flowsClient.createFlow(parent, flow);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

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

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Flow flow = Flow.newBuilder().build();
+   *   Flow response = flowsClient.createFlow(parent, flow);
+   * }
+   * 
+ * + * @param parent Required. The agent to create a flow for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @param flow Required. The flow to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Flow createFlow(AgentName parent, Flow flow) { + CreateFlowRequest request = + CreateFlowRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setFlow(flow) + .build(); + return createFlow(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a flow in the specified agent. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Flow flow = Flow.newBuilder().build();
+   *   Flow response = flowsClient.createFlow(parent.toString(), flow);
+   * }
+   * 
+ * + * @param parent Required. The agent to create a flow for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @param flow Required. The flow to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Flow createFlow(String parent, Flow flow) { + CreateFlowRequest request = + CreateFlowRequest.newBuilder().setParent(parent).setFlow(flow).build(); + return createFlow(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a flow in the specified agent. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Flow flow = Flow.newBuilder().build();
+   *   CreateFlowRequest request = CreateFlowRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setFlow(flow)
+   *     .build();
+   *   Flow response = flowsClient.createFlow(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 Flow createFlow(CreateFlowRequest request) { + return createFlowCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a flow in the specified agent. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Flow flow = Flow.newBuilder().build();
+   *   CreateFlowRequest request = CreateFlowRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setFlow(flow)
+   *     .build();
+   *   ApiFuture<Flow> future = flowsClient.createFlowCallable().futureCall(request);
+   *   // Do something
+   *   Flow response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createFlowCallable() { + return stub.createFlowCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a specified flow. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   flowsClient.deleteFlow(name);
+   * }
+   * 
+ * + * @param name Required. The name of the flow to delete. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteFlow(FlowName name) { + DeleteFlowRequest request = + DeleteFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteFlow(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a specified flow. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   flowsClient.deleteFlow(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the flow to delete. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteFlow(String name) { + DeleteFlowRequest request = DeleteFlowRequest.newBuilder().setName(name).build(); + deleteFlow(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a specified flow. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   DeleteFlowRequest request = DeleteFlowRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   flowsClient.deleteFlow(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 deleteFlow(DeleteFlowRequest request) { + deleteFlowCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a specified flow. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   DeleteFlowRequest request = DeleteFlowRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = flowsClient.deleteFlowCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteFlowCallable() { + return stub.deleteFlowCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all flows in the specified agent. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   for (Flow element : flowsClient.listFlows(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The agent containing the flows. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFlowsPagedResponse listFlows(AgentName parent) { + ListFlowsRequest request = + ListFlowsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listFlows(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all flows in the specified agent. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   for (Flow element : flowsClient.listFlows(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The agent containing the flows. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFlowsPagedResponse listFlows(String parent) { + ListFlowsRequest request = ListFlowsRequest.newBuilder().setParent(parent).build(); + return listFlows(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all flows in the specified agent. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListFlowsRequest request = ListFlowsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Flow element : flowsClient.listFlows(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 ListFlowsPagedResponse listFlows(ListFlowsRequest request) { + return listFlowsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all flows in the specified agent. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListFlowsRequest request = ListFlowsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListFlowsPagedResponse> future = flowsClient.listFlowsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Flow element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listFlowsPagedCallable() { + return stub.listFlowsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all flows in the specified agent. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListFlowsRequest request = ListFlowsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListFlowsResponse response = flowsClient.listFlowsCallable().call(request);
+   *     for (Flow element : response.getFlowsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listFlowsCallable() { + return stub.listFlowsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified flow. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   Flow response = flowsClient.getFlow(name);
+   * }
+   * 
+ * + * @param name Required. The name of the flow to get. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Flow getFlow(FlowName name) { + GetFlowRequest request = + GetFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getFlow(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified flow. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   Flow response = flowsClient.getFlow(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the flow to get. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Flow getFlow(String name) { + GetFlowRequest request = GetFlowRequest.newBuilder().setName(name).build(); + return getFlow(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified flow. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   GetFlowRequest request = GetFlowRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Flow response = flowsClient.getFlow(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 Flow getFlow(GetFlowRequest request) { + return getFlowCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified flow. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   GetFlowRequest request = GetFlowRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Flow> future = flowsClient.getFlowCallable().futureCall(request);
+   *   // Do something
+   *   Flow response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getFlowCallable() { + return stub.getFlowCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified flow. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   Flow flow = Flow.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Flow response = flowsClient.updateFlow(flow, updateMask);
+   * }
+   * 
+ * + * @param flow Required. The flow to update. + * @param updateMask Required. The mask to control which fields get updated. If `update_mask` is + * not specified, an error will be returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Flow updateFlow(Flow flow, FieldMask updateMask) { + UpdateFlowRequest request = + UpdateFlowRequest.newBuilder().setFlow(flow).setUpdateMask(updateMask).build(); + return updateFlow(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified flow. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   Flow flow = Flow.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateFlowRequest request = UpdateFlowRequest.newBuilder()
+   *     .setFlow(flow)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Flow response = flowsClient.updateFlow(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 Flow updateFlow(UpdateFlowRequest request) { + return updateFlowCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified flow. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   Flow flow = Flow.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateFlowRequest request = UpdateFlowRequest.newBuilder()
+   *     .setFlow(flow)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Flow> future = flowsClient.updateFlowCallable().futureCall(request);
+   *   // Do something
+   *   Flow response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateFlowCallable() { + return stub.updateFlowCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Trains the specified flow. Note that only the flow in 'draft' environment is trained. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   flowsClient.trainFlowAsync(name).get();
+   * }
+   * 
+ * + * @param name Required. The flow to train. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. + * @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 trainFlowAsync(FlowName name) { + TrainFlowRequest request = + TrainFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return trainFlowAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Trains the specified flow. Note that only the flow in 'draft' environment is trained. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   flowsClient.trainFlowAsync(name.toString()).get();
+   * }
+   * 
+ * + * @param name Required. The flow to train. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. + * @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 trainFlowAsync(String name) { + TrainFlowRequest request = TrainFlowRequest.newBuilder().setName(name).build(); + return trainFlowAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Trains the specified flow. Note that only the flow in 'draft' environment is trained. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   TrainFlowRequest request = TrainFlowRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   flowsClient.trainFlowAsync(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 trainFlowAsync(TrainFlowRequest request) { + return trainFlowOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Trains the specified flow. Note that only the flow in 'draft' environment is trained. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   TrainFlowRequest request = TrainFlowRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Empty, Struct> future = flowsClient.trainFlowOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable trainFlowOperationCallable() { + return stub.trainFlowOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Trains the specified flow. Note that only the flow in 'draft' environment is trained. + * + *

Sample code: + * + *


+   * try (FlowsClient flowsClient = FlowsClient.create()) {
+   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   TrainFlowRequest request = TrainFlowRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = flowsClient.trainFlowCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable trainFlowCallable() { + return stub.trainFlowCallable(); + } + + @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 ListFlowsPagedResponse + extends AbstractPagedListResponse< + ListFlowsRequest, ListFlowsResponse, Flow, ListFlowsPage, ListFlowsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListFlowsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListFlowsPagedResponse apply(ListFlowsPage input) { + return new ListFlowsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListFlowsPagedResponse(ListFlowsPage page) { + super(page, ListFlowsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListFlowsPage + extends AbstractPage { + + private ListFlowsPage( + PageContext context, + ListFlowsResponse response) { + super(context, response); + } + + private static ListFlowsPage createEmptyPage() { + return new ListFlowsPage(null, null); + } + + @Override + protected ListFlowsPage createPage( + PageContext context, + ListFlowsResponse response) { + return new ListFlowsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListFlowsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListFlowsRequest, ListFlowsResponse, Flow, ListFlowsPage, ListFlowsFixedSizeCollection> { + + private ListFlowsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListFlowsFixedSizeCollection createEmptyCollection() { + return new ListFlowsFixedSizeCollection(null, 0); + } + + @Override + protected ListFlowsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListFlowsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsSettings.java new file mode 100644 index 000000000..2a321216d --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsSettings.java @@ -0,0 +1,252 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.FlowsClient.ListFlowsPagedResponse; + +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.dialogflow.cx.v3beta1.stub.FlowsStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.Struct; +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 FlowsClient}. + * + *

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

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

+ * 
+ * FlowsSettings.Builder flowsSettingsBuilder =
+ *     FlowsSettings.newBuilder();
+ * flowsSettingsBuilder
+ *     .createFlowSettings()
+ *     .setRetrySettings(
+ *         flowsSettingsBuilder.createFlowSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * FlowsSettings flowsSettings = flowsSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class FlowsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createFlow. */ + public UnaryCallSettings createFlowSettings() { + return ((FlowsStubSettings) getStubSettings()).createFlowSettings(); + } + + /** Returns the object with the settings used for calls to deleteFlow. */ + public UnaryCallSettings deleteFlowSettings() { + return ((FlowsStubSettings) getStubSettings()).deleteFlowSettings(); + } + + /** Returns the object with the settings used for calls to listFlows. */ + public PagedCallSettings + listFlowsSettings() { + return ((FlowsStubSettings) getStubSettings()).listFlowsSettings(); + } + + /** Returns the object with the settings used for calls to getFlow. */ + public UnaryCallSettings getFlowSettings() { + return ((FlowsStubSettings) getStubSettings()).getFlowSettings(); + } + + /** Returns the object with the settings used for calls to updateFlow. */ + public UnaryCallSettings updateFlowSettings() { + return ((FlowsStubSettings) getStubSettings()).updateFlowSettings(); + } + + /** Returns the object with the settings used for calls to trainFlow. */ + public UnaryCallSettings trainFlowSettings() { + return ((FlowsStubSettings) getStubSettings()).trainFlowSettings(); + } + + /** Returns the object with the settings used for calls to trainFlow. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings trainFlowOperationSettings() { + return ((FlowsStubSettings) getStubSettings()).trainFlowOperationSettings(); + } + + public static final FlowsSettings create(FlowsStubSettings stub) throws IOException { + return new FlowsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return FlowsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return FlowsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return FlowsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return FlowsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return FlowsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return FlowsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return FlowsStubSettings.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 FlowsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for FlowsSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(FlowsStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(FlowsStubSettings.newBuilder()); + } + + protected Builder(FlowsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(FlowsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public FlowsStubSettings.Builder getStubSettingsBuilder() { + return ((FlowsStubSettings.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 createFlow. */ + public UnaryCallSettings.Builder createFlowSettings() { + return getStubSettingsBuilder().createFlowSettings(); + } + + /** Returns the builder for the settings used for calls to deleteFlow. */ + public UnaryCallSettings.Builder deleteFlowSettings() { + return getStubSettingsBuilder().deleteFlowSettings(); + } + + /** Returns the builder for the settings used for calls to listFlows. */ + public PagedCallSettings.Builder + listFlowsSettings() { + return getStubSettingsBuilder().listFlowsSettings(); + } + + /** Returns the builder for the settings used for calls to getFlow. */ + public UnaryCallSettings.Builder getFlowSettings() { + return getStubSettingsBuilder().getFlowSettings(); + } + + /** Returns the builder for the settings used for calls to updateFlow. */ + public UnaryCallSettings.Builder updateFlowSettings() { + return getStubSettingsBuilder().updateFlowSettings(); + } + + /** Returns the builder for the settings used for calls to trainFlow. */ + public UnaryCallSettings.Builder trainFlowSettings() { + return getStubSettingsBuilder().trainFlowSettings(); + } + + /** Returns the builder for the settings used for calls to trainFlow. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + trainFlowOperationSettings() { + return getStubSettingsBuilder().trainFlowOperationSettings(); + } + + @Override + public FlowsSettings build() throws IOException { + return new FlowsSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java new file mode 100644 index 000000000..a76007393 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java @@ -0,0 +1,749 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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.cloud.dialogflow.cx.v3beta1.stub.IntentsStub; +import com.google.cloud.dialogflow.cx.v3beta1.stub.IntentsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +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 managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent]. + * + *

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 (IntentsClient intentsClient = IntentsClient.create()) {
+ *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
+ *   Intent response = intentsClient.getIntent(name);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * IntentsSettings intentsSettings =
+ *     IntentsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * IntentsClient intentsClient =
+ *     IntentsClient.create(intentsSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * IntentsSettings intentsSettings =
+ *     IntentsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * IntentsClient intentsClient =
+ *     IntentsClient.create(intentsSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class IntentsClient implements BackgroundResource { + private final IntentsSettings settings; + private final IntentsStub stub; + + /** Constructs an instance of IntentsClient with default settings. */ + public static final IntentsClient create() throws IOException { + return create(IntentsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of IntentsClient, 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 IntentsClient create(IntentsSettings settings) throws IOException { + return new IntentsClient(settings); + } + + /** + * Constructs an instance of IntentsClient, using the given stub for making calls. This is for + * advanced usage - prefer to use IntentsSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final IntentsClient create(IntentsStub stub) { + return new IntentsClient(stub); + } + + /** + * Constructs an instance of IntentsClient, 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 IntentsClient(IntentsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((IntentsStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected IntentsClient(IntentsStub stub) { + this.settings = null; + this.stub = stub; + } + + public final IntentsSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public IntentsStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all intents in the specified agent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   for (Intent element : intentsClient.listIntents(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The agent to list all intents for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListIntentsPagedResponse listIntents(AgentName parent) { + ListIntentsRequest request = + ListIntentsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listIntents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all intents in the specified agent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   for (Intent element : intentsClient.listIntents(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The agent to list all intents for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListIntentsPagedResponse listIntents(String parent) { + ListIntentsRequest request = ListIntentsRequest.newBuilder().setParent(parent).build(); + return listIntents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all intents in the specified agent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListIntentsRequest request = ListIntentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Intent element : intentsClient.listIntents(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 ListIntentsPagedResponse listIntents(ListIntentsRequest request) { + return listIntentsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all intents in the specified agent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListIntentsRequest request = ListIntentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListIntentsPagedResponse> future = intentsClient.listIntentsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Intent element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listIntentsPagedCallable() { + return stub.listIntentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all intents in the specified agent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListIntentsRequest request = ListIntentsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListIntentsResponse response = intentsClient.listIntentsCallable().call(request);
+   *     for (Intent element : response.getIntentsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listIntentsCallable() { + return stub.listIntentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified intent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
+   *   Intent response = intentsClient.getIntent(name);
+   * }
+   * 
+ * + * @param name Required. The name of the intent. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Intent getIntent(IntentName name) { + GetIntentRequest request = + GetIntentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getIntent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified intent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
+   *   Intent response = intentsClient.getIntent(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the intent. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Intent getIntent(String name) { + GetIntentRequest request = GetIntentRequest.newBuilder().setName(name).build(); + return getIntent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified intent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
+   *   GetIntentRequest request = GetIntentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Intent response = intentsClient.getIntent(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 Intent getIntent(GetIntentRequest request) { + return getIntentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified intent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
+   *   GetIntentRequest request = GetIntentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Intent> future = intentsClient.getIntentCallable().futureCall(request);
+   *   // Do something
+   *   Intent response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getIntentCallable() { + return stub.getIntentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an intent in the specified agent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Intent intent = Intent.newBuilder().build();
+   *   Intent response = intentsClient.createIntent(parent, intent);
+   * }
+   * 
+ * + * @param parent Required. The agent to create an intent for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @param intent Required. The intent to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Intent createIntent(AgentName parent, Intent intent) { + CreateIntentRequest request = + CreateIntentRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setIntent(intent) + .build(); + return createIntent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an intent in the specified agent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Intent intent = Intent.newBuilder().build();
+   *   Intent response = intentsClient.createIntent(parent.toString(), intent);
+   * }
+   * 
+ * + * @param parent Required. The agent to create an intent for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @param intent Required. The intent to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Intent createIntent(String parent, Intent intent) { + CreateIntentRequest request = + CreateIntentRequest.newBuilder().setParent(parent).setIntent(intent).build(); + return createIntent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an intent in the specified agent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Intent intent = Intent.newBuilder().build();
+   *   CreateIntentRequest request = CreateIntentRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setIntent(intent)
+   *     .build();
+   *   Intent response = intentsClient.createIntent(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 Intent createIntent(CreateIntentRequest request) { + return createIntentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an intent in the specified agent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Intent intent = Intent.newBuilder().build();
+   *   CreateIntentRequest request = CreateIntentRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setIntent(intent)
+   *     .build();
+   *   ApiFuture<Intent> future = intentsClient.createIntentCallable().futureCall(request);
+   *   // Do something
+   *   Intent response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createIntentCallable() { + return stub.createIntentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified intent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   Intent intent = Intent.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Intent response = intentsClient.updateIntent(intent, updateMask);
+   * }
+   * 
+ * + * @param intent Required. The intent to update. + * @param updateMask The mask to control which fields get updated. If the mask is not present, all + * fields will be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Intent updateIntent(Intent intent, FieldMask updateMask) { + UpdateIntentRequest request = + UpdateIntentRequest.newBuilder().setIntent(intent).setUpdateMask(updateMask).build(); + return updateIntent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified intent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   Intent intent = Intent.newBuilder().build();
+   *   UpdateIntentRequest request = UpdateIntentRequest.newBuilder()
+   *     .setIntent(intent)
+   *     .build();
+   *   Intent response = intentsClient.updateIntent(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 Intent updateIntent(UpdateIntentRequest request) { + return updateIntentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified intent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   Intent intent = Intent.newBuilder().build();
+   *   UpdateIntentRequest request = UpdateIntentRequest.newBuilder()
+   *     .setIntent(intent)
+   *     .build();
+   *   ApiFuture<Intent> future = intentsClient.updateIntentCallable().futureCall(request);
+   *   // Do something
+   *   Intent response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateIntentCallable() { + return stub.updateIntentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified intent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
+   *   intentsClient.deleteIntent(name);
+   * }
+   * 
+ * + * @param name Required. The name of the intent to delete. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteIntent(IntentName name) { + DeleteIntentRequest request = + DeleteIntentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteIntent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified intent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
+   *   intentsClient.deleteIntent(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the intent to delete. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteIntent(String name) { + DeleteIntentRequest request = DeleteIntentRequest.newBuilder().setName(name).build(); + deleteIntent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified intent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
+   *   DeleteIntentRequest request = DeleteIntentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   intentsClient.deleteIntent(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 deleteIntent(DeleteIntentRequest request) { + deleteIntentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified intent. + * + *

Sample code: + * + *


+   * try (IntentsClient intentsClient = IntentsClient.create()) {
+   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
+   *   DeleteIntentRequest request = DeleteIntentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = intentsClient.deleteIntentCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteIntentCallable() { + return stub.deleteIntentCallable(); + } + + @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 ListIntentsPagedResponse + extends AbstractPagedListResponse< + ListIntentsRequest, + ListIntentsResponse, + Intent, + ListIntentsPage, + ListIntentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListIntentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListIntentsPagedResponse apply(ListIntentsPage input) { + return new ListIntentsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListIntentsPagedResponse(ListIntentsPage page) { + super(page, ListIntentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListIntentsPage + extends AbstractPage { + + private ListIntentsPage( + PageContext context, + ListIntentsResponse response) { + super(context, response); + } + + private static ListIntentsPage createEmptyPage() { + return new ListIntentsPage(null, null); + } + + @Override + protected ListIntentsPage createPage( + PageContext context, + ListIntentsResponse response) { + return new ListIntentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListIntentsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListIntentsRequest, + ListIntentsResponse, + Intent, + ListIntentsPage, + ListIntentsFixedSizeCollection> { + + private ListIntentsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListIntentsFixedSizeCollection createEmptyCollection() { + return new ListIntentsFixedSizeCollection(null, 0); + } + + @Override + protected ListIntentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListIntentsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsSettings.java new file mode 100644 index 000000000..298bf5345 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsSettings.java @@ -0,0 +1,225 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.IntentsClient.ListIntentsPagedResponse; + +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.dialogflow.cx.v3beta1.stub.IntentsStubSettings; +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 IntentsClient}. + * + *

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

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

+ * 
+ * IntentsSettings.Builder intentsSettingsBuilder =
+ *     IntentsSettings.newBuilder();
+ * intentsSettingsBuilder
+ *     .getIntentSettings()
+ *     .setRetrySettings(
+ *         intentsSettingsBuilder.getIntentSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * IntentsSettings intentsSettings = intentsSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class IntentsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listIntents. */ + public PagedCallSettings + listIntentsSettings() { + return ((IntentsStubSettings) getStubSettings()).listIntentsSettings(); + } + + /** Returns the object with the settings used for calls to getIntent. */ + public UnaryCallSettings getIntentSettings() { + return ((IntentsStubSettings) getStubSettings()).getIntentSettings(); + } + + /** Returns the object with the settings used for calls to createIntent. */ + public UnaryCallSettings createIntentSettings() { + return ((IntentsStubSettings) getStubSettings()).createIntentSettings(); + } + + /** Returns the object with the settings used for calls to updateIntent. */ + public UnaryCallSettings updateIntentSettings() { + return ((IntentsStubSettings) getStubSettings()).updateIntentSettings(); + } + + /** Returns the object with the settings used for calls to deleteIntent. */ + public UnaryCallSettings deleteIntentSettings() { + return ((IntentsStubSettings) getStubSettings()).deleteIntentSettings(); + } + + public static final IntentsSettings create(IntentsStubSettings stub) throws IOException { + return new IntentsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return IntentsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return IntentsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return IntentsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return IntentsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return IntentsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return IntentsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return IntentsStubSettings.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 IntentsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for IntentsSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(IntentsStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(IntentsStubSettings.newBuilder()); + } + + protected Builder(IntentsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(IntentsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public IntentsStubSettings.Builder getStubSettingsBuilder() { + return ((IntentsStubSettings.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 listIntents. */ + public PagedCallSettings.Builder< + ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse> + listIntentsSettings() { + return getStubSettingsBuilder().listIntentsSettings(); + } + + /** Returns the builder for the settings used for calls to getIntent. */ + public UnaryCallSettings.Builder getIntentSettings() { + return getStubSettingsBuilder().getIntentSettings(); + } + + /** Returns the builder for the settings used for calls to createIntent. */ + public UnaryCallSettings.Builder createIntentSettings() { + return getStubSettingsBuilder().createIntentSettings(); + } + + /** Returns the builder for the settings used for calls to updateIntent. */ + public UnaryCallSettings.Builder updateIntentSettings() { + return getStubSettingsBuilder().updateIntentSettings(); + } + + /** Returns the builder for the settings used for calls to deleteIntent. */ + public UnaryCallSettings.Builder deleteIntentSettings() { + return getStubSettingsBuilder().deleteIntentSettings(); + } + + @Override + public IntentsSettings build() throws IOException { + return new IntentsSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java new file mode 100644 index 000000000..b481c31a0 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java @@ -0,0 +1,742 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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.cloud.dialogflow.cx.v3beta1.stub.PagesStub; +import com.google.cloud.dialogflow.cx.v3beta1.stub.PagesStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +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 managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page]. + * + *

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 (PagesClient pagesClient = PagesClient.create()) {
+ *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
+ *   Page response = pagesClient.getPage(name);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * PagesSettings pagesSettings =
+ *     PagesSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * PagesClient pagesClient =
+ *     PagesClient.create(pagesSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * PagesSettings pagesSettings =
+ *     PagesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * PagesClient pagesClient =
+ *     PagesClient.create(pagesSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class PagesClient implements BackgroundResource { + private final PagesSettings settings; + private final PagesStub stub; + + /** Constructs an instance of PagesClient with default settings. */ + public static final PagesClient create() throws IOException { + return create(PagesSettings.newBuilder().build()); + } + + /** + * Constructs an instance of PagesClient, 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 PagesClient create(PagesSettings settings) throws IOException { + return new PagesClient(settings); + } + + /** + * Constructs an instance of PagesClient, using the given stub for making calls. This is for + * advanced usage - prefer to use PagesSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final PagesClient create(PagesStub stub) { + return new PagesClient(stub); + } + + /** + * Constructs an instance of PagesClient, 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 PagesClient(PagesSettings settings) throws IOException { + this.settings = settings; + this.stub = ((PagesStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected PagesClient(PagesStub stub) { + this.settings = null; + this.stub = stub; + } + + public final PagesSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public PagesStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all pages in the specified flow. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   for (Page element : pagesClient.listPages(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The flow to list all pages for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPagesPagedResponse listPages(FlowName parent) { + ListPagesRequest request = + ListPagesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listPages(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all pages in the specified flow. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   for (Page element : pagesClient.listPages(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The flow to list all pages for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPagesPagedResponse listPages(String parent) { + ListPagesRequest request = ListPagesRequest.newBuilder().setParent(parent).build(); + return listPages(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all pages in the specified flow. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   ListPagesRequest request = ListPagesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Page element : pagesClient.listPages(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 ListPagesPagedResponse listPages(ListPagesRequest request) { + return listPagesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all pages in the specified flow. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   ListPagesRequest request = ListPagesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListPagesPagedResponse> future = pagesClient.listPagesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Page element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listPagesPagedCallable() { + return stub.listPagesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all pages in the specified flow. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   ListPagesRequest request = ListPagesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListPagesResponse response = pagesClient.listPagesCallable().call(request);
+   *     for (Page element : response.getPagesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listPagesCallable() { + return stub.listPagesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified page. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
+   *   Page response = pagesClient.getPage(name);
+   * }
+   * 
+ * + * @param name Required. The name of the page. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow + * ID>/pages/<Page ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Page getPage(PageName name) { + GetPageRequest request = + GetPageRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getPage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified page. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
+   *   Page response = pagesClient.getPage(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the page. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow + * ID>/pages/<Page ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Page getPage(String name) { + GetPageRequest request = GetPageRequest.newBuilder().setName(name).build(); + return getPage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified page. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
+   *   GetPageRequest request = GetPageRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Page response = pagesClient.getPage(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 Page getPage(GetPageRequest request) { + return getPageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified page. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
+   *   GetPageRequest request = GetPageRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Page> future = pagesClient.getPageCallable().futureCall(request);
+   *   // Do something
+   *   Page response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getPageCallable() { + return stub.getPageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a page in the specified flow. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   Page page = Page.newBuilder().build();
+   *   Page response = pagesClient.createPage(parent, page);
+   * }
+   * 
+ * + * @param parent Required. The flow to create a page for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. + * @param page Required. The page to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Page createPage(FlowName parent, Page page) { + CreatePageRequest request = + CreatePageRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setPage(page) + .build(); + return createPage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a page in the specified flow. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   Page page = Page.newBuilder().build();
+   *   Page response = pagesClient.createPage(parent.toString(), page);
+   * }
+   * 
+ * + * @param parent Required. The flow to create a page for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. + * @param page Required. The page to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Page createPage(String parent, Page page) { + CreatePageRequest request = + CreatePageRequest.newBuilder().setParent(parent).setPage(page).build(); + return createPage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a page in the specified flow. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   Page page = Page.newBuilder().build();
+   *   CreatePageRequest request = CreatePageRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setPage(page)
+   *     .build();
+   *   Page response = pagesClient.createPage(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 Page createPage(CreatePageRequest request) { + return createPageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a page in the specified flow. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   Page page = Page.newBuilder().build();
+   *   CreatePageRequest request = CreatePageRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setPage(page)
+   *     .build();
+   *   ApiFuture<Page> future = pagesClient.createPageCallable().futureCall(request);
+   *   // Do something
+   *   Page response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createPageCallable() { + return stub.createPageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified page. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   Page page = Page.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Page response = pagesClient.updatePage(page, updateMask);
+   * }
+   * 
+ * + * @param page Required. The page to update. + * @param updateMask The mask to control which fields get updated. If the mask is not present, all + * fields will be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Page updatePage(Page page, FieldMask updateMask) { + UpdatePageRequest request = + UpdatePageRequest.newBuilder().setPage(page).setUpdateMask(updateMask).build(); + return updatePage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified page. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   Page page = Page.newBuilder().build();
+   *   UpdatePageRequest request = UpdatePageRequest.newBuilder()
+   *     .setPage(page)
+   *     .build();
+   *   Page response = pagesClient.updatePage(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 Page updatePage(UpdatePageRequest request) { + return updatePageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified page. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   Page page = Page.newBuilder().build();
+   *   UpdatePageRequest request = UpdatePageRequest.newBuilder()
+   *     .setPage(page)
+   *     .build();
+   *   ApiFuture<Page> future = pagesClient.updatePageCallable().futureCall(request);
+   *   // Do something
+   *   Page response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updatePageCallable() { + return stub.updatePageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified page. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
+   *   pagesClient.deletePage(name);
+   * }
+   * 
+ * + * @param name Required. The name of the page to delete. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/Flows/<flow + * ID>/pages/<Page ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deletePage(PageName name) { + DeletePageRequest request = + DeletePageRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deletePage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified page. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
+   *   pagesClient.deletePage(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the page to delete. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/Flows/<flow + * ID>/pages/<Page ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deletePage(String name) { + DeletePageRequest request = DeletePageRequest.newBuilder().setName(name).build(); + deletePage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified page. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
+   *   DeletePageRequest request = DeletePageRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   pagesClient.deletePage(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 deletePage(DeletePageRequest request) { + deletePageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified page. + * + *

Sample code: + * + *


+   * try (PagesClient pagesClient = PagesClient.create()) {
+   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
+   *   DeletePageRequest request = DeletePageRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = pagesClient.deletePageCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deletePageCallable() { + return stub.deletePageCallable(); + } + + @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 ListPagesPagedResponse + extends AbstractPagedListResponse< + ListPagesRequest, ListPagesResponse, Page, ListPagesPage, ListPagesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListPagesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListPagesPagedResponse apply(ListPagesPage input) { + return new ListPagesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListPagesPagedResponse(ListPagesPage page) { + super(page, ListPagesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListPagesPage + extends AbstractPage { + + private ListPagesPage( + PageContext context, + ListPagesResponse response) { + super(context, response); + } + + private static ListPagesPage createEmptyPage() { + return new ListPagesPage(null, null); + } + + @Override + protected ListPagesPage createPage( + PageContext context, + ListPagesResponse response) { + return new ListPagesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListPagesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListPagesRequest, ListPagesResponse, Page, ListPagesPage, ListPagesFixedSizeCollection> { + + private ListPagesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListPagesFixedSizeCollection createEmptyCollection() { + return new ListPagesFixedSizeCollection(null, 0); + } + + @Override + protected ListPagesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListPagesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesSettings.java new file mode 100644 index 000000000..61cbe4cdc --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesSettings.java @@ -0,0 +1,224 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.PagesClient.ListPagesPagedResponse; + +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.dialogflow.cx.v3beta1.stub.PagesStubSettings; +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 PagesClient}. + * + *

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

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

+ * 
+ * PagesSettings.Builder pagesSettingsBuilder =
+ *     PagesSettings.newBuilder();
+ * pagesSettingsBuilder
+ *     .getPageSettings()
+ *     .setRetrySettings(
+ *         pagesSettingsBuilder.getPageSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PagesSettings pagesSettings = pagesSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class PagesSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listPages. */ + public PagedCallSettings + listPagesSettings() { + return ((PagesStubSettings) getStubSettings()).listPagesSettings(); + } + + /** Returns the object with the settings used for calls to getPage. */ + public UnaryCallSettings getPageSettings() { + return ((PagesStubSettings) getStubSettings()).getPageSettings(); + } + + /** Returns the object with the settings used for calls to createPage. */ + public UnaryCallSettings createPageSettings() { + return ((PagesStubSettings) getStubSettings()).createPageSettings(); + } + + /** Returns the object with the settings used for calls to updatePage. */ + public UnaryCallSettings updatePageSettings() { + return ((PagesStubSettings) getStubSettings()).updatePageSettings(); + } + + /** Returns the object with the settings used for calls to deletePage. */ + public UnaryCallSettings deletePageSettings() { + return ((PagesStubSettings) getStubSettings()).deletePageSettings(); + } + + public static final PagesSettings create(PagesStubSettings stub) throws IOException { + return new PagesSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return PagesStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return PagesStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return PagesStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return PagesStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return PagesStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return PagesStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return PagesStubSettings.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 PagesSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for PagesSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(PagesStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(PagesStubSettings.newBuilder()); + } + + protected Builder(PagesSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(PagesStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public PagesStubSettings.Builder getStubSettingsBuilder() { + return ((PagesStubSettings.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 listPages. */ + public PagedCallSettings.Builder + listPagesSettings() { + return getStubSettingsBuilder().listPagesSettings(); + } + + /** Returns the builder for the settings used for calls to getPage. */ + public UnaryCallSettings.Builder getPageSettings() { + return getStubSettingsBuilder().getPageSettings(); + } + + /** Returns the builder for the settings used for calls to createPage. */ + public UnaryCallSettings.Builder createPageSettings() { + return getStubSettingsBuilder().createPageSettings(); + } + + /** Returns the builder for the settings used for calls to updatePage. */ + public UnaryCallSettings.Builder updatePageSettings() { + return getStubSettingsBuilder().updatePageSettings(); + } + + /** Returns the builder for the settings used for calls to deletePage. */ + public UnaryCallSettings.Builder deletePageSettings() { + return getStubSettingsBuilder().deletePageSettings(); + } + + @Override + public PagesSettings build() throws IOException { + return new PagesSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java new file mode 100644 index 000000000..9c4e4f067 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java @@ -0,0 +1,805 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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.cloud.dialogflow.cx.v3beta1.stub.SessionEntityTypesStub; +import com.google.cloud.dialogflow.cx.v3beta1.stub.SessionEntityTypesStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +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 managing + * [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType]. + * + *

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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+ *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
+ *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * SessionEntityTypesSettings sessionEntityTypesSettings =
+ *     SessionEntityTypesSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SessionEntityTypesClient sessionEntityTypesClient =
+ *     SessionEntityTypesClient.create(sessionEntityTypesSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * SessionEntityTypesSettings sessionEntityTypesSettings =
+ *     SessionEntityTypesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SessionEntityTypesClient sessionEntityTypesClient =
+ *     SessionEntityTypesClient.create(sessionEntityTypesSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class SessionEntityTypesClient implements BackgroundResource { + private final SessionEntityTypesSettings settings; + private final SessionEntityTypesStub stub; + + /** Constructs an instance of SessionEntityTypesClient with default settings. */ + public static final SessionEntityTypesClient create() throws IOException { + return create(SessionEntityTypesSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SessionEntityTypesClient, 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 SessionEntityTypesClient create(SessionEntityTypesSettings settings) + throws IOException { + return new SessionEntityTypesClient(settings); + } + + /** + * Constructs an instance of SessionEntityTypesClient, using the given stub for making calls. This + * is for advanced usage - prefer to use SessionEntityTypesSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final SessionEntityTypesClient create(SessionEntityTypesStub stub) { + return new SessionEntityTypesClient(stub); + } + + /** + * Constructs an instance of SessionEntityTypesClient, 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 SessionEntityTypesClient(SessionEntityTypesSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SessionEntityTypesStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected SessionEntityTypesClient(SessionEntityTypesStub stub) { + this.settings = null; + this.stub = stub; + } + + public final SessionEntityTypesSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SessionEntityTypesStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all session entity types in the specified session. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+   *   for (SessionEntityType element : sessionEntityTypesClient.listSessionEntityTypes(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The session to list all session entity types from. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/sessions/<Session ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSessionEntityTypesPagedResponse listSessionEntityTypes(SessionName parent) { + ListSessionEntityTypesRequest request = + ListSessionEntityTypesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listSessionEntityTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all session entity types in the specified session. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+   *   for (SessionEntityType element : sessionEntityTypesClient.listSessionEntityTypes(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The session to list all session entity types from. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/sessions/<Session ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSessionEntityTypesPagedResponse listSessionEntityTypes(String parent) { + ListSessionEntityTypesRequest request = + ListSessionEntityTypesRequest.newBuilder().setParent(parent).build(); + return listSessionEntityTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all session entity types in the specified session. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+   *   ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (SessionEntityType element : sessionEntityTypesClient.listSessionEntityTypes(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 ListSessionEntityTypesPagedResponse listSessionEntityTypes( + ListSessionEntityTypesRequest request) { + return listSessionEntityTypesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all session entity types in the specified session. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+   *   ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListSessionEntityTypesPagedResponse> future = sessionEntityTypesClient.listSessionEntityTypesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (SessionEntityType element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listSessionEntityTypesPagedCallable() { + return stub.listSessionEntityTypesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all session entity types in the specified session. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+   *   ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListSessionEntityTypesResponse response = sessionEntityTypesClient.listSessionEntityTypesCallable().call(request);
+   *     for (SessionEntityType element : response.getSessionEntityTypesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listSessionEntityTypesCallable() { + return stub.listSessionEntityTypesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
+   *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
+   * }
+   * 
+ * + * @param name Required. The name of the session entity type. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/sessions/<Session + * ID>/entityTypes/<Entity Type ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SessionEntityType getSessionEntityType(SessionEntityTypeName name) { + GetSessionEntityTypeRequest request = + GetSessionEntityTypeRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getSessionEntityType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
+   *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the session entity type. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/sessions/<Session + * ID>/entityTypes/<Entity Type ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SessionEntityType getSessionEntityType(String name) { + GetSessionEntityTypeRequest request = + GetSessionEntityTypeRequest.newBuilder().setName(name).build(); + return getSessionEntityType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
+   *   GetSessionEntityTypeRequest request = GetSessionEntityTypeRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(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 SessionEntityType getSessionEntityType(GetSessionEntityTypeRequest request) { + return getSessionEntityTypeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
+   *   GetSessionEntityTypeRequest request = GetSessionEntityTypeRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<SessionEntityType> future = sessionEntityTypesClient.getSessionEntityTypeCallable().futureCall(request);
+   *   // Do something
+   *   SessionEntityType response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + getSessionEntityTypeCallable() { + return stub.getSessionEntityTypeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a session entity type. + * + *

If the specified session entity type already exists, overrides the session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
+   *   SessionEntityType response = sessionEntityTypesClient.createSessionEntityType(parent, sessionEntityType);
+   * }
+   * 
+ * + * @param parent Required. The session to create a session entity type for. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/sessions/<Session ID>`. + * @param sessionEntityType Required. The session entity type to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SessionEntityType createSessionEntityType( + SessionName parent, SessionEntityType sessionEntityType) { + CreateSessionEntityTypeRequest request = + CreateSessionEntityTypeRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSessionEntityType(sessionEntityType) + .build(); + return createSessionEntityType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a session entity type. + * + *

If the specified session entity type already exists, overrides the session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
+   *   SessionEntityType response = sessionEntityTypesClient.createSessionEntityType(parent.toString(), sessionEntityType);
+   * }
+   * 
+ * + * @param parent Required. The session to create a session entity type for. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/sessions/<Session ID>`. + * @param sessionEntityType Required. The session entity type to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SessionEntityType createSessionEntityType( + String parent, SessionEntityType sessionEntityType) { + CreateSessionEntityTypeRequest request = + CreateSessionEntityTypeRequest.newBuilder() + .setParent(parent) + .setSessionEntityType(sessionEntityType) + .build(); + return createSessionEntityType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a session entity type. + * + *

If the specified session entity type already exists, overrides the session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
+   *   CreateSessionEntityTypeRequest request = CreateSessionEntityTypeRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setSessionEntityType(sessionEntityType)
+   *     .build();
+   *   SessionEntityType response = sessionEntityTypesClient.createSessionEntityType(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 SessionEntityType createSessionEntityType(CreateSessionEntityTypeRequest request) { + return createSessionEntityTypeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a session entity type. + * + *

If the specified session entity type already exists, overrides the session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
+   *   CreateSessionEntityTypeRequest request = CreateSessionEntityTypeRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setSessionEntityType(sessionEntityType)
+   *     .build();
+   *   ApiFuture<SessionEntityType> future = sessionEntityTypesClient.createSessionEntityTypeCallable().futureCall(request);
+   *   // Do something
+   *   SessionEntityType response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + createSessionEntityTypeCallable() { + return stub.createSessionEntityTypeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   SessionEntityType response = sessionEntityTypesClient.updateSessionEntityType(sessionEntityType, updateMask);
+   * }
+   * 
+ * + * @param sessionEntityType Required. The session entity type to update. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`. + * @param updateMask The mask to control which fields get updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SessionEntityType updateSessionEntityType( + SessionEntityType sessionEntityType, FieldMask updateMask) { + UpdateSessionEntityTypeRequest request = + UpdateSessionEntityTypeRequest.newBuilder() + .setSessionEntityType(sessionEntityType) + .setUpdateMask(updateMask) + .build(); + return updateSessionEntityType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
+   *   UpdateSessionEntityTypeRequest request = UpdateSessionEntityTypeRequest.newBuilder()
+   *     .setSessionEntityType(sessionEntityType)
+   *     .build();
+   *   SessionEntityType response = sessionEntityTypesClient.updateSessionEntityType(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 SessionEntityType updateSessionEntityType(UpdateSessionEntityTypeRequest request) { + return updateSessionEntityTypeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
+   *   UpdateSessionEntityTypeRequest request = UpdateSessionEntityTypeRequest.newBuilder()
+   *     .setSessionEntityType(sessionEntityType)
+   *     .build();
+   *   ApiFuture<SessionEntityType> future = sessionEntityTypesClient.updateSessionEntityTypeCallable().futureCall(request);
+   *   // Do something
+   *   SessionEntityType response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + updateSessionEntityTypeCallable() { + return stub.updateSessionEntityTypeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
+   *   sessionEntityTypesClient.deleteSessionEntityType(name);
+   * }
+   * 
+ * + * @param name Required. The name of the session entity type to delete. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSessionEntityType(SessionEntityTypeName name) { + DeleteSessionEntityTypeRequest request = + DeleteSessionEntityTypeRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteSessionEntityType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
+   *   sessionEntityTypesClient.deleteSessionEntityType(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the session entity type to delete. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSessionEntityType(String name) { + DeleteSessionEntityTypeRequest request = + DeleteSessionEntityTypeRequest.newBuilder().setName(name).build(); + deleteSessionEntityType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
+   *   DeleteSessionEntityTypeRequest request = DeleteSessionEntityTypeRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   sessionEntityTypesClient.deleteSessionEntityType(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 deleteSessionEntityType(DeleteSessionEntityTypeRequest request) { + deleteSessionEntityTypeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified session entity type. + * + *

Sample code: + * + *


+   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
+   *   DeleteSessionEntityTypeRequest request = DeleteSessionEntityTypeRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = sessionEntityTypesClient.deleteSessionEntityTypeCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + deleteSessionEntityTypeCallable() { + return stub.deleteSessionEntityTypeCallable(); + } + + @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 ListSessionEntityTypesPagedResponse + extends AbstractPagedListResponse< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + SessionEntityType, + ListSessionEntityTypesPage, + ListSessionEntityTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, SessionEntityType> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSessionEntityTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListSessionEntityTypesPagedResponse apply(ListSessionEntityTypesPage input) { + return new ListSessionEntityTypesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListSessionEntityTypesPagedResponse(ListSessionEntityTypesPage page) { + super(page, ListSessionEntityTypesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSessionEntityTypesPage + extends AbstractPage< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + SessionEntityType, + ListSessionEntityTypesPage> { + + private ListSessionEntityTypesPage( + PageContext< + ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, SessionEntityType> + context, + ListSessionEntityTypesResponse response) { + super(context, response); + } + + private static ListSessionEntityTypesPage createEmptyPage() { + return new ListSessionEntityTypesPage(null, null); + } + + @Override + protected ListSessionEntityTypesPage createPage( + PageContext< + ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, SessionEntityType> + context, + ListSessionEntityTypesResponse response) { + return new ListSessionEntityTypesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, SessionEntityType> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSessionEntityTypesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + SessionEntityType, + ListSessionEntityTypesPage, + ListSessionEntityTypesFixedSizeCollection> { + + private ListSessionEntityTypesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSessionEntityTypesFixedSizeCollection createEmptyCollection() { + return new ListSessionEntityTypesFixedSizeCollection(null, 0); + } + + @Override + protected ListSessionEntityTypesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSessionEntityTypesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesSettings.java new file mode 100644 index 000000000..803ee9c52 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesSettings.java @@ -0,0 +1,239 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; + +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.dialogflow.cx.v3beta1.stub.SessionEntityTypesStubSettings; +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 SessionEntityTypesClient}. + * + *

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

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

+ * 
+ * SessionEntityTypesSettings.Builder sessionEntityTypesSettingsBuilder =
+ *     SessionEntityTypesSettings.newBuilder();
+ * sessionEntityTypesSettingsBuilder
+ *     .getSessionEntityTypeSettings()
+ *     .setRetrySettings(
+ *         sessionEntityTypesSettingsBuilder.getSessionEntityTypeSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SessionEntityTypesSettings sessionEntityTypesSettings = sessionEntityTypesSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class SessionEntityTypesSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listSessionEntityTypes. */ + public PagedCallSettings< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + ListSessionEntityTypesPagedResponse> + listSessionEntityTypesSettings() { + return ((SessionEntityTypesStubSettings) getStubSettings()).listSessionEntityTypesSettings(); + } + + /** Returns the object with the settings used for calls to getSessionEntityType. */ + public UnaryCallSettings + getSessionEntityTypeSettings() { + return ((SessionEntityTypesStubSettings) getStubSettings()).getSessionEntityTypeSettings(); + } + + /** Returns the object with the settings used for calls to createSessionEntityType. */ + public UnaryCallSettings + createSessionEntityTypeSettings() { + return ((SessionEntityTypesStubSettings) getStubSettings()).createSessionEntityTypeSettings(); + } + + /** Returns the object with the settings used for calls to updateSessionEntityType. */ + public UnaryCallSettings + updateSessionEntityTypeSettings() { + return ((SessionEntityTypesStubSettings) getStubSettings()).updateSessionEntityTypeSettings(); + } + + /** Returns the object with the settings used for calls to deleteSessionEntityType. */ + public UnaryCallSettings + deleteSessionEntityTypeSettings() { + return ((SessionEntityTypesStubSettings) getStubSettings()).deleteSessionEntityTypeSettings(); + } + + public static final SessionEntityTypesSettings create(SessionEntityTypesStubSettings stub) + throws IOException { + return new SessionEntityTypesSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SessionEntityTypesStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SessionEntityTypesStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SessionEntityTypesStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SessionEntityTypesStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SessionEntityTypesStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SessionEntityTypesStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SessionEntityTypesStubSettings.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 SessionEntityTypesSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SessionEntityTypesSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(SessionEntityTypesStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(SessionEntityTypesStubSettings.newBuilder()); + } + + protected Builder(SessionEntityTypesSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SessionEntityTypesStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public SessionEntityTypesStubSettings.Builder getStubSettingsBuilder() { + return ((SessionEntityTypesStubSettings.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 listSessionEntityTypes. */ + public PagedCallSettings.Builder< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + ListSessionEntityTypesPagedResponse> + listSessionEntityTypesSettings() { + return getStubSettingsBuilder().listSessionEntityTypesSettings(); + } + + /** Returns the builder for the settings used for calls to getSessionEntityType. */ + public UnaryCallSettings.Builder + getSessionEntityTypeSettings() { + return getStubSettingsBuilder().getSessionEntityTypeSettings(); + } + + /** Returns the builder for the settings used for calls to createSessionEntityType. */ + public UnaryCallSettings.Builder + createSessionEntityTypeSettings() { + return getStubSettingsBuilder().createSessionEntityTypeSettings(); + } + + /** Returns the builder for the settings used for calls to updateSessionEntityType. */ + public UnaryCallSettings.Builder + updateSessionEntityTypeSettings() { + return getStubSettingsBuilder().updateSessionEntityTypeSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSessionEntityType. */ + public UnaryCallSettings.Builder + deleteSessionEntityTypeSettings() { + return getStubSettingsBuilder().deleteSessionEntityTypeSettings(); + } + + @Override + public SessionEntityTypesSettings build() throws IOException { + return new SessionEntityTypesSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClient.java new file mode 100644 index 000000000..b04f28d08 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClient.java @@ -0,0 +1,360 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3beta1.stub.SessionsStub; +import com.google.cloud.dialogflow.cx.v3beta1.stub.SessionsStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: A session represents an interaction with a user. You retrieve user input and + * pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to + * determine user intent and respond. + * + *

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 (SessionsClient sessionsClient = SessionsClient.create()) {
+ *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+ *   QueryInput queryInput = QueryInput.newBuilder().build();
+ *   DetectIntentRequest request = DetectIntentRequest.newBuilder()
+ *     .setSession(session.toString())
+ *     .setQueryInput(queryInput)
+ *     .build();
+ *   DetectIntentResponse response = sessionsClient.detectIntent(request);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * SessionsSettings sessionsSettings =
+ *     SessionsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SessionsClient sessionsClient =
+ *     SessionsClient.create(sessionsSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * SessionsSettings sessionsSettings =
+ *     SessionsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SessionsClient sessionsClient =
+ *     SessionsClient.create(sessionsSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class SessionsClient implements BackgroundResource { + private final SessionsSettings settings; + private final SessionsStub stub; + + /** Constructs an instance of SessionsClient with default settings. */ + public static final SessionsClient create() throws IOException { + return create(SessionsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SessionsClient, 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 SessionsClient create(SessionsSettings settings) throws IOException { + return new SessionsClient(settings); + } + + /** + * Constructs an instance of SessionsClient, using the given stub for making calls. This is for + * advanced usage - prefer to use SessionsSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final SessionsClient create(SessionsStub stub) { + return new SessionsClient(stub); + } + + /** + * Constructs an instance of SessionsClient, 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 SessionsClient(SessionsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SessionsStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected SessionsClient(SessionsStub stub) { + this.settings = null; + this.stub = stub; + } + + public final SessionsSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SessionsStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Processes a natural language query and returns structured, actionable data as a result. This + * method is not idempotent, because it may cause session entity types to be updated, which in + * turn might affect results of future queries. + * + *

Sample code: + * + *


+   * try (SessionsClient sessionsClient = SessionsClient.create()) {
+   *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+   *   QueryInput queryInput = QueryInput.newBuilder().build();
+   *   DetectIntentRequest request = DetectIntentRequest.newBuilder()
+   *     .setSession(session.toString())
+   *     .setQueryInput(queryInput)
+   *     .build();
+   *   DetectIntentResponse response = sessionsClient.detectIntent(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 DetectIntentResponse detectIntent(DetectIntentRequest request) { + return detectIntentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Processes a natural language query and returns structured, actionable data as a result. This + * method is not idempotent, because it may cause session entity types to be updated, which in + * turn might affect results of future queries. + * + *

Sample code: + * + *


+   * try (SessionsClient sessionsClient = SessionsClient.create()) {
+   *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+   *   QueryInput queryInput = QueryInput.newBuilder().build();
+   *   DetectIntentRequest request = DetectIntentRequest.newBuilder()
+   *     .setSession(session.toString())
+   *     .setQueryInput(queryInput)
+   *     .build();
+   *   ApiFuture<DetectIntentResponse> future = sessionsClient.detectIntentCallable().futureCall(request);
+   *   // Do something
+   *   DetectIntentResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable detectIntentCallable() { + return stub.detectIntentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Processes a natural language query in audio format in a streaming fashion and returns + * structured, actionable data as a result. This method is only available via the gRPC API (not + * REST). + * + *

Sample code: + * + *


+   * try (SessionsClient sessionsClient = SessionsClient.create()) {
+   *   BidiStream<StreamingDetectIntentRequest, StreamingDetectIntentResponse> bidiStream =
+   *       sessionsClient.streamingDetectIntentCallable().call();
+   *
+   *   QueryInput queryInput = QueryInput.newBuilder().build();
+   *   StreamingDetectIntentRequest request = StreamingDetectIntentRequest.newBuilder()
+   *     .setQueryInput(queryInput)
+   *     .build();
+   *   bidiStream.send(request);
+   *   for (StreamingDetectIntentResponse response : bidiStream) {
+   *     // Do something when receive a response
+   *   }
+   * }
+   * 
+ */ + public final BidiStreamingCallable + streamingDetectIntentCallable() { + return stub.streamingDetectIntentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns preliminary intent match results, doesn't change the session status. + * + *

Sample code: + * + *


+   * try (SessionsClient sessionsClient = SessionsClient.create()) {
+   *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+   *   QueryInput queryInput = QueryInput.newBuilder().build();
+   *   MatchIntentRequest request = MatchIntentRequest.newBuilder()
+   *     .setSession(session.toString())
+   *     .setQueryInput(queryInput)
+   *     .build();
+   *   MatchIntentResponse response = sessionsClient.matchIntent(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 MatchIntentResponse matchIntent(MatchIntentRequest request) { + return matchIntentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns preliminary intent match results, doesn't change the session status. + * + *

Sample code: + * + *


+   * try (SessionsClient sessionsClient = SessionsClient.create()) {
+   *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+   *   QueryInput queryInput = QueryInput.newBuilder().build();
+   *   MatchIntentRequest request = MatchIntentRequest.newBuilder()
+   *     .setSession(session.toString())
+   *     .setQueryInput(queryInput)
+   *     .build();
+   *   ApiFuture<MatchIntentResponse> future = sessionsClient.matchIntentCallable().futureCall(request);
+   *   // Do something
+   *   MatchIntentResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable matchIntentCallable() { + return stub.matchIntentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Fulfills a matched intent returned by + * [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent]. Must be called after + * [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from + * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the + * behavior is undefined. + * + *

Sample code: + * + *


+   * try (SessionsClient sessionsClient = SessionsClient.create()) {
+   *   FulfillIntentRequest request = FulfillIntentRequest.newBuilder().build();
+   *   FulfillIntentResponse response = sessionsClient.fulfillIntent(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 FulfillIntentResponse fulfillIntent(FulfillIntentRequest request) { + return fulfillIntentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Fulfills a matched intent returned by + * [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent]. Must be called after + * [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from + * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the + * behavior is undefined. + * + *

Sample code: + * + *


+   * try (SessionsClient sessionsClient = SessionsClient.create()) {
+   *   FulfillIntentRequest request = FulfillIntentRequest.newBuilder().build();
+   *   ApiFuture<FulfillIntentResponse> future = sessionsClient.fulfillIntentCallable().futureCall(request);
+   *   // Do something
+   *   FulfillIntentResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable fulfillIntentCallable() { + return stub.fulfillIntentCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsSettings.java new file mode 100644 index 000000000..709df6271 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsSettings.java @@ -0,0 +1,215 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.dialogflow.cx.v3beta1; + +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.StreamingCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.dialogflow.cx.v3beta1.stub.SessionsStubSettings; +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 SessionsClient}. + * + *

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

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

+ * 
+ * SessionsSettings.Builder sessionsSettingsBuilder =
+ *     SessionsSettings.newBuilder();
+ * sessionsSettingsBuilder
+ *     .detectIntentSettings()
+ *     .setRetrySettings(
+ *         sessionsSettingsBuilder.detectIntentSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SessionsSettings sessionsSettings = sessionsSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class SessionsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to detectIntent. */ + public UnaryCallSettings detectIntentSettings() { + return ((SessionsStubSettings) getStubSettings()).detectIntentSettings(); + } + + /** Returns the object with the settings used for calls to streamingDetectIntent. */ + public StreamingCallSettings + streamingDetectIntentSettings() { + return ((SessionsStubSettings) getStubSettings()).streamingDetectIntentSettings(); + } + + /** Returns the object with the settings used for calls to matchIntent. */ + public UnaryCallSettings matchIntentSettings() { + return ((SessionsStubSettings) getStubSettings()).matchIntentSettings(); + } + + /** Returns the object with the settings used for calls to fulfillIntent. */ + public UnaryCallSettings fulfillIntentSettings() { + return ((SessionsStubSettings) getStubSettings()).fulfillIntentSettings(); + } + + public static final SessionsSettings create(SessionsStubSettings stub) throws IOException { + return new SessionsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SessionsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SessionsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SessionsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SessionsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SessionsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SessionsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SessionsStubSettings.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 SessionsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SessionsSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(SessionsStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(SessionsStubSettings.newBuilder()); + } + + protected Builder(SessionsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SessionsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public SessionsStubSettings.Builder getStubSettingsBuilder() { + return ((SessionsStubSettings.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 detectIntent. */ + public UnaryCallSettings.Builder + detectIntentSettings() { + return getStubSettingsBuilder().detectIntentSettings(); + } + + /** Returns the builder for the settings used for calls to streamingDetectIntent. */ + public StreamingCallSettings.Builder< + StreamingDetectIntentRequest, StreamingDetectIntentResponse> + streamingDetectIntentSettings() { + return getStubSettingsBuilder().streamingDetectIntentSettings(); + } + + /** Returns the builder for the settings used for calls to matchIntent. */ + public UnaryCallSettings.Builder + matchIntentSettings() { + return getStubSettingsBuilder().matchIntentSettings(); + } + + /** Returns the builder for the settings used for calls to fulfillIntent. */ + public UnaryCallSettings.Builder + fulfillIntentSettings() { + return getStubSettingsBuilder().fulfillIntentSettings(); + } + + @Override + public SessionsSettings build() throws IOException { + return new SessionsSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java new file mode 100644 index 000000000..4e8361932 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java @@ -0,0 +1,829 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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.cloud.dialogflow.cx.v3beta1.stub.TransitionRouteGroupsStub; +import com.google.cloud.dialogflow.cx.v3beta1.stub.TransitionRouteGroupsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +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 managing + * [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + * + *

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 (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+ *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
+ *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * TransitionRouteGroupsSettings transitionRouteGroupsSettings =
+ *     TransitionRouteGroupsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * TransitionRouteGroupsClient transitionRouteGroupsClient =
+ *     TransitionRouteGroupsClient.create(transitionRouteGroupsSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * TransitionRouteGroupsSettings transitionRouteGroupsSettings =
+ *     TransitionRouteGroupsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * TransitionRouteGroupsClient transitionRouteGroupsClient =
+ *     TransitionRouteGroupsClient.create(transitionRouteGroupsSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class TransitionRouteGroupsClient implements BackgroundResource { + private final TransitionRouteGroupsSettings settings; + private final TransitionRouteGroupsStub stub; + + /** Constructs an instance of TransitionRouteGroupsClient with default settings. */ + public static final TransitionRouteGroupsClient create() throws IOException { + return create(TransitionRouteGroupsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of TransitionRouteGroupsClient, 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 TransitionRouteGroupsClient create(TransitionRouteGroupsSettings settings) + throws IOException { + return new TransitionRouteGroupsClient(settings); + } + + /** + * Constructs an instance of TransitionRouteGroupsClient, using the given stub for making calls. + * This is for advanced usage - prefer to use TransitionRouteGroupsSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final TransitionRouteGroupsClient create(TransitionRouteGroupsStub stub) { + return new TransitionRouteGroupsClient(stub); + } + + /** + * Constructs an instance of TransitionRouteGroupsClient, 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 TransitionRouteGroupsClient(TransitionRouteGroupsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((TransitionRouteGroupsStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected TransitionRouteGroupsClient(TransitionRouteGroupsStub stub) { + this.settings = null; + this.stub = stub; + } + + public final TransitionRouteGroupsSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TransitionRouteGroupsStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all transition route groups in the specified flow. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   for (TransitionRouteGroup element : transitionRouteGroupsClient.listTransitionRouteGroups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The flow to list all transition route groups for. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/flows/<Flow ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups(FlowName parent) { + ListTransitionRouteGroupsRequest request = + ListTransitionRouteGroupsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listTransitionRouteGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all transition route groups in the specified flow. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   for (TransitionRouteGroup element : transitionRouteGroupsClient.listTransitionRouteGroups(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The flow to list all transition route groups for. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/flows/<Flow ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups(String parent) { + ListTransitionRouteGroupsRequest request = + ListTransitionRouteGroupsRequest.newBuilder().setParent(parent).build(); + return listTransitionRouteGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all transition route groups in the specified flow. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (TransitionRouteGroup element : transitionRouteGroupsClient.listTransitionRouteGroups(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 ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups( + ListTransitionRouteGroupsRequest request) { + return listTransitionRouteGroupsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all transition route groups in the specified flow. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListTransitionRouteGroupsPagedResponse> future = transitionRouteGroupsClient.listTransitionRouteGroupsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (TransitionRouteGroup element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable< + ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsPagedResponse> + listTransitionRouteGroupsPagedCallable() { + return stub.listTransitionRouteGroupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all transition route groups in the specified flow. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListTransitionRouteGroupsResponse response = transitionRouteGroupsClient.listTransitionRouteGroupsCallable().call(request);
+   *     for (TransitionRouteGroup element : response.getTransitionRouteGroupsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listTransitionRouteGroupsCallable() { + return stub.listTransitionRouteGroupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
+   *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name);
+   * }
+   * 
+ * + * @param name Required. The name of the + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TransitionRouteGroup getTransitionRouteGroup(TransitionRouteGroupName name) { + GetTransitionRouteGroupRequest request = + GetTransitionRouteGroupRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getTransitionRouteGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
+   *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. Format: + * `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TransitionRouteGroup getTransitionRouteGroup(String name) { + GetTransitionRouteGroupRequest request = + GetTransitionRouteGroupRequest.newBuilder().setName(name).build(); + return getTransitionRouteGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
+   *   GetTransitionRouteGroupRequest request = GetTransitionRouteGroupRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(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 TransitionRouteGroup getTransitionRouteGroup( + GetTransitionRouteGroupRequest request) { + return getTransitionRouteGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
+   *   GetTransitionRouteGroupRequest request = GetTransitionRouteGroupRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<TransitionRouteGroup> future = transitionRouteGroupsClient.getTransitionRouteGroupCallable().futureCall(request);
+   *   // Do something
+   *   TransitionRouteGroup response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + getTransitionRouteGroupCallable() { + return stub.getTransitionRouteGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in + * the specified flow. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
+   *   TransitionRouteGroup response = transitionRouteGroupsClient.createTransitionRouteGroup(parent, transitionRouteGroup);
+   * }
+   * 
+ * + * @param parent Required. The flow to create an + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for. + * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/flows/<Flow ID>`. + * @param transitionRouteGroup Required. The transition route group to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TransitionRouteGroup createTransitionRouteGroup( + FlowName parent, TransitionRouteGroup transitionRouteGroup) { + CreateTransitionRouteGroupRequest request = + CreateTransitionRouteGroupRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setTransitionRouteGroup(transitionRouteGroup) + .build(); + return createTransitionRouteGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in + * the specified flow. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
+   *   TransitionRouteGroup response = transitionRouteGroupsClient.createTransitionRouteGroup(parent.toString(), transitionRouteGroup);
+   * }
+   * 
+ * + * @param parent Required. The flow to create an + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for. + * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/flows/<Flow ID>`. + * @param transitionRouteGroup Required. The transition route group to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TransitionRouteGroup createTransitionRouteGroup( + String parent, TransitionRouteGroup transitionRouteGroup) { + CreateTransitionRouteGroupRequest request = + CreateTransitionRouteGroupRequest.newBuilder() + .setParent(parent) + .setTransitionRouteGroup(transitionRouteGroup) + .build(); + return createTransitionRouteGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in + * the specified flow. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
+   *   CreateTransitionRouteGroupRequest request = CreateTransitionRouteGroupRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setTransitionRouteGroup(transitionRouteGroup)
+   *     .build();
+   *   TransitionRouteGroup response = transitionRouteGroupsClient.createTransitionRouteGroup(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 TransitionRouteGroup createTransitionRouteGroup( + CreateTransitionRouteGroupRequest request) { + return createTransitionRouteGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in + * the specified flow. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
+   *   CreateTransitionRouteGroupRequest request = CreateTransitionRouteGroupRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setTransitionRouteGroup(transitionRouteGroup)
+   *     .build();
+   *   ApiFuture<TransitionRouteGroup> future = transitionRouteGroupsClient.createTransitionRouteGroupCallable().futureCall(request);
+   *   // Do something
+   *   TransitionRouteGroup response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + createTransitionRouteGroupCallable() { + return stub.createTransitionRouteGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   TransitionRouteGroup response = transitionRouteGroupsClient.updateTransitionRouteGroup(transitionRouteGroup, updateMask);
+   * }
+   * 
+ * + * @param transitionRouteGroup Required. The transition route group to update. + * @param updateMask The mask to control which fields get updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TransitionRouteGroup updateTransitionRouteGroup( + TransitionRouteGroup transitionRouteGroup, FieldMask updateMask) { + UpdateTransitionRouteGroupRequest request = + UpdateTransitionRouteGroupRequest.newBuilder() + .setTransitionRouteGroup(transitionRouteGroup) + .setUpdateMask(updateMask) + .build(); + return updateTransitionRouteGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
+   *   UpdateTransitionRouteGroupRequest request = UpdateTransitionRouteGroupRequest.newBuilder()
+   *     .setTransitionRouteGroup(transitionRouteGroup)
+   *     .build();
+   *   TransitionRouteGroup response = transitionRouteGroupsClient.updateTransitionRouteGroup(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 TransitionRouteGroup updateTransitionRouteGroup( + UpdateTransitionRouteGroupRequest request) { + return updateTransitionRouteGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
+   *   UpdateTransitionRouteGroupRequest request = UpdateTransitionRouteGroupRequest.newBuilder()
+   *     .setTransitionRouteGroup(transitionRouteGroup)
+   *     .build();
+   *   ApiFuture<TransitionRouteGroup> future = transitionRouteGroupsClient.updateTransitionRouteGroupCallable().futureCall(request);
+   *   // Do something
+   *   TransitionRouteGroup response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + updateTransitionRouteGroupCallable() { + return stub.updateTransitionRouteGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
+   *   transitionRouteGroupsClient.deleteTransitionRouteGroup(name);
+   * }
+   * 
+ * + * @param name Required. The name of the + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete. + * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteTransitionRouteGroup(TransitionRouteGroupName name) { + DeleteTransitionRouteGroupRequest request = + DeleteTransitionRouteGroupRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteTransitionRouteGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
+   *   transitionRouteGroupsClient.deleteTransitionRouteGroup(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete. + * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteTransitionRouteGroup(String name) { + DeleteTransitionRouteGroupRequest request = + DeleteTransitionRouteGroupRequest.newBuilder().setName(name).build(); + deleteTransitionRouteGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
+   *   DeleteTransitionRouteGroupRequest request = DeleteTransitionRouteGroupRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   transitionRouteGroupsClient.deleteTransitionRouteGroup(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 deleteTransitionRouteGroup(DeleteTransitionRouteGroupRequest request) { + deleteTransitionRouteGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified + * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + * + *

Sample code: + * + *


+   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
+   *   DeleteTransitionRouteGroupRequest request = DeleteTransitionRouteGroupRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = transitionRouteGroupsClient.deleteTransitionRouteGroupCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + deleteTransitionRouteGroupCallable() { + return stub.deleteTransitionRouteGroupCallable(); + } + + @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 ListTransitionRouteGroupsPagedResponse + extends AbstractPagedListResponse< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + TransitionRouteGroup, + ListTransitionRouteGroupsPage, + ListTransitionRouteGroupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + TransitionRouteGroup> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTransitionRouteGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListTransitionRouteGroupsPagedResponse apply( + ListTransitionRouteGroupsPage input) { + return new ListTransitionRouteGroupsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListTransitionRouteGroupsPagedResponse(ListTransitionRouteGroupsPage page) { + super(page, ListTransitionRouteGroupsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListTransitionRouteGroupsPage + extends AbstractPage< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + TransitionRouteGroup, + ListTransitionRouteGroupsPage> { + + private ListTransitionRouteGroupsPage( + PageContext< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + TransitionRouteGroup> + context, + ListTransitionRouteGroupsResponse response) { + super(context, response); + } + + private static ListTransitionRouteGroupsPage createEmptyPage() { + return new ListTransitionRouteGroupsPage(null, null); + } + + @Override + protected ListTransitionRouteGroupsPage createPage( + PageContext< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + TransitionRouteGroup> + context, + ListTransitionRouteGroupsResponse response) { + return new ListTransitionRouteGroupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + TransitionRouteGroup> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListTransitionRouteGroupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + TransitionRouteGroup, + ListTransitionRouteGroupsPage, + ListTransitionRouteGroupsFixedSizeCollection> { + + private ListTransitionRouteGroupsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTransitionRouteGroupsFixedSizeCollection createEmptyCollection() { + return new ListTransitionRouteGroupsFixedSizeCollection(null, 0); + } + + @Override + protected ListTransitionRouteGroupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTransitionRouteGroupsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsSettings.java new file mode 100644 index 000000000..729f2af46 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsSettings.java @@ -0,0 +1,245 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; + +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.dialogflow.cx.v3beta1.stub.TransitionRouteGroupsStubSettings; +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 TransitionRouteGroupsClient}. + * + *

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

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

+ * 
+ * TransitionRouteGroupsSettings.Builder transitionRouteGroupsSettingsBuilder =
+ *     TransitionRouteGroupsSettings.newBuilder();
+ * transitionRouteGroupsSettingsBuilder
+ *     .getTransitionRouteGroupSettings()
+ *     .setRetrySettings(
+ *         transitionRouteGroupsSettingsBuilder.getTransitionRouteGroupSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * TransitionRouteGroupsSettings transitionRouteGroupsSettings = transitionRouteGroupsSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class TransitionRouteGroupsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listTransitionRouteGroups. */ + public PagedCallSettings< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + ListTransitionRouteGroupsPagedResponse> + listTransitionRouteGroupsSettings() { + return ((TransitionRouteGroupsStubSettings) getStubSettings()) + .listTransitionRouteGroupsSettings(); + } + + /** Returns the object with the settings used for calls to getTransitionRouteGroup. */ + public UnaryCallSettings + getTransitionRouteGroupSettings() { + return ((TransitionRouteGroupsStubSettings) getStubSettings()) + .getTransitionRouteGroupSettings(); + } + + /** Returns the object with the settings used for calls to createTransitionRouteGroup. */ + public UnaryCallSettings + createTransitionRouteGroupSettings() { + return ((TransitionRouteGroupsStubSettings) getStubSettings()) + .createTransitionRouteGroupSettings(); + } + + /** Returns the object with the settings used for calls to updateTransitionRouteGroup. */ + public UnaryCallSettings + updateTransitionRouteGroupSettings() { + return ((TransitionRouteGroupsStubSettings) getStubSettings()) + .updateTransitionRouteGroupSettings(); + } + + /** Returns the object with the settings used for calls to deleteTransitionRouteGroup. */ + public UnaryCallSettings + deleteTransitionRouteGroupSettings() { + return ((TransitionRouteGroupsStubSettings) getStubSettings()) + .deleteTransitionRouteGroupSettings(); + } + + public static final TransitionRouteGroupsSettings create(TransitionRouteGroupsStubSettings stub) + throws IOException { + return new TransitionRouteGroupsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TransitionRouteGroupsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return TransitionRouteGroupsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return TransitionRouteGroupsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TransitionRouteGroupsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return TransitionRouteGroupsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TransitionRouteGroupsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TransitionRouteGroupsStubSettings.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 TransitionRouteGroupsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for TransitionRouteGroupsSettings. */ + public static class Builder + extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(TransitionRouteGroupsStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(TransitionRouteGroupsStubSettings.newBuilder()); + } + + protected Builder(TransitionRouteGroupsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TransitionRouteGroupsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public TransitionRouteGroupsStubSettings.Builder getStubSettingsBuilder() { + return ((TransitionRouteGroupsStubSettings.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 listTransitionRouteGroups. */ + public PagedCallSettings.Builder< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + ListTransitionRouteGroupsPagedResponse> + listTransitionRouteGroupsSettings() { + return getStubSettingsBuilder().listTransitionRouteGroupsSettings(); + } + + /** Returns the builder for the settings used for calls to getTransitionRouteGroup. */ + public UnaryCallSettings.Builder + getTransitionRouteGroupSettings() { + return getStubSettingsBuilder().getTransitionRouteGroupSettings(); + } + + /** Returns the builder for the settings used for calls to createTransitionRouteGroup. */ + public UnaryCallSettings.Builder + createTransitionRouteGroupSettings() { + return getStubSettingsBuilder().createTransitionRouteGroupSettings(); + } + + /** Returns the builder for the settings used for calls to updateTransitionRouteGroup. */ + public UnaryCallSettings.Builder + updateTransitionRouteGroupSettings() { + return getStubSettingsBuilder().updateTransitionRouteGroupSettings(); + } + + /** Returns the builder for the settings used for calls to deleteTransitionRouteGroup. */ + public UnaryCallSettings.Builder + deleteTransitionRouteGroupSettings() { + return getStubSettingsBuilder().deleteTransitionRouteGroupSettings(); + } + + @Override + public TransitionRouteGroupsSettings build() throws IOException { + return new TransitionRouteGroupsSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java new file mode 100644 index 000000000..1dcd21179 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java @@ -0,0 +1,945 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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.cloud.dialogflow.cx.v3beta1.stub.VersionsStub; +import com.google.cloud.dialogflow.cx.v3beta1.stub.VersionsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Struct; +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 managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version]. + * + *

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 (VersionsClient versionsClient = VersionsClient.create()) {
+ *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+ *   Version response = versionsClient.getVersion(name);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * VersionsSettings versionsSettings =
+ *     VersionsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * VersionsClient versionsClient =
+ *     VersionsClient.create(versionsSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * VersionsSettings versionsSettings =
+ *     VersionsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * VersionsClient versionsClient =
+ *     VersionsClient.create(versionsSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class VersionsClient implements BackgroundResource { + private final VersionsSettings settings; + private final VersionsStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of VersionsClient with default settings. */ + public static final VersionsClient create() throws IOException { + return create(VersionsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of VersionsClient, 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 VersionsClient create(VersionsSettings settings) throws IOException { + return new VersionsClient(settings); + } + + /** + * Constructs an instance of VersionsClient, using the given stub for making calls. This is for + * advanced usage - prefer to use VersionsSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final VersionsClient create(VersionsStub stub) { + return new VersionsClient(stub); + } + + /** + * Constructs an instance of VersionsClient, 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 VersionsClient(VersionsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((VersionsStubSettings) 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 VersionsClient(VersionsStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final VersionsSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public VersionsStub 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 + /** + * Returns the list of all versions in the specified + * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   for (Version element : versionsClient.listVersions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all + * versions for. Format: `projects/<Project ID>/locations/<Location + * ID>/agents/<Agent ID>/flows/<Flow ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListVersionsPagedResponse listVersions(FlowName parent) { + ListVersionsRequest request = + ListVersionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all versions in the specified + * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   for (Version element : versionsClient.listVersions(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all + * versions for. Format: `projects/<Project ID>/locations/<Location + * ID>/agents/<Agent ID>/flows/<Flow ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListVersionsPagedResponse listVersions(String parent) { + ListVersionsRequest request = ListVersionsRequest.newBuilder().setParent(parent).build(); + return listVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all versions in the specified + * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   ListVersionsRequest request = ListVersionsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Version element : versionsClient.listVersions(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 ListVersionsPagedResponse listVersions(ListVersionsRequest request) { + return listVersionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all versions in the specified + * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   ListVersionsRequest request = ListVersionsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListVersionsPagedResponse> future = versionsClient.listVersionsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Version element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listVersionsPagedCallable() { + return stub.listVersionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all versions in the specified + * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   ListVersionsRequest request = ListVersionsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListVersionsResponse response = versionsClient.listVersionsCallable().call(request);
+   *     for (Version element : response.getVersionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listVersionsCallable() { + return stub.listVersionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+   *   Version response = versionsClient.getVersion(name);
+   * }
+   * 
+ * + * @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/flows/<Flow ID>/versions/<Version ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Version getVersion(VersionName name) { + GetVersionRequest request = + GetVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+   *   Version response = versionsClient.getVersion(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/flows/<Flow ID>/versions/<Version ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Version getVersion(String name) { + GetVersionRequest request = GetVersionRequest.newBuilder().setName(name).build(); + return getVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+   *   GetVersionRequest request = GetVersionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Version response = versionsClient.getVersion(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 Version getVersion(GetVersionRequest request) { + return getVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+   *   GetVersionRequest request = GetVersionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Version> future = versionsClient.getVersionCallable().futureCall(request);
+   *   // Do something
+   *   Version response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getVersionCallable() { + return stub.getVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified + * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   Version version = Version.newBuilder().build();
+   *   Version response = versionsClient.createVersionAsync(parent, version).get();
+   * }
+   * 
+ * + * @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an + * [Version][google.cloud.dialogflow.cx.v3beta1.Version] for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. + * @param version Required. The version to create. + * @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 createVersionAsync( + FlowName parent, Version version) { + CreateVersionRequest request = + CreateVersionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setVersion(version) + .build(); + return createVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified + * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   Version version = Version.newBuilder().build();
+   *   Version response = versionsClient.createVersionAsync(parent.toString(), version).get();
+   * }
+   * 
+ * + * @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an + * [Version][google.cloud.dialogflow.cx.v3beta1.Version] for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. + * @param version Required. The version to create. + * @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 createVersionAsync( + String parent, Version version) { + CreateVersionRequest request = + CreateVersionRequest.newBuilder().setParent(parent).setVersion(version).build(); + return createVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified + * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   Version version = Version.newBuilder().build();
+   *   CreateVersionRequest request = CreateVersionRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setVersion(version)
+   *     .build();
+   *   Version response = versionsClient.createVersionAsync(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 createVersionAsync( + CreateVersionRequest request) { + return createVersionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified + * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   Version version = Version.newBuilder().build();
+   *   CreateVersionRequest request = CreateVersionRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setVersion(version)
+   *     .build();
+   *   OperationFuture<Version, CreateVersionOperationMetadata> future = versionsClient.createVersionOperationCallable().futureCall(request);
+   *   // Do something
+   *   Version response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + createVersionOperationCallable() { + return stub.createVersionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified + * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
+   *   Version version = Version.newBuilder().build();
+   *   CreateVersionRequest request = CreateVersionRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setVersion(version)
+   *     .build();
+   *   ApiFuture<Operation> future = versionsClient.createVersionCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createVersionCallable() { + return stub.createVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   Version version = Version.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Version response = versionsClient.updateVersion(version, updateMask);
+   * }
+   * 
+ * + * @param version Required. The version to update. + * @param updateMask Required. The mask to control which fields get updated. Currently only + * `description` and `display_name` can be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Version updateVersion(Version version, FieldMask updateMask) { + UpdateVersionRequest request = + UpdateVersionRequest.newBuilder().setVersion(version).setUpdateMask(updateMask).build(); + return updateVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   Version version = Version.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateVersionRequest request = UpdateVersionRequest.newBuilder()
+   *     .setVersion(version)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Version response = versionsClient.updateVersion(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 Version updateVersion(UpdateVersionRequest request) { + return updateVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   Version version = Version.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateVersionRequest request = UpdateVersionRequest.newBuilder()
+   *     .setVersion(version)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Version> future = versionsClient.updateVersionCallable().futureCall(request);
+   *   // Do something
+   *   Version response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateVersionCallable() { + return stub.updateVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+   *   versionsClient.deleteVersion(name);
+   * }
+   * 
+ * + * @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to + * delete. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/flows/<Flow ID>/versions/<Version ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteVersion(VersionName name) { + DeleteVersionRequest request = + DeleteVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+   *   versionsClient.deleteVersion(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to + * delete. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/flows/<Flow ID>/versions/<Version ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteVersion(String name) { + DeleteVersionRequest request = DeleteVersionRequest.newBuilder().setName(name).build(); + deleteVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+   *   DeleteVersionRequest request = DeleteVersionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   versionsClient.deleteVersion(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 deleteVersion(DeleteVersionRequest request) { + deleteVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+   *   DeleteVersionRequest request = DeleteVersionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = versionsClient.deleteVersionCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteVersionCallable() { + return stub.deleteVersionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Loads a specified version to draft version. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+   *   versionsClient.loadVersionAsync(name).get();
+   * }
+   * 
+ * + * @param name Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to + * draft version. Format: `projects/<Project ID>/locations/<Location + * ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>`. + * @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 loadVersionAsync(VersionName name) { + LoadVersionRequest request = + LoadVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return loadVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Loads a specified version to draft version. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+   *   versionsClient.loadVersionAsync(name.toString()).get();
+   * }
+   * 
+ * + * @param name Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to + * draft version. Format: `projects/<Project ID>/locations/<Location + * ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>`. + * @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 loadVersionAsync(String name) { + LoadVersionRequest request = LoadVersionRequest.newBuilder().setName(name).build(); + return loadVersionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Loads a specified version to draft version. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+   *   LoadVersionRequest request = LoadVersionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   versionsClient.loadVersionAsync(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 loadVersionAsync(LoadVersionRequest request) { + return loadVersionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Loads a specified version to draft version. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+   *   LoadVersionRequest request = LoadVersionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Empty, Struct> future = versionsClient.loadVersionOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable loadVersionOperationCallable() { + return stub.loadVersionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Loads a specified version to draft version. + * + *

Sample code: + * + *


+   * try (VersionsClient versionsClient = VersionsClient.create()) {
+   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+   *   LoadVersionRequest request = LoadVersionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = versionsClient.loadVersionCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable loadVersionCallable() { + return stub.loadVersionCallable(); + } + + @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 ListVersionsPagedResponse + extends AbstractPagedListResponse< + ListVersionsRequest, + ListVersionsResponse, + Version, + ListVersionsPage, + ListVersionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListVersionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListVersionsPagedResponse apply(ListVersionsPage input) { + return new ListVersionsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListVersionsPagedResponse(ListVersionsPage page) { + super(page, ListVersionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListVersionsPage + extends AbstractPage { + + private ListVersionsPage( + PageContext context, + ListVersionsResponse response) { + super(context, response); + } + + private static ListVersionsPage createEmptyPage() { + return new ListVersionsPage(null, null); + } + + @Override + protected ListVersionsPage createPage( + PageContext context, + ListVersionsResponse response) { + return new ListVersionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListVersionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListVersionsRequest, + ListVersionsResponse, + Version, + ListVersionsPage, + ListVersionsFixedSizeCollection> { + + private ListVersionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListVersionsFixedSizeCollection createEmptyCollection() { + return new ListVersionsFixedSizeCollection(null, 0); + } + + @Override + protected ListVersionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListVersionsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsSettings.java new file mode 100644 index 000000000..d4d987539 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsSettings.java @@ -0,0 +1,270 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.VersionsClient.ListVersionsPagedResponse; + +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.dialogflow.cx.v3beta1.stub.VersionsStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.Struct; +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 VersionsClient}. + * + *

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

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

+ * 
+ * VersionsSettings.Builder versionsSettingsBuilder =
+ *     VersionsSettings.newBuilder();
+ * versionsSettingsBuilder
+ *     .getVersionSettings()
+ *     .setRetrySettings(
+ *         versionsSettingsBuilder.getVersionSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * VersionsSettings versionsSettings = versionsSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class VersionsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listVersions. */ + public PagedCallSettings + listVersionsSettings() { + return ((VersionsStubSettings) getStubSettings()).listVersionsSettings(); + } + + /** Returns the object with the settings used for calls to getVersion. */ + public UnaryCallSettings getVersionSettings() { + return ((VersionsStubSettings) getStubSettings()).getVersionSettings(); + } + + /** Returns the object with the settings used for calls to createVersion. */ + public UnaryCallSettings createVersionSettings() { + return ((VersionsStubSettings) getStubSettings()).createVersionSettings(); + } + + /** Returns the object with the settings used for calls to createVersion. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + createVersionOperationSettings() { + return ((VersionsStubSettings) getStubSettings()).createVersionOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateVersion. */ + public UnaryCallSettings updateVersionSettings() { + return ((VersionsStubSettings) getStubSettings()).updateVersionSettings(); + } + + /** Returns the object with the settings used for calls to deleteVersion. */ + public UnaryCallSettings deleteVersionSettings() { + return ((VersionsStubSettings) getStubSettings()).deleteVersionSettings(); + } + + /** Returns the object with the settings used for calls to loadVersion. */ + public UnaryCallSettings loadVersionSettings() { + return ((VersionsStubSettings) getStubSettings()).loadVersionSettings(); + } + + /** Returns the object with the settings used for calls to loadVersion. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings loadVersionOperationSettings() { + return ((VersionsStubSettings) getStubSettings()).loadVersionOperationSettings(); + } + + public static final VersionsSettings create(VersionsStubSettings stub) throws IOException { + return new VersionsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return VersionsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return VersionsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return VersionsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return VersionsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return VersionsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return VersionsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return VersionsStubSettings.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 VersionsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for VersionsSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(VersionsStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(VersionsStubSettings.newBuilder()); + } + + protected Builder(VersionsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(VersionsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public VersionsStubSettings.Builder getStubSettingsBuilder() { + return ((VersionsStubSettings.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 listVersions. */ + public PagedCallSettings.Builder< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> + listVersionsSettings() { + return getStubSettingsBuilder().listVersionsSettings(); + } + + /** Returns the builder for the settings used for calls to getVersion. */ + public UnaryCallSettings.Builder getVersionSettings() { + return getStubSettingsBuilder().getVersionSettings(); + } + + /** Returns the builder for the settings used for calls to createVersion. */ + public UnaryCallSettings.Builder createVersionSettings() { + return getStubSettingsBuilder().createVersionSettings(); + } + + /** Returns the builder for the settings used for calls to createVersion. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateVersionRequest, Version, CreateVersionOperationMetadata> + createVersionOperationSettings() { + return getStubSettingsBuilder().createVersionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateVersion. */ + public UnaryCallSettings.Builder updateVersionSettings() { + return getStubSettingsBuilder().updateVersionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteVersion. */ + public UnaryCallSettings.Builder deleteVersionSettings() { + return getStubSettingsBuilder().deleteVersionSettings(); + } + + /** Returns the builder for the settings used for calls to loadVersion. */ + public UnaryCallSettings.Builder loadVersionSettings() { + return getStubSettingsBuilder().loadVersionSettings(); + } + + /** Returns the builder for the settings used for calls to loadVersion. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + loadVersionOperationSettings() { + return getStubSettingsBuilder().loadVersionOperationSettings(); + } + + @Override + public VersionsSettings build() throws IOException { + return new VersionsSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java new file mode 100644 index 000000000..fac122291 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java @@ -0,0 +1,749 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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.cloud.dialogflow.cx.v3beta1.stub.WebhooksStub; +import com.google.cloud.dialogflow.cx.v3beta1.stub.WebhooksStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +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 managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook]. + * + *

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 (WebhooksClient webhooksClient = WebhooksClient.create()) {
+ *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
+ *   Webhook response = webhooksClient.getWebhook(name);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * WebhooksSettings webhooksSettings =
+ *     WebhooksSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * WebhooksClient webhooksClient =
+ *     WebhooksClient.create(webhooksSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * WebhooksSettings webhooksSettings =
+ *     WebhooksSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * WebhooksClient webhooksClient =
+ *     WebhooksClient.create(webhooksSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class WebhooksClient implements BackgroundResource { + private final WebhooksSettings settings; + private final WebhooksStub stub; + + /** Constructs an instance of WebhooksClient with default settings. */ + public static final WebhooksClient create() throws IOException { + return create(WebhooksSettings.newBuilder().build()); + } + + /** + * Constructs an instance of WebhooksClient, 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 WebhooksClient create(WebhooksSettings settings) throws IOException { + return new WebhooksClient(settings); + } + + /** + * Constructs an instance of WebhooksClient, using the given stub for making calls. This is for + * advanced usage - prefer to use WebhooksSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final WebhooksClient create(WebhooksStub stub) { + return new WebhooksClient(stub); + } + + /** + * Constructs an instance of WebhooksClient, 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 WebhooksClient(WebhooksSettings settings) throws IOException { + this.settings = settings; + this.stub = ((WebhooksStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected WebhooksClient(WebhooksStub stub) { + this.settings = null; + this.stub = stub; + } + + public final WebhooksSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public WebhooksStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all webhooks in the specified agent. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   for (Webhook element : webhooksClient.listWebhooks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The agent to list all webhooks for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWebhooksPagedResponse listWebhooks(AgentName parent) { + ListWebhooksRequest request = + ListWebhooksRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listWebhooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all webhooks in the specified agent. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   for (Webhook element : webhooksClient.listWebhooks(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The agent to list all webhooks for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWebhooksPagedResponse listWebhooks(String parent) { + ListWebhooksRequest request = ListWebhooksRequest.newBuilder().setParent(parent).build(); + return listWebhooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all webhooks in the specified agent. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListWebhooksRequest request = ListWebhooksRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Webhook element : webhooksClient.listWebhooks(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 ListWebhooksPagedResponse listWebhooks(ListWebhooksRequest request) { + return listWebhooksPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all webhooks in the specified agent. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListWebhooksRequest request = ListWebhooksRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListWebhooksPagedResponse> future = webhooksClient.listWebhooksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Webhook element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listWebhooksPagedCallable() { + return stub.listWebhooksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all webhooks in the specified agent. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   ListWebhooksRequest request = ListWebhooksRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListWebhooksResponse response = webhooksClient.listWebhooksCallable().call(request);
+   *     for (Webhook element : response.getWebhooksList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listWebhooksCallable() { + return stub.listWebhooksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified webhook. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
+   *   Webhook response = webhooksClient.getWebhook(name);
+   * }
+   * 
+ * + * @param name Required. The name of the webhook. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Webhook getWebhook(WebhookName name) { + GetWebhookRequest request = + GetWebhookRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getWebhook(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified webhook. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
+   *   Webhook response = webhooksClient.getWebhook(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the webhook. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Webhook getWebhook(String name) { + GetWebhookRequest request = GetWebhookRequest.newBuilder().setName(name).build(); + return getWebhook(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified webhook. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
+   *   GetWebhookRequest request = GetWebhookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Webhook response = webhooksClient.getWebhook(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 Webhook getWebhook(GetWebhookRequest request) { + return getWebhookCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves the specified webhook. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
+   *   GetWebhookRequest request = GetWebhookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Webhook> future = webhooksClient.getWebhookCallable().futureCall(request);
+   *   // Do something
+   *   Webhook response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getWebhookCallable() { + return stub.getWebhookCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a webhook in the specified agent. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Webhook webhook = Webhook.newBuilder().build();
+   *   Webhook response = webhooksClient.createWebhook(parent, webhook);
+   * }
+   * 
+ * + * @param parent Required. The agent to create a webhook for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @param webhook Required. The webhook to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Webhook createWebhook(AgentName parent, Webhook webhook) { + CreateWebhookRequest request = + CreateWebhookRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setWebhook(webhook) + .build(); + return createWebhook(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a webhook in the specified agent. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Webhook webhook = Webhook.newBuilder().build();
+   *   Webhook response = webhooksClient.createWebhook(parent.toString(), webhook);
+   * }
+   * 
+ * + * @param parent Required. The agent to create a webhook for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @param webhook Required. The webhook to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Webhook createWebhook(String parent, Webhook webhook) { + CreateWebhookRequest request = + CreateWebhookRequest.newBuilder().setParent(parent).setWebhook(webhook).build(); + return createWebhook(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a webhook in the specified agent. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Webhook webhook = Webhook.newBuilder().build();
+   *   CreateWebhookRequest request = CreateWebhookRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setWebhook(webhook)
+   *     .build();
+   *   Webhook response = webhooksClient.createWebhook(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 Webhook createWebhook(CreateWebhookRequest request) { + return createWebhookCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a webhook in the specified agent. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+   *   Webhook webhook = Webhook.newBuilder().build();
+   *   CreateWebhookRequest request = CreateWebhookRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setWebhook(webhook)
+   *     .build();
+   *   ApiFuture<Webhook> future = webhooksClient.createWebhookCallable().futureCall(request);
+   *   // Do something
+   *   Webhook response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createWebhookCallable() { + return stub.createWebhookCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified webhook. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   Webhook webhook = Webhook.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Webhook response = webhooksClient.updateWebhook(webhook, updateMask);
+   * }
+   * 
+ * + * @param webhook Required. The webhook to update. + * @param updateMask The mask to control which fields get updated. If the mask is not present, all + * fields will be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Webhook updateWebhook(Webhook webhook, FieldMask updateMask) { + UpdateWebhookRequest request = + UpdateWebhookRequest.newBuilder().setWebhook(webhook).setUpdateMask(updateMask).build(); + return updateWebhook(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified webhook. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   Webhook webhook = Webhook.newBuilder().build();
+   *   UpdateWebhookRequest request = UpdateWebhookRequest.newBuilder()
+   *     .setWebhook(webhook)
+   *     .build();
+   *   Webhook response = webhooksClient.updateWebhook(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 Webhook updateWebhook(UpdateWebhookRequest request) { + return updateWebhookCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified webhook. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   Webhook webhook = Webhook.newBuilder().build();
+   *   UpdateWebhookRequest request = UpdateWebhookRequest.newBuilder()
+   *     .setWebhook(webhook)
+   *     .build();
+   *   ApiFuture<Webhook> future = webhooksClient.updateWebhookCallable().futureCall(request);
+   *   // Do something
+   *   Webhook response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateWebhookCallable() { + return stub.updateWebhookCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified webhook. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
+   *   webhooksClient.deleteWebhook(name);
+   * }
+   * 
+ * + * @param name Required. The name of the webhook to delete. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteWebhook(WebhookName name) { + DeleteWebhookRequest request = + DeleteWebhookRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteWebhook(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified webhook. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
+   *   webhooksClient.deleteWebhook(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the webhook to delete. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteWebhook(String name) { + DeleteWebhookRequest request = DeleteWebhookRequest.newBuilder().setName(name).build(); + deleteWebhook(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified webhook. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
+   *   DeleteWebhookRequest request = DeleteWebhookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   webhooksClient.deleteWebhook(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 deleteWebhook(DeleteWebhookRequest request) { + deleteWebhookCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified webhook. + * + *

Sample code: + * + *


+   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
+   *   DeleteWebhookRequest request = DeleteWebhookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = webhooksClient.deleteWebhookCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteWebhookCallable() { + return stub.deleteWebhookCallable(); + } + + @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 ListWebhooksPagedResponse + extends AbstractPagedListResponse< + ListWebhooksRequest, + ListWebhooksResponse, + Webhook, + ListWebhooksPage, + ListWebhooksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListWebhooksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListWebhooksPagedResponse apply(ListWebhooksPage input) { + return new ListWebhooksPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListWebhooksPagedResponse(ListWebhooksPage page) { + super(page, ListWebhooksFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListWebhooksPage + extends AbstractPage { + + private ListWebhooksPage( + PageContext context, + ListWebhooksResponse response) { + super(context, response); + } + + private static ListWebhooksPage createEmptyPage() { + return new ListWebhooksPage(null, null); + } + + @Override + protected ListWebhooksPage createPage( + PageContext context, + ListWebhooksResponse response) { + return new ListWebhooksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListWebhooksFixedSizeCollection + extends AbstractFixedSizeCollection< + ListWebhooksRequest, + ListWebhooksResponse, + Webhook, + ListWebhooksPage, + ListWebhooksFixedSizeCollection> { + + private ListWebhooksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListWebhooksFixedSizeCollection createEmptyCollection() { + return new ListWebhooksFixedSizeCollection(null, 0); + } + + @Override + protected ListWebhooksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListWebhooksFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksSettings.java new file mode 100644 index 000000000..e4545ff91 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksSettings.java @@ -0,0 +1,225 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.WebhooksClient.ListWebhooksPagedResponse; + +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.dialogflow.cx.v3beta1.stub.WebhooksStubSettings; +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 WebhooksClient}. + * + *

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

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

+ * 
+ * WebhooksSettings.Builder webhooksSettingsBuilder =
+ *     WebhooksSettings.newBuilder();
+ * webhooksSettingsBuilder
+ *     .getWebhookSettings()
+ *     .setRetrySettings(
+ *         webhooksSettingsBuilder.getWebhookSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * WebhooksSettings webhooksSettings = webhooksSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class WebhooksSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listWebhooks. */ + public PagedCallSettings + listWebhooksSettings() { + return ((WebhooksStubSettings) getStubSettings()).listWebhooksSettings(); + } + + /** Returns the object with the settings used for calls to getWebhook. */ + public UnaryCallSettings getWebhookSettings() { + return ((WebhooksStubSettings) getStubSettings()).getWebhookSettings(); + } + + /** Returns the object with the settings used for calls to createWebhook. */ + public UnaryCallSettings createWebhookSettings() { + return ((WebhooksStubSettings) getStubSettings()).createWebhookSettings(); + } + + /** Returns the object with the settings used for calls to updateWebhook. */ + public UnaryCallSettings updateWebhookSettings() { + return ((WebhooksStubSettings) getStubSettings()).updateWebhookSettings(); + } + + /** Returns the object with the settings used for calls to deleteWebhook. */ + public UnaryCallSettings deleteWebhookSettings() { + return ((WebhooksStubSettings) getStubSettings()).deleteWebhookSettings(); + } + + public static final WebhooksSettings create(WebhooksStubSettings stub) throws IOException { + return new WebhooksSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return WebhooksStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return WebhooksStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return WebhooksStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return WebhooksStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return WebhooksStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return WebhooksStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return WebhooksStubSettings.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 WebhooksSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for WebhooksSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(WebhooksStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(WebhooksStubSettings.newBuilder()); + } + + protected Builder(WebhooksSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(WebhooksStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public WebhooksStubSettings.Builder getStubSettingsBuilder() { + return ((WebhooksStubSettings.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 listWebhooks. */ + public PagedCallSettings.Builder< + ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse> + listWebhooksSettings() { + return getStubSettingsBuilder().listWebhooksSettings(); + } + + /** Returns the builder for the settings used for calls to getWebhook. */ + public UnaryCallSettings.Builder getWebhookSettings() { + return getStubSettingsBuilder().getWebhookSettings(); + } + + /** Returns the builder for the settings used for calls to createWebhook. */ + public UnaryCallSettings.Builder createWebhookSettings() { + return getStubSettingsBuilder().createWebhookSettings(); + } + + /** Returns the builder for the settings used for calls to updateWebhook. */ + public UnaryCallSettings.Builder updateWebhookSettings() { + return getStubSettingsBuilder().updateWebhookSettings(); + } + + /** Returns the builder for the settings used for calls to deleteWebhook. */ + public UnaryCallSettings.Builder deleteWebhookSettings() { + return getStubSettingsBuilder().deleteWebhookSettings(); + } + + @Override + public WebhooksSettings build() throws IOException { + return new WebhooksSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/package-info.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/package-info.java new file mode 100644 index 000000000..69e3355f5 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/package-info.java @@ -0,0 +1,205 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Dialogflow API. + * + *

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

=========== PagesClient =========== + * + *

Service Description: Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page]. + * + *

Sample for PagesClient: + * + *

+ * 
+ * try (PagesClient pagesClient = PagesClient.create()) {
+ *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
+ *   Page response = pagesClient.getPage(name);
+ * }
+ * 
+ * 
+ * + * =========== FlowsClient =========== + * + *

Service Description: Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow]. + * + *

Sample for FlowsClient: + * + *

+ * 
+ * try (FlowsClient flowsClient = FlowsClient.create()) {
+ *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+ *   Flow flow = Flow.newBuilder().build();
+ *   Flow response = flowsClient.createFlow(parent, flow);
+ * }
+ * 
+ * 
+ * + * ============ AgentsClient ============ + * + *

Service Description: Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent]. + * + *

Sample for AgentsClient: + * + *

+ * 
+ * try (AgentsClient agentsClient = AgentsClient.create()) {
+ *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+ *   Agent response = agentsClient.getAgent(name);
+ * }
+ * 
+ * 
+ * + * ================= EntityTypesClient ================= + * + *

Service Description: Service for managing + * [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType]. + * + *

Sample for EntityTypesClient: + * + *

+ * 
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
+ *   EntityType response = entityTypesClient.getEntityType(name);
+ * }
+ * 
+ * 
+ * + * ================== EnvironmentsClient ================== + * + *

Service Description: Service for managing + * [Environments][google.cloud.dialogflow.cx.v3beta1.Environment]. + * + *

Sample for EnvironmentsClient: + * + *

+ * 
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
+ *   Environment response = environmentsClient.getEnvironment(name);
+ * }
+ * 
+ * 
+ * + * ============= IntentsClient ============= + * + *

Service Description: Service for managing + * [Intents][google.cloud.dialogflow.cx.v3beta1.Intent]. + * + *

Sample for IntentsClient: + * + *

+ * 
+ * try (IntentsClient intentsClient = IntentsClient.create()) {
+ *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
+ *   Intent response = intentsClient.getIntent(name);
+ * }
+ * 
+ * 
+ * + * ======================== SessionEntityTypesClient ======================== + * + *

Service Description: Service for managing + * [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType]. + * + *

Sample for SessionEntityTypesClient: + * + *

+ * 
+ * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+ *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
+ *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
+ * }
+ * 
+ * 
+ * + * ============== SessionsClient ============== + * + *

Service Description: A session represents an interaction with a user. You retrieve user input + * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] + * method to determine user intent and respond. + * + *

Sample for SessionsClient: + * + *

+ * 
+ * try (SessionsClient sessionsClient = SessionsClient.create()) {
+ *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
+ *   QueryInput queryInput = QueryInput.newBuilder().build();
+ *   DetectIntentRequest request = DetectIntentRequest.newBuilder()
+ *     .setSession(session.toString())
+ *     .setQueryInput(queryInput)
+ *     .build();
+ *   DetectIntentResponse response = sessionsClient.detectIntent(request);
+ * }
+ * 
+ * 
+ * + * =========================== TransitionRouteGroupsClient =========================== + * + *

Service Description: Service for managing + * [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + * + *

Sample for TransitionRouteGroupsClient: + * + *

+ * 
+ * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
+ *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
+ *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name);
+ * }
+ * 
+ * 
+ * + * ============== VersionsClient ============== + * + *

Service Description: Service for managing + * [Versions][google.cloud.dialogflow.cx.v3beta1.Version]. + * + *

Sample for VersionsClient: + * + *

+ * 
+ * try (VersionsClient versionsClient = VersionsClient.create()) {
+ *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
+ *   Version response = versionsClient.getVersion(name);
+ * }
+ * 
+ * 
+ * + * ============== WebhooksClient ============== + * + *

Service Description: Service for managing + * [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook]. + * + *

Sample for WebhooksClient: + * + *

+ * 
+ * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
+ *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
+ *   Webhook response = webhooksClient.getWebhook(name);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.dialogflow.cx.v3beta1; + +import javax.annotation.Generated; diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStub.java new file mode 100644 index 000000000..f325d0fde --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStub.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. + */ +package com.google.cloud.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.AgentsClient.ListAgentsPagedResponse; + +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.dialogflow.cx.v3beta1.Agent; +import com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse; +import com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import com.google.protobuf.Struct; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class AgentsStub 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 listAgentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAgentsPagedCallable()"); + } + + public UnaryCallable listAgentsCallable() { + throw new UnsupportedOperationException("Not implemented: listAgentsCallable()"); + } + + public UnaryCallable getAgentCallable() { + throw new UnsupportedOperationException("Not implemented: getAgentCallable()"); + } + + public UnaryCallable createAgentCallable() { + throw new UnsupportedOperationException("Not implemented: createAgentCallable()"); + } + + public UnaryCallable updateAgentCallable() { + throw new UnsupportedOperationException("Not implemented: updateAgentCallable()"); + } + + public UnaryCallable deleteAgentCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAgentCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + exportAgentOperationCallable() { + throw new UnsupportedOperationException("Not implemented: exportAgentOperationCallable()"); + } + + public UnaryCallable exportAgentCallable() { + throw new UnsupportedOperationException("Not implemented: exportAgentCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable restoreAgentOperationCallable() { + throw new UnsupportedOperationException("Not implemented: restoreAgentOperationCallable()"); + } + + public UnaryCallable restoreAgentCallable() { + throw new UnsupportedOperationException("Not implemented: restoreAgentCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStubSettings.java new file mode 100644 index 000000000..44b17e650 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStubSettings.java @@ -0,0 +1,608 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.AgentsClient.ListAgentsPagedResponse; + +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.dialogflow.cx.v3beta1.Agent; +import com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse; +import com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest; +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 com.google.protobuf.Struct; +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 AgentsStub}. + * + *

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

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

+ * 
+ * AgentsStubSettings.Builder agentsSettingsBuilder =
+ *     AgentsStubSettings.newBuilder();
+ * agentsSettingsBuilder
+ *     .getAgentSettings()
+ *     .setRetrySettings(
+ *         agentsSettingsBuilder.getAgentSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AgentsStubSettings agentsSettings = agentsSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AgentsStubSettings 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") + .add("https://www.googleapis.com/auth/dialogflow") + .build(); + + private final PagedCallSettings + listAgentsSettings; + private final UnaryCallSettings getAgentSettings; + private final UnaryCallSettings createAgentSettings; + private final UnaryCallSettings updateAgentSettings; + private final UnaryCallSettings deleteAgentSettings; + private final UnaryCallSettings exportAgentSettings; + private final OperationCallSettings + exportAgentOperationSettings; + private final UnaryCallSettings restoreAgentSettings; + private final OperationCallSettings + restoreAgentOperationSettings; + + /** Returns the object with the settings used for calls to listAgents. */ + public PagedCallSettings + listAgentsSettings() { + return listAgentsSettings; + } + + /** Returns the object with the settings used for calls to getAgent. */ + public UnaryCallSettings getAgentSettings() { + return getAgentSettings; + } + + /** Returns the object with the settings used for calls to createAgent. */ + public UnaryCallSettings createAgentSettings() { + return createAgentSettings; + } + + /** Returns the object with the settings used for calls to updateAgent. */ + public UnaryCallSettings updateAgentSettings() { + return updateAgentSettings; + } + + /** Returns the object with the settings used for calls to deleteAgent. */ + public UnaryCallSettings deleteAgentSettings() { + return deleteAgentSettings; + } + + /** Returns the object with the settings used for calls to exportAgent. */ + public UnaryCallSettings exportAgentSettings() { + return exportAgentSettings; + } + + /** Returns the object with the settings used for calls to exportAgent. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + exportAgentOperationSettings() { + return exportAgentOperationSettings; + } + + /** Returns the object with the settings used for calls to restoreAgent. */ + public UnaryCallSettings restoreAgentSettings() { + return restoreAgentSettings; + } + + /** Returns the object with the settings used for calls to restoreAgent. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings restoreAgentOperationSettings() { + return restoreAgentOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AgentsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAgentsStub.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 "dialogflow.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(AgentsStubSettings.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 AgentsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listAgentsSettings = settingsBuilder.listAgentsSettings().build(); + getAgentSettings = settingsBuilder.getAgentSettings().build(); + createAgentSettings = settingsBuilder.createAgentSettings().build(); + updateAgentSettings = settingsBuilder.updateAgentSettings().build(); + deleteAgentSettings = settingsBuilder.deleteAgentSettings().build(); + exportAgentSettings = settingsBuilder.exportAgentSettings().build(); + exportAgentOperationSettings = settingsBuilder.exportAgentOperationSettings().build(); + restoreAgentSettings = settingsBuilder.restoreAgentSettings().build(); + restoreAgentOperationSettings = settingsBuilder.restoreAgentOperationSettings().build(); + } + + private static final PagedListDescriptor + LIST_AGENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAgentsRequest injectToken(ListAgentsRequest payload, String token) { + return ListAgentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAgentsRequest injectPageSize(ListAgentsRequest payload, int pageSize) { + return ListAgentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAgentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAgentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListAgentsResponse payload) { + return payload.getAgentsList() != null + ? payload.getAgentsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListAgentsRequest, ListAgentsResponse, ListAgentsPagedResponse> + LIST_AGENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAgentsRequest, ListAgentsResponse, ListAgentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAgentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_AGENTS_PAGE_STR_DESC, request, context); + return ListAgentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for AgentsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListAgentsRequest, ListAgentsResponse, ListAgentsPagedResponse> + listAgentsSettings; + private final UnaryCallSettings.Builder getAgentSettings; + private final UnaryCallSettings.Builder createAgentSettings; + private final UnaryCallSettings.Builder updateAgentSettings; + private final UnaryCallSettings.Builder deleteAgentSettings; + private final UnaryCallSettings.Builder exportAgentSettings; + private final OperationCallSettings.Builder + exportAgentOperationSettings; + private final UnaryCallSettings.Builder restoreAgentSettings; + private final OperationCallSettings.Builder + restoreAgentOperationSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listAgentsSettings = PagedCallSettings.newBuilder(LIST_AGENTS_PAGE_STR_FACT); + + getAgentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createAgentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateAgentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteAgentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + exportAgentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + exportAgentOperationSettings = OperationCallSettings.newBuilder(); + + restoreAgentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + restoreAgentOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listAgentsSettings, + getAgentSettings, + createAgentSettings, + updateAgentSettings, + deleteAgentSettings, + exportAgentSettings, + restoreAgentSettings); + + 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 + .listAgentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getAgentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createAgentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateAgentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteAgentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .exportAgentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .restoreAgentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + builder + .exportAgentOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ExportAgentResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Struct.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 + .restoreAgentOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Struct.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(AgentsStubSettings settings) { + super(settings); + + listAgentsSettings = settings.listAgentsSettings.toBuilder(); + getAgentSettings = settings.getAgentSettings.toBuilder(); + createAgentSettings = settings.createAgentSettings.toBuilder(); + updateAgentSettings = settings.updateAgentSettings.toBuilder(); + deleteAgentSettings = settings.deleteAgentSettings.toBuilder(); + exportAgentSettings = settings.exportAgentSettings.toBuilder(); + exportAgentOperationSettings = settings.exportAgentOperationSettings.toBuilder(); + restoreAgentSettings = settings.restoreAgentSettings.toBuilder(); + restoreAgentOperationSettings = settings.restoreAgentOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listAgentsSettings, + getAgentSettings, + createAgentSettings, + updateAgentSettings, + deleteAgentSettings, + exportAgentSettings, + restoreAgentSettings); + } + + // 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 listAgents. */ + public PagedCallSettings.Builder + listAgentsSettings() { + return listAgentsSettings; + } + + /** Returns the builder for the settings used for calls to getAgent. */ + public UnaryCallSettings.Builder getAgentSettings() { + return getAgentSettings; + } + + /** Returns the builder for the settings used for calls to createAgent. */ + public UnaryCallSettings.Builder createAgentSettings() { + return createAgentSettings; + } + + /** Returns the builder for the settings used for calls to updateAgent. */ + public UnaryCallSettings.Builder updateAgentSettings() { + return updateAgentSettings; + } + + /** Returns the builder for the settings used for calls to deleteAgent. */ + public UnaryCallSettings.Builder deleteAgentSettings() { + return deleteAgentSettings; + } + + /** Returns the builder for the settings used for calls to exportAgent. */ + public UnaryCallSettings.Builder exportAgentSettings() { + return exportAgentSettings; + } + + /** Returns the builder for the settings used for calls to exportAgent. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + exportAgentOperationSettings() { + return exportAgentOperationSettings; + } + + /** Returns the builder for the settings used for calls to restoreAgent. */ + public UnaryCallSettings.Builder restoreAgentSettings() { + return restoreAgentSettings; + } + + /** Returns the builder for the settings used for calls to restoreAgent. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + restoreAgentOperationSettings() { + return restoreAgentOperationSettings; + } + + @Override + public AgentsStubSettings build() throws IOException { + return new AgentsStubSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStub.java new file mode 100644 index 000000000..8794c681d --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStub.java @@ -0,0 +1,70 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.EntityTypesClient.ListEntityTypesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.EntityType; +import com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class EntityTypesStub implements BackgroundResource { + + public UnaryCallable + listEntityTypesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listEntityTypesPagedCallable()"); + } + + public UnaryCallable listEntityTypesCallable() { + throw new UnsupportedOperationException("Not implemented: listEntityTypesCallable()"); + } + + public UnaryCallable getEntityTypeCallable() { + throw new UnsupportedOperationException("Not implemented: getEntityTypeCallable()"); + } + + public UnaryCallable createEntityTypeCallable() { + throw new UnsupportedOperationException("Not implemented: createEntityTypeCallable()"); + } + + public UnaryCallable updateEntityTypeCallable() { + throw new UnsupportedOperationException("Not implemented: updateEntityTypeCallable()"); + } + + public UnaryCallable deleteEntityTypeCallable() { + throw new UnsupportedOperationException("Not implemented: deleteEntityTypeCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStubSettings.java new file mode 100644 index 000000000..e5f50a738 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStubSettings.java @@ -0,0 +1,475 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.EntityTypesClient.ListEntityTypesPagedResponse; + +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.dialogflow.cx.v3beta1.CreateEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.EntityType; +import com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest; +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 EntityTypesStub}. + * + *

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

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

+ * 
+ * EntityTypesStubSettings.Builder entityTypesSettingsBuilder =
+ *     EntityTypesStubSettings.newBuilder();
+ * entityTypesSettingsBuilder
+ *     .getEntityTypeSettings()
+ *     .setRetrySettings(
+ *         entityTypesSettingsBuilder.getEntityTypeSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * EntityTypesStubSettings entityTypesSettings = entityTypesSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class EntityTypesStubSettings 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") + .add("https://www.googleapis.com/auth/dialogflow") + .build(); + + private final PagedCallSettings< + ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> + listEntityTypesSettings; + private final UnaryCallSettings getEntityTypeSettings; + private final UnaryCallSettings createEntityTypeSettings; + private final UnaryCallSettings updateEntityTypeSettings; + private final UnaryCallSettings deleteEntityTypeSettings; + + /** Returns the object with the settings used for calls to listEntityTypes. */ + public PagedCallSettings< + ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> + listEntityTypesSettings() { + return listEntityTypesSettings; + } + + /** Returns the object with the settings used for calls to getEntityType. */ + public UnaryCallSettings getEntityTypeSettings() { + return getEntityTypeSettings; + } + + /** Returns the object with the settings used for calls to createEntityType. */ + public UnaryCallSettings createEntityTypeSettings() { + return createEntityTypeSettings; + } + + /** Returns the object with the settings used for calls to updateEntityType. */ + public UnaryCallSettings updateEntityTypeSettings() { + return updateEntityTypeSettings; + } + + /** Returns the object with the settings used for calls to deleteEntityType. */ + public UnaryCallSettings deleteEntityTypeSettings() { + return deleteEntityTypeSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public EntityTypesStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcEntityTypesStub.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 "dialogflow.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(EntityTypesStubSettings.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 EntityTypesStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listEntityTypesSettings = settingsBuilder.listEntityTypesSettings().build(); + getEntityTypeSettings = settingsBuilder.getEntityTypeSettings().build(); + createEntityTypeSettings = settingsBuilder.createEntityTypeSettings().build(); + updateEntityTypeSettings = settingsBuilder.updateEntityTypeSettings().build(); + deleteEntityTypeSettings = settingsBuilder.deleteEntityTypeSettings().build(); + } + + private static final PagedListDescriptor< + ListEntityTypesRequest, ListEntityTypesResponse, EntityType> + LIST_ENTITY_TYPES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListEntityTypesRequest injectToken( + ListEntityTypesRequest payload, String token) { + return ListEntityTypesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListEntityTypesRequest injectPageSize( + ListEntityTypesRequest payload, int pageSize) { + return ListEntityTypesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListEntityTypesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListEntityTypesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListEntityTypesResponse payload) { + return payload.getEntityTypesList() != null + ? payload.getEntityTypesList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> + LIST_ENTITY_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListEntityTypesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ENTITY_TYPES_PAGE_STR_DESC, request, context); + return ListEntityTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for EntityTypesStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> + listEntityTypesSettings; + private final UnaryCallSettings.Builder getEntityTypeSettings; + private final UnaryCallSettings.Builder + createEntityTypeSettings; + private final UnaryCallSettings.Builder + updateEntityTypeSettings; + private final UnaryCallSettings.Builder + deleteEntityTypeSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listEntityTypesSettings = PagedCallSettings.newBuilder(LIST_ENTITY_TYPES_PAGE_STR_FACT); + + getEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listEntityTypesSettings, + getEntityTypeSettings, + createEntityTypeSettings, + updateEntityTypeSettings, + deleteEntityTypeSettings); + + 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 + .listEntityTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getEntityTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createEntityTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateEntityTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteEntityTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + return builder; + } + + protected Builder(EntityTypesStubSettings settings) { + super(settings); + + listEntityTypesSettings = settings.listEntityTypesSettings.toBuilder(); + getEntityTypeSettings = settings.getEntityTypeSettings.toBuilder(); + createEntityTypeSettings = settings.createEntityTypeSettings.toBuilder(); + updateEntityTypeSettings = settings.updateEntityTypeSettings.toBuilder(); + deleteEntityTypeSettings = settings.deleteEntityTypeSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listEntityTypesSettings, + getEntityTypeSettings, + createEntityTypeSettings, + updateEntityTypeSettings, + deleteEntityTypeSettings); + } + + // 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 listEntityTypes. */ + public PagedCallSettings.Builder< + ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> + listEntityTypesSettings() { + return listEntityTypesSettings; + } + + /** Returns the builder for the settings used for calls to getEntityType. */ + public UnaryCallSettings.Builder getEntityTypeSettings() { + return getEntityTypeSettings; + } + + /** Returns the builder for the settings used for calls to createEntityType. */ + public UnaryCallSettings.Builder + createEntityTypeSettings() { + return createEntityTypeSettings; + } + + /** Returns the builder for the settings used for calls to updateEntityType. */ + public UnaryCallSettings.Builder + updateEntityTypeSettings() { + return updateEntityTypeSettings; + } + + /** Returns the builder for the settings used for calls to deleteEntityType. */ + public UnaryCallSettings.Builder deleteEntityTypeSettings() { + return deleteEntityTypeSettings; + } + + @Override + public EntityTypesStubSettings build() throws IOException { + return new EntityTypesStubSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStub.java new file mode 100644 index 000000000..6064a2c57 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStub.java @@ -0,0 +1,108 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.ListEnvironmentsPagedResponse; +import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.LookupEnvironmentHistoryPagedResponse; + +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.dialogflow.cx.v3beta1.CreateEnvironmentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Environment; +import com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest; +import com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import com.google.protobuf.Struct; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class EnvironmentsStub 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 + listEnvironmentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listEnvironmentsPagedCallable()"); + } + + public UnaryCallable + listEnvironmentsCallable() { + throw new UnsupportedOperationException("Not implemented: listEnvironmentsCallable()"); + } + + public UnaryCallable getEnvironmentCallable() { + throw new UnsupportedOperationException("Not implemented: getEnvironmentCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createEnvironmentOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createEnvironmentOperationCallable()"); + } + + public UnaryCallable createEnvironmentCallable() { + throw new UnsupportedOperationException("Not implemented: createEnvironmentCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateEnvironmentOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateEnvironmentOperationCallable()"); + } + + public UnaryCallable updateEnvironmentCallable() { + throw new UnsupportedOperationException("Not implemented: updateEnvironmentCallable()"); + } + + public UnaryCallable deleteEnvironmentCallable() { + throw new UnsupportedOperationException("Not implemented: deleteEnvironmentCallable()"); + } + + public UnaryCallable + lookupEnvironmentHistoryPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: lookupEnvironmentHistoryPagedCallable()"); + } + + public UnaryCallable + lookupEnvironmentHistoryCallable() { + throw new UnsupportedOperationException("Not implemented: lookupEnvironmentHistoryCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStubSettings.java new file mode 100644 index 000000000..38a1c5d99 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStubSettings.java @@ -0,0 +1,694 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.ListEnvironmentsPagedResponse; +import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.LookupEnvironmentHistoryPagedResponse; + +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.dialogflow.cx.v3beta1.CreateEnvironmentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Environment; +import com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest; +import com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest; +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 com.google.protobuf.Struct; +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 EnvironmentsStub}. + * + *

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

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

+ * 
+ * EnvironmentsStubSettings.Builder environmentsSettingsBuilder =
+ *     EnvironmentsStubSettings.newBuilder();
+ * environmentsSettingsBuilder
+ *     .getEnvironmentSettings()
+ *     .setRetrySettings(
+ *         environmentsSettingsBuilder.getEnvironmentSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * EnvironmentsStubSettings environmentsSettings = environmentsSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class EnvironmentsStubSettings 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") + .add("https://www.googleapis.com/auth/dialogflow") + .build(); + + private final PagedCallSettings< + ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> + listEnvironmentsSettings; + private final UnaryCallSettings getEnvironmentSettings; + private final UnaryCallSettings createEnvironmentSettings; + private final OperationCallSettings + createEnvironmentOperationSettings; + private final UnaryCallSettings updateEnvironmentSettings; + private final OperationCallSettings + updateEnvironmentOperationSettings; + private final UnaryCallSettings deleteEnvironmentSettings; + private final PagedCallSettings< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + LookupEnvironmentHistoryPagedResponse> + lookupEnvironmentHistorySettings; + + /** Returns the object with the settings used for calls to listEnvironments. */ + public PagedCallSettings< + ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> + listEnvironmentsSettings() { + return listEnvironmentsSettings; + } + + /** Returns the object with the settings used for calls to getEnvironment. */ + public UnaryCallSettings getEnvironmentSettings() { + return getEnvironmentSettings; + } + + /** Returns the object with the settings used for calls to createEnvironment. */ + public UnaryCallSettings createEnvironmentSettings() { + return createEnvironmentSettings; + } + + /** Returns the object with the settings used for calls to createEnvironment. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + createEnvironmentOperationSettings() { + return createEnvironmentOperationSettings; + } + + /** Returns the object with the settings used for calls to updateEnvironment. */ + public UnaryCallSettings updateEnvironmentSettings() { + return updateEnvironmentSettings; + } + + /** Returns the object with the settings used for calls to updateEnvironment. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + updateEnvironmentOperationSettings() { + return updateEnvironmentOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteEnvironment. */ + public UnaryCallSettings deleteEnvironmentSettings() { + return deleteEnvironmentSettings; + } + + /** Returns the object with the settings used for calls to lookupEnvironmentHistory. */ + public PagedCallSettings< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + LookupEnvironmentHistoryPagedResponse> + lookupEnvironmentHistorySettings() { + return lookupEnvironmentHistorySettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public EnvironmentsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcEnvironmentsStub.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 "dialogflow.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(EnvironmentsStubSettings.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 EnvironmentsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listEnvironmentsSettings = settingsBuilder.listEnvironmentsSettings().build(); + getEnvironmentSettings = settingsBuilder.getEnvironmentSettings().build(); + createEnvironmentSettings = settingsBuilder.createEnvironmentSettings().build(); + createEnvironmentOperationSettings = + settingsBuilder.createEnvironmentOperationSettings().build(); + updateEnvironmentSettings = settingsBuilder.updateEnvironmentSettings().build(); + updateEnvironmentOperationSettings = + settingsBuilder.updateEnvironmentOperationSettings().build(); + deleteEnvironmentSettings = settingsBuilder.deleteEnvironmentSettings().build(); + lookupEnvironmentHistorySettings = settingsBuilder.lookupEnvironmentHistorySettings().build(); + } + + private static final PagedListDescriptor< + ListEnvironmentsRequest, ListEnvironmentsResponse, Environment> + LIST_ENVIRONMENTS_PAGE_STR_DESC = + new PagedListDescriptor< + ListEnvironmentsRequest, ListEnvironmentsResponse, Environment>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListEnvironmentsRequest injectToken( + ListEnvironmentsRequest payload, String token) { + return ListEnvironmentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListEnvironmentsRequest injectPageSize( + ListEnvironmentsRequest payload, int pageSize) { + return ListEnvironmentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListEnvironmentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListEnvironmentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListEnvironmentsResponse payload) { + return payload.getEnvironmentsList() != null + ? payload.getEnvironmentsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryResponse, Environment> + LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_DESC = + new PagedListDescriptor< + LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryResponse, Environment>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public LookupEnvironmentHistoryRequest injectToken( + LookupEnvironmentHistoryRequest payload, String token) { + return LookupEnvironmentHistoryRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public LookupEnvironmentHistoryRequest injectPageSize( + LookupEnvironmentHistoryRequest payload, int pageSize) { + return LookupEnvironmentHistoryRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(LookupEnvironmentHistoryRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(LookupEnvironmentHistoryResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + LookupEnvironmentHistoryResponse payload) { + return payload.getEnvironmentsList() != null + ? payload.getEnvironmentsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> + LIST_ENVIRONMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListEnvironmentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_ENVIRONMENTS_PAGE_STR_DESC, request, context); + return ListEnvironmentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + LookupEnvironmentHistoryPagedResponse> + LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_FACT = + new PagedListResponseFactory< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + LookupEnvironmentHistoryPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + LookupEnvironmentHistoryRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + Environment> + pageContext = + PageContext.create( + callable, LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_DESC, request, context); + return LookupEnvironmentHistoryPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for EnvironmentsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> + listEnvironmentsSettings; + private final UnaryCallSettings.Builder + getEnvironmentSettings; + private final UnaryCallSettings.Builder + createEnvironmentSettings; + private final OperationCallSettings.Builder + createEnvironmentOperationSettings; + private final UnaryCallSettings.Builder + updateEnvironmentSettings; + private final OperationCallSettings.Builder + updateEnvironmentOperationSettings; + private final UnaryCallSettings.Builder + deleteEnvironmentSettings; + private final PagedCallSettings.Builder< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + LookupEnvironmentHistoryPagedResponse> + lookupEnvironmentHistorySettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listEnvironmentsSettings = PagedCallSettings.newBuilder(LIST_ENVIRONMENTS_PAGE_STR_FACT); + + getEnvironmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createEnvironmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createEnvironmentOperationSettings = OperationCallSettings.newBuilder(); + + updateEnvironmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateEnvironmentOperationSettings = OperationCallSettings.newBuilder(); + + deleteEnvironmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + lookupEnvironmentHistorySettings = + PagedCallSettings.newBuilder(LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listEnvironmentsSettings, + getEnvironmentSettings, + createEnvironmentSettings, + updateEnvironmentSettings, + deleteEnvironmentSettings, + lookupEnvironmentHistorySettings); + + 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 + .listEnvironmentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getEnvironmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createEnvironmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateEnvironmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteEnvironmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .lookupEnvironmentHistorySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + builder + .createEnvironmentOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Environment.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Struct.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 + .updateEnvironmentOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Environment.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Struct.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(EnvironmentsStubSettings settings) { + super(settings); + + listEnvironmentsSettings = settings.listEnvironmentsSettings.toBuilder(); + getEnvironmentSettings = settings.getEnvironmentSettings.toBuilder(); + createEnvironmentSettings = settings.createEnvironmentSettings.toBuilder(); + createEnvironmentOperationSettings = settings.createEnvironmentOperationSettings.toBuilder(); + updateEnvironmentSettings = settings.updateEnvironmentSettings.toBuilder(); + updateEnvironmentOperationSettings = settings.updateEnvironmentOperationSettings.toBuilder(); + deleteEnvironmentSettings = settings.deleteEnvironmentSettings.toBuilder(); + lookupEnvironmentHistorySettings = settings.lookupEnvironmentHistorySettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listEnvironmentsSettings, + getEnvironmentSettings, + createEnvironmentSettings, + updateEnvironmentSettings, + deleteEnvironmentSettings, + lookupEnvironmentHistorySettings); + } + + // 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 listEnvironments. */ + public PagedCallSettings.Builder< + ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> + listEnvironmentsSettings() { + return listEnvironmentsSettings; + } + + /** Returns the builder for the settings used for calls to getEnvironment. */ + public UnaryCallSettings.Builder getEnvironmentSettings() { + return getEnvironmentSettings; + } + + /** Returns the builder for the settings used for calls to createEnvironment. */ + public UnaryCallSettings.Builder + createEnvironmentSettings() { + return createEnvironmentSettings; + } + + /** Returns the builder for the settings used for calls to createEnvironment. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createEnvironmentOperationSettings() { + return createEnvironmentOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateEnvironment. */ + public UnaryCallSettings.Builder + updateEnvironmentSettings() { + return updateEnvironmentSettings; + } + + /** Returns the builder for the settings used for calls to updateEnvironment. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateEnvironmentOperationSettings() { + return updateEnvironmentOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteEnvironment. */ + public UnaryCallSettings.Builder deleteEnvironmentSettings() { + return deleteEnvironmentSettings; + } + + /** Returns the builder for the settings used for calls to lookupEnvironmentHistory. */ + public PagedCallSettings.Builder< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + LookupEnvironmentHistoryPagedResponse> + lookupEnvironmentHistorySettings() { + return lookupEnvironmentHistorySettings; + } + + @Override + public EnvironmentsStubSettings build() throws IOException { + return new EnvironmentsStubSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStub.java new file mode 100644 index 000000000..37148c1c0 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStub.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. + */ +package com.google.cloud.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.FlowsClient.ListFlowsPagedResponse; + +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.dialogflow.cx.v3beta1.CreateFlowRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Flow; +import com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import com.google.protobuf.Struct; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class FlowsStub 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 createFlowCallable() { + throw new UnsupportedOperationException("Not implemented: createFlowCallable()"); + } + + public UnaryCallable deleteFlowCallable() { + throw new UnsupportedOperationException("Not implemented: deleteFlowCallable()"); + } + + public UnaryCallable listFlowsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listFlowsPagedCallable()"); + } + + public UnaryCallable listFlowsCallable() { + throw new UnsupportedOperationException("Not implemented: listFlowsCallable()"); + } + + public UnaryCallable getFlowCallable() { + throw new UnsupportedOperationException("Not implemented: getFlowCallable()"); + } + + public UnaryCallable updateFlowCallable() { + throw new UnsupportedOperationException("Not implemented: updateFlowCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable trainFlowOperationCallable() { + throw new UnsupportedOperationException("Not implemented: trainFlowOperationCallable()"); + } + + public UnaryCallable trainFlowCallable() { + throw new UnsupportedOperationException("Not implemented: trainFlowCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStubSettings.java new file mode 100644 index 000000000..7ca8bf58a --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStubSettings.java @@ -0,0 +1,536 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.FlowsClient.ListFlowsPagedResponse; + +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.dialogflow.cx.v3beta1.CreateFlowRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Flow; +import com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest; +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 com.google.protobuf.Struct; +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 FlowsStub}. + * + *

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

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

+ * 
+ * FlowsStubSettings.Builder flowsSettingsBuilder =
+ *     FlowsStubSettings.newBuilder();
+ * flowsSettingsBuilder
+ *     .createFlowSettings()
+ *     .setRetrySettings(
+ *         flowsSettingsBuilder.createFlowSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * FlowsStubSettings flowsSettings = flowsSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class FlowsStubSettings 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") + .add("https://www.googleapis.com/auth/dialogflow") + .build(); + + private final UnaryCallSettings createFlowSettings; + private final UnaryCallSettings deleteFlowSettings; + private final PagedCallSettings + listFlowsSettings; + private final UnaryCallSettings getFlowSettings; + private final UnaryCallSettings updateFlowSettings; + private final UnaryCallSettings trainFlowSettings; + private final OperationCallSettings trainFlowOperationSettings; + + /** Returns the object with the settings used for calls to createFlow. */ + public UnaryCallSettings createFlowSettings() { + return createFlowSettings; + } + + /** Returns the object with the settings used for calls to deleteFlow. */ + public UnaryCallSettings deleteFlowSettings() { + return deleteFlowSettings; + } + + /** Returns the object with the settings used for calls to listFlows. */ + public PagedCallSettings + listFlowsSettings() { + return listFlowsSettings; + } + + /** Returns the object with the settings used for calls to getFlow. */ + public UnaryCallSettings getFlowSettings() { + return getFlowSettings; + } + + /** Returns the object with the settings used for calls to updateFlow. */ + public UnaryCallSettings updateFlowSettings() { + return updateFlowSettings; + } + + /** Returns the object with the settings used for calls to trainFlow. */ + public UnaryCallSettings trainFlowSettings() { + return trainFlowSettings; + } + + /** Returns the object with the settings used for calls to trainFlow. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings trainFlowOperationSettings() { + return trainFlowOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public FlowsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcFlowsStub.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 "dialogflow.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(FlowsStubSettings.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 FlowsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createFlowSettings = settingsBuilder.createFlowSettings().build(); + deleteFlowSettings = settingsBuilder.deleteFlowSettings().build(); + listFlowsSettings = settingsBuilder.listFlowsSettings().build(); + getFlowSettings = settingsBuilder.getFlowSettings().build(); + updateFlowSettings = settingsBuilder.updateFlowSettings().build(); + trainFlowSettings = settingsBuilder.trainFlowSettings().build(); + trainFlowOperationSettings = settingsBuilder.trainFlowOperationSettings().build(); + } + + private static final PagedListDescriptor + LIST_FLOWS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListFlowsRequest injectToken(ListFlowsRequest payload, String token) { + return ListFlowsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListFlowsRequest injectPageSize(ListFlowsRequest payload, int pageSize) { + return ListFlowsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListFlowsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListFlowsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListFlowsResponse payload) { + return payload.getFlowsList() != null + ? payload.getFlowsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListFlowsRequest, ListFlowsResponse, ListFlowsPagedResponse> + LIST_FLOWS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListFlowsRequest, ListFlowsResponse, ListFlowsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListFlowsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_FLOWS_PAGE_STR_DESC, request, context); + return ListFlowsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for FlowsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder createFlowSettings; + private final UnaryCallSettings.Builder deleteFlowSettings; + private final PagedCallSettings.Builder< + ListFlowsRequest, ListFlowsResponse, ListFlowsPagedResponse> + listFlowsSettings; + private final UnaryCallSettings.Builder getFlowSettings; + private final UnaryCallSettings.Builder updateFlowSettings; + private final UnaryCallSettings.Builder trainFlowSettings; + private final OperationCallSettings.Builder + trainFlowOperationSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createFlowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteFlowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listFlowsSettings = PagedCallSettings.newBuilder(LIST_FLOWS_PAGE_STR_FACT); + + getFlowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateFlowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + trainFlowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + trainFlowOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createFlowSettings, + deleteFlowSettings, + listFlowsSettings, + getFlowSettings, + updateFlowSettings, + trainFlowSettings); + + 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 + .createFlowSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteFlowSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listFlowsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getFlowSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateFlowSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .trainFlowSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + builder + .trainFlowOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Struct.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(FlowsStubSettings settings) { + super(settings); + + createFlowSettings = settings.createFlowSettings.toBuilder(); + deleteFlowSettings = settings.deleteFlowSettings.toBuilder(); + listFlowsSettings = settings.listFlowsSettings.toBuilder(); + getFlowSettings = settings.getFlowSettings.toBuilder(); + updateFlowSettings = settings.updateFlowSettings.toBuilder(); + trainFlowSettings = settings.trainFlowSettings.toBuilder(); + trainFlowOperationSettings = settings.trainFlowOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createFlowSettings, + deleteFlowSettings, + listFlowsSettings, + getFlowSettings, + updateFlowSettings, + trainFlowSettings); + } + + // 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 createFlow. */ + public UnaryCallSettings.Builder createFlowSettings() { + return createFlowSettings; + } + + /** Returns the builder for the settings used for calls to deleteFlow. */ + public UnaryCallSettings.Builder deleteFlowSettings() { + return deleteFlowSettings; + } + + /** Returns the builder for the settings used for calls to listFlows. */ + public PagedCallSettings.Builder + listFlowsSettings() { + return listFlowsSettings; + } + + /** Returns the builder for the settings used for calls to getFlow. */ + public UnaryCallSettings.Builder getFlowSettings() { + return getFlowSettings; + } + + /** Returns the builder for the settings used for calls to updateFlow. */ + public UnaryCallSettings.Builder updateFlowSettings() { + return updateFlowSettings; + } + + /** Returns the builder for the settings used for calls to trainFlow. */ + public UnaryCallSettings.Builder trainFlowSettings() { + return trainFlowSettings; + } + + /** Returns the builder for the settings used for calls to trainFlow. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + trainFlowOperationSettings() { + return trainFlowOperationSettings; + } + + @Override + public FlowsStubSettings build() throws IOException { + return new FlowsStubSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsCallableFactory.java new file mode 100644 index 000000000..89e559871 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsCallableFactory.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.dialogflow.cx.v3beta1.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 Dialogflow API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcAgentsCallableFactory 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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsStub.java new file mode 100644 index 000000000..ae15184d4 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsStub.java @@ -0,0 +1,374 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.AgentsClient.ListAgentsPagedResponse; + +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.dialogflow.cx.v3beta1.Agent; +import com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse; +import com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.protobuf.Struct; +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 Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcAgentsStub extends AgentsStub { + + private static final MethodDescriptor + listAgentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Agents/ListAgents") + .setRequestMarshaller(ProtoUtils.marshaller(ListAgentsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListAgentsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getAgentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Agents/GetAgent") + .setRequestMarshaller(ProtoUtils.marshaller(GetAgentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Agent.getDefaultInstance())) + .build(); + private static final MethodDescriptor createAgentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Agents/CreateAgent") + .setRequestMarshaller(ProtoUtils.marshaller(CreateAgentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Agent.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateAgentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Agents/UpdateAgent") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateAgentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Agent.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteAgentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Agents/DeleteAgent") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteAgentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor exportAgentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Agents/ExportAgent") + .setRequestMarshaller(ProtoUtils.marshaller(ExportAgentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + restoreAgentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Agents/RestoreAgent") + .setRequestMarshaller(ProtoUtils.marshaller(RestoreAgentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable listAgentsCallable; + private final UnaryCallable listAgentsPagedCallable; + private final UnaryCallable getAgentCallable; + private final UnaryCallable createAgentCallable; + private final UnaryCallable updateAgentCallable; + private final UnaryCallable deleteAgentCallable; + private final UnaryCallable exportAgentCallable; + private final OperationCallable + exportAgentOperationCallable; + private final UnaryCallable restoreAgentCallable; + private final OperationCallable restoreAgentOperationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAgentsStub create(AgentsStubSettings settings) throws IOException { + return new GrpcAgentsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAgentsStub create(ClientContext clientContext) throws IOException { + return new GrpcAgentsStub(AgentsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAgentsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAgentsStub( + AgentsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAgentsStub, 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 GrpcAgentsStub(AgentsStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcAgentsCallableFactory()); + } + + /** + * Constructs an instance of GrpcAgentsStub, 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 GrpcAgentsStub( + AgentsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listAgentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listAgentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListAgentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getAgentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAgentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetAgentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createAgentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createAgentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateAgentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateAgentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateAgentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateAgentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("agent.name", String.valueOf(request.getAgent().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteAgentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteAgentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteAgentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings exportAgentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(exportAgentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ExportAgentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings restoreAgentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restoreAgentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(RestoreAgentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listAgentsCallable = + callableFactory.createUnaryCallable( + listAgentsTransportSettings, settings.listAgentsSettings(), clientContext); + this.listAgentsPagedCallable = + callableFactory.createPagedCallable( + listAgentsTransportSettings, settings.listAgentsSettings(), clientContext); + this.getAgentCallable = + callableFactory.createUnaryCallable( + getAgentTransportSettings, settings.getAgentSettings(), clientContext); + this.createAgentCallable = + callableFactory.createUnaryCallable( + createAgentTransportSettings, settings.createAgentSettings(), clientContext); + this.updateAgentCallable = + callableFactory.createUnaryCallable( + updateAgentTransportSettings, settings.updateAgentSettings(), clientContext); + this.deleteAgentCallable = + callableFactory.createUnaryCallable( + deleteAgentTransportSettings, settings.deleteAgentSettings(), clientContext); + this.exportAgentCallable = + callableFactory.createUnaryCallable( + exportAgentTransportSettings, settings.exportAgentSettings(), clientContext); + this.exportAgentOperationCallable = + callableFactory.createOperationCallable( + exportAgentTransportSettings, + settings.exportAgentOperationSettings(), + clientContext, + this.operationsStub); + this.restoreAgentCallable = + callableFactory.createUnaryCallable( + restoreAgentTransportSettings, settings.restoreAgentSettings(), clientContext); + this.restoreAgentOperationCallable = + callableFactory.createOperationCallable( + restoreAgentTransportSettings, + settings.restoreAgentOperationSettings(), + 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 listAgentsPagedCallable() { + return listAgentsPagedCallable; + } + + public UnaryCallable listAgentsCallable() { + return listAgentsCallable; + } + + public UnaryCallable getAgentCallable() { + return getAgentCallable; + } + + public UnaryCallable createAgentCallable() { + return createAgentCallable; + } + + public UnaryCallable updateAgentCallable() { + return updateAgentCallable; + } + + public UnaryCallable deleteAgentCallable() { + return deleteAgentCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + exportAgentOperationCallable() { + return exportAgentOperationCallable; + } + + public UnaryCallable exportAgentCallable() { + return exportAgentCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable restoreAgentOperationCallable() { + return restoreAgentOperationCallable; + } + + public UnaryCallable restoreAgentCallable() { + return restoreAgentCallable; + } + + @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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesCallableFactory.java new file mode 100644 index 000000000..d6497a060 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesCallableFactory.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.dialogflow.cx.v3beta1.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 Dialogflow API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcEntityTypesCallableFactory 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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesStub.java new file mode 100644 index 000000000..ae1cfb1a5 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesStub.java @@ -0,0 +1,295 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.EntityTypesClient.ListEntityTypesPagedResponse; + +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.dialogflow.cx.v3beta1.CreateEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.EntityType; +import com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest; +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 Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcEntityTypesStub extends EntityTypesStub { + + private static final MethodDescriptor + listEntityTypesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.EntityTypes/ListEntityTypes") + .setRequestMarshaller( + ProtoUtils.marshaller(ListEntityTypesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListEntityTypesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getEntityTypeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.EntityTypes/GetEntityType") + .setRequestMarshaller( + ProtoUtils.marshaller(GetEntityTypeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EntityType.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createEntityTypeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.EntityTypes/CreateEntityType") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateEntityTypeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EntityType.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateEntityTypeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.EntityTypes/UpdateEntityType") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateEntityTypeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EntityType.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteEntityTypeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.EntityTypes/DeleteEntityType") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteEntityTypeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable + listEntityTypesCallable; + private final UnaryCallable + listEntityTypesPagedCallable; + private final UnaryCallable getEntityTypeCallable; + private final UnaryCallable createEntityTypeCallable; + private final UnaryCallable updateEntityTypeCallable; + private final UnaryCallable deleteEntityTypeCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcEntityTypesStub create(EntityTypesStubSettings settings) + throws IOException { + return new GrpcEntityTypesStub(settings, ClientContext.create(settings)); + } + + public static final GrpcEntityTypesStub create(ClientContext clientContext) throws IOException { + return new GrpcEntityTypesStub(EntityTypesStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcEntityTypesStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcEntityTypesStub( + EntityTypesStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcEntityTypesStub, 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 GrpcEntityTypesStub(EntityTypesStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcEntityTypesCallableFactory()); + } + + /** + * Constructs an instance of GrpcEntityTypesStub, 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 GrpcEntityTypesStub( + EntityTypesStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings + listEntityTypesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listEntityTypesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListEntityTypesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getEntityTypeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEntityTypeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetEntityTypeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createEntityTypeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createEntityTypeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateEntityTypeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateEntityTypeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateEntityTypeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateEntityTypeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "entity_type.name", String.valueOf(request.getEntityType().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteEntityTypeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteEntityTypeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteEntityTypeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listEntityTypesCallable = + callableFactory.createUnaryCallable( + listEntityTypesTransportSettings, settings.listEntityTypesSettings(), clientContext); + this.listEntityTypesPagedCallable = + callableFactory.createPagedCallable( + listEntityTypesTransportSettings, settings.listEntityTypesSettings(), clientContext); + this.getEntityTypeCallable = + callableFactory.createUnaryCallable( + getEntityTypeTransportSettings, settings.getEntityTypeSettings(), clientContext); + this.createEntityTypeCallable = + callableFactory.createUnaryCallable( + createEntityTypeTransportSettings, settings.createEntityTypeSettings(), clientContext); + this.updateEntityTypeCallable = + callableFactory.createUnaryCallable( + updateEntityTypeTransportSettings, settings.updateEntityTypeSettings(), clientContext); + this.deleteEntityTypeCallable = + callableFactory.createUnaryCallable( + deleteEntityTypeTransportSettings, settings.deleteEntityTypeSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable + listEntityTypesPagedCallable() { + return listEntityTypesPagedCallable; + } + + public UnaryCallable listEntityTypesCallable() { + return listEntityTypesCallable; + } + + public UnaryCallable getEntityTypeCallable() { + return getEntityTypeCallable; + } + + public UnaryCallable createEntityTypeCallable() { + return createEntityTypeCallable; + } + + public UnaryCallable updateEntityTypeCallable() { + return updateEntityTypeCallable; + } + + public UnaryCallable deleteEntityTypeCallable() { + return deleteEntityTypeCallable; + } + + @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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsCallableFactory.java new file mode 100644 index 000000000..f1a353163 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsCallableFactory.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.dialogflow.cx.v3beta1.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 Dialogflow API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcEnvironmentsCallableFactory 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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsStub.java new file mode 100644 index 000000000..2a5593435 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsStub.java @@ -0,0 +1,400 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.ListEnvironmentsPagedResponse; +import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.LookupEnvironmentHistoryPagedResponse; + +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.dialogflow.cx.v3beta1.CreateEnvironmentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Environment; +import com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest; +import com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.protobuf.Struct; +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 Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcEnvironmentsStub extends EnvironmentsStub { + + private static final MethodDescriptor + listEnvironmentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Environments/ListEnvironments") + .setRequestMarshaller( + ProtoUtils.marshaller(ListEnvironmentsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListEnvironmentsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getEnvironmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Environments/GetEnvironment") + .setRequestMarshaller( + ProtoUtils.marshaller(GetEnvironmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Environment.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createEnvironmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.Environments/CreateEnvironment") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateEnvironmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateEnvironmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.Environments/UpdateEnvironment") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateEnvironmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteEnvironmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.Environments/DeleteEnvironment") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteEnvironmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor< + LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryResponse> + lookupEnvironmentHistoryMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.Environments/LookupEnvironmentHistory") + .setRequestMarshaller( + ProtoUtils.marshaller(LookupEnvironmentHistoryRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(LookupEnvironmentHistoryResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable + listEnvironmentsCallable; + private final UnaryCallable + listEnvironmentsPagedCallable; + private final UnaryCallable getEnvironmentCallable; + private final UnaryCallable createEnvironmentCallable; + private final OperationCallable + createEnvironmentOperationCallable; + private final UnaryCallable updateEnvironmentCallable; + private final OperationCallable + updateEnvironmentOperationCallable; + private final UnaryCallable deleteEnvironmentCallable; + private final UnaryCallable + lookupEnvironmentHistoryCallable; + private final UnaryCallable< + LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryPagedResponse> + lookupEnvironmentHistoryPagedCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcEnvironmentsStub create(EnvironmentsStubSettings settings) + throws IOException { + return new GrpcEnvironmentsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcEnvironmentsStub create(ClientContext clientContext) throws IOException { + return new GrpcEnvironmentsStub(EnvironmentsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcEnvironmentsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcEnvironmentsStub( + EnvironmentsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcEnvironmentsStub, 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 GrpcEnvironmentsStub(EnvironmentsStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcEnvironmentsCallableFactory()); + } + + /** + * Constructs an instance of GrpcEnvironmentsStub, 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 GrpcEnvironmentsStub( + EnvironmentsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listEnvironmentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listEnvironmentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListEnvironmentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getEnvironmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEnvironmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetEnvironmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createEnvironmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createEnvironmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateEnvironmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateEnvironmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateEnvironmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateEnvironmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "environment.name", String.valueOf(request.getEnvironment().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteEnvironmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteEnvironmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteEnvironmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + lookupEnvironmentHistoryTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(lookupEnvironmentHistoryMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(LookupEnvironmentHistoryRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listEnvironmentsCallable = + callableFactory.createUnaryCallable( + listEnvironmentsTransportSettings, settings.listEnvironmentsSettings(), clientContext); + this.listEnvironmentsPagedCallable = + callableFactory.createPagedCallable( + listEnvironmentsTransportSettings, settings.listEnvironmentsSettings(), clientContext); + this.getEnvironmentCallable = + callableFactory.createUnaryCallable( + getEnvironmentTransportSettings, settings.getEnvironmentSettings(), clientContext); + this.createEnvironmentCallable = + callableFactory.createUnaryCallable( + createEnvironmentTransportSettings, + settings.createEnvironmentSettings(), + clientContext); + this.createEnvironmentOperationCallable = + callableFactory.createOperationCallable( + createEnvironmentTransportSettings, + settings.createEnvironmentOperationSettings(), + clientContext, + this.operationsStub); + this.updateEnvironmentCallable = + callableFactory.createUnaryCallable( + updateEnvironmentTransportSettings, + settings.updateEnvironmentSettings(), + clientContext); + this.updateEnvironmentOperationCallable = + callableFactory.createOperationCallable( + updateEnvironmentTransportSettings, + settings.updateEnvironmentOperationSettings(), + clientContext, + this.operationsStub); + this.deleteEnvironmentCallable = + callableFactory.createUnaryCallable( + deleteEnvironmentTransportSettings, + settings.deleteEnvironmentSettings(), + clientContext); + this.lookupEnvironmentHistoryCallable = + callableFactory.createUnaryCallable( + lookupEnvironmentHistoryTransportSettings, + settings.lookupEnvironmentHistorySettings(), + clientContext); + this.lookupEnvironmentHistoryPagedCallable = + callableFactory.createPagedCallable( + lookupEnvironmentHistoryTransportSettings, + settings.lookupEnvironmentHistorySettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable + listEnvironmentsPagedCallable() { + return listEnvironmentsPagedCallable; + } + + public UnaryCallable + listEnvironmentsCallable() { + return listEnvironmentsCallable; + } + + public UnaryCallable getEnvironmentCallable() { + return getEnvironmentCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createEnvironmentOperationCallable() { + return createEnvironmentOperationCallable; + } + + public UnaryCallable createEnvironmentCallable() { + return createEnvironmentCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateEnvironmentOperationCallable() { + return updateEnvironmentOperationCallable; + } + + public UnaryCallable updateEnvironmentCallable() { + return updateEnvironmentCallable; + } + + public UnaryCallable deleteEnvironmentCallable() { + return deleteEnvironmentCallable; + } + + public UnaryCallable + lookupEnvironmentHistoryPagedCallable() { + return lookupEnvironmentHistoryPagedCallable; + } + + public UnaryCallable + lookupEnvironmentHistoryCallable() { + return lookupEnvironmentHistoryCallable; + } + + @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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsCallableFactory.java new file mode 100644 index 000000000..a8da24a56 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsCallableFactory.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.dialogflow.cx.v3beta1.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 Dialogflow API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcFlowsCallableFactory 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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsStub.java new file mode 100644 index 000000000..ce59e63cf --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsStub.java @@ -0,0 +1,329 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.FlowsClient.ListFlowsPagedResponse; + +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.dialogflow.cx.v3beta1.CreateFlowRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Flow; +import com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.protobuf.Struct; +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 Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcFlowsStub extends FlowsStub { + + private static final MethodDescriptor createFlowMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Flows/CreateFlow") + .setRequestMarshaller(ProtoUtils.marshaller(CreateFlowRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Flow.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteFlowMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Flows/DeleteFlow") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteFlowRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listFlowsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Flows/ListFlows") + .setRequestMarshaller(ProtoUtils.marshaller(ListFlowsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListFlowsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getFlowMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Flows/GetFlow") + .setRequestMarshaller(ProtoUtils.marshaller(GetFlowRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Flow.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateFlowMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Flows/UpdateFlow") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateFlowRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Flow.getDefaultInstance())) + .build(); + private static final MethodDescriptor trainFlowMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Flows/TrainFlow") + .setRequestMarshaller(ProtoUtils.marshaller(TrainFlowRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable createFlowCallable; + private final UnaryCallable deleteFlowCallable; + private final UnaryCallable listFlowsCallable; + private final UnaryCallable listFlowsPagedCallable; + private final UnaryCallable getFlowCallable; + private final UnaryCallable updateFlowCallable; + private final UnaryCallable trainFlowCallable; + private final OperationCallable trainFlowOperationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcFlowsStub create(FlowsStubSettings settings) throws IOException { + return new GrpcFlowsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcFlowsStub create(ClientContext clientContext) throws IOException { + return new GrpcFlowsStub(FlowsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcFlowsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcFlowsStub( + FlowsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcFlowsStub, 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 GrpcFlowsStub(FlowsStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcFlowsCallableFactory()); + } + + /** + * Constructs an instance of GrpcFlowsStub, 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 GrpcFlowsStub( + FlowsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createFlowTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createFlowMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateFlowRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteFlowTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteFlowMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteFlowRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listFlowsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listFlowsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListFlowsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getFlowTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getFlowMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetFlowRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateFlowTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateFlowMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateFlowRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("flow.name", String.valueOf(request.getFlow().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings trainFlowTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(trainFlowMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TrainFlowRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.createFlowCallable = + callableFactory.createUnaryCallable( + createFlowTransportSettings, settings.createFlowSettings(), clientContext); + this.deleteFlowCallable = + callableFactory.createUnaryCallable( + deleteFlowTransportSettings, settings.deleteFlowSettings(), clientContext); + this.listFlowsCallable = + callableFactory.createUnaryCallable( + listFlowsTransportSettings, settings.listFlowsSettings(), clientContext); + this.listFlowsPagedCallable = + callableFactory.createPagedCallable( + listFlowsTransportSettings, settings.listFlowsSettings(), clientContext); + this.getFlowCallable = + callableFactory.createUnaryCallable( + getFlowTransportSettings, settings.getFlowSettings(), clientContext); + this.updateFlowCallable = + callableFactory.createUnaryCallable( + updateFlowTransportSettings, settings.updateFlowSettings(), clientContext); + this.trainFlowCallable = + callableFactory.createUnaryCallable( + trainFlowTransportSettings, settings.trainFlowSettings(), clientContext); + this.trainFlowOperationCallable = + callableFactory.createOperationCallable( + trainFlowTransportSettings, + settings.trainFlowOperationSettings(), + 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 createFlowCallable() { + return createFlowCallable; + } + + public UnaryCallable deleteFlowCallable() { + return deleteFlowCallable; + } + + public UnaryCallable listFlowsPagedCallable() { + return listFlowsPagedCallable; + } + + public UnaryCallable listFlowsCallable() { + return listFlowsCallable; + } + + public UnaryCallable getFlowCallable() { + return getFlowCallable; + } + + public UnaryCallable updateFlowCallable() { + return updateFlowCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable trainFlowOperationCallable() { + return trainFlowOperationCallable; + } + + public UnaryCallable trainFlowCallable() { + return trainFlowCallable; + } + + @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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsCallableFactory.java new file mode 100644 index 000000000..60ad87cf6 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsCallableFactory.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.dialogflow.cx.v3beta1.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 Dialogflow API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcIntentsCallableFactory 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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsStub.java new file mode 100644 index 000000000..cffb6c868 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsStub.java @@ -0,0 +1,279 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.IntentsClient.ListIntentsPagedResponse; + +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.dialogflow.cx.v3beta1.CreateIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Intent; +import com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest; +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 Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcIntentsStub extends IntentsStub { + + private static final MethodDescriptor + listIntentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Intents/ListIntents") + .setRequestMarshaller(ProtoUtils.marshaller(ListIntentsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListIntentsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getIntentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Intents/GetIntent") + .setRequestMarshaller(ProtoUtils.marshaller(GetIntentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Intent.getDefaultInstance())) + .build(); + private static final MethodDescriptor createIntentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Intents/CreateIntent") + .setRequestMarshaller(ProtoUtils.marshaller(CreateIntentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Intent.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateIntentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Intents/UpdateIntent") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateIntentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Intent.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteIntentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Intents/DeleteIntent") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteIntentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable listIntentsCallable; + private final UnaryCallable + listIntentsPagedCallable; + private final UnaryCallable getIntentCallable; + private final UnaryCallable createIntentCallable; + private final UnaryCallable updateIntentCallable; + private final UnaryCallable deleteIntentCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcIntentsStub create(IntentsStubSettings settings) throws IOException { + return new GrpcIntentsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcIntentsStub create(ClientContext clientContext) throws IOException { + return new GrpcIntentsStub(IntentsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcIntentsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcIntentsStub( + IntentsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcIntentsStub, 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 GrpcIntentsStub(IntentsStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcIntentsCallableFactory()); + } + + /** + * Constructs an instance of GrpcIntentsStub, 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 GrpcIntentsStub( + IntentsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings listIntentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listIntentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListIntentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getIntentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIntentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIntentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createIntentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createIntentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateIntentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateIntentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateIntentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateIntentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("intent.name", String.valueOf(request.getIntent().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteIntentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteIntentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteIntentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listIntentsCallable = + callableFactory.createUnaryCallable( + listIntentsTransportSettings, settings.listIntentsSettings(), clientContext); + this.listIntentsPagedCallable = + callableFactory.createPagedCallable( + listIntentsTransportSettings, settings.listIntentsSettings(), clientContext); + this.getIntentCallable = + callableFactory.createUnaryCallable( + getIntentTransportSettings, settings.getIntentSettings(), clientContext); + this.createIntentCallable = + callableFactory.createUnaryCallable( + createIntentTransportSettings, settings.createIntentSettings(), clientContext); + this.updateIntentCallable = + callableFactory.createUnaryCallable( + updateIntentTransportSettings, settings.updateIntentSettings(), clientContext); + this.deleteIntentCallable = + callableFactory.createUnaryCallable( + deleteIntentTransportSettings, settings.deleteIntentSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable listIntentsPagedCallable() { + return listIntentsPagedCallable; + } + + public UnaryCallable listIntentsCallable() { + return listIntentsCallable; + } + + public UnaryCallable getIntentCallable() { + return getIntentCallable; + } + + public UnaryCallable createIntentCallable() { + return createIntentCallable; + } + + public UnaryCallable updateIntentCallable() { + return updateIntentCallable; + } + + public UnaryCallable deleteIntentCallable() { + return deleteIntentCallable; + } + + @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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesCallableFactory.java new file mode 100644 index 000000000..2f4206067 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesCallableFactory.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.dialogflow.cx.v3beta1.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 Dialogflow API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcPagesCallableFactory 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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesStub.java new file mode 100644 index 000000000..b9caf90ba --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesStub.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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.PagesClient.ListPagesPagedResponse; + +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.dialogflow.cx.v3beta1.CreatePageRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse; +import com.google.cloud.dialogflow.cx.v3beta1.Page; +import com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest; +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 Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcPagesStub extends PagesStub { + + private static final MethodDescriptor + listPagesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Pages/ListPages") + .setRequestMarshaller(ProtoUtils.marshaller(ListPagesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListPagesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getPageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Pages/GetPage") + .setRequestMarshaller(ProtoUtils.marshaller(GetPageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Page.getDefaultInstance())) + .build(); + private static final MethodDescriptor createPageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Pages/CreatePage") + .setRequestMarshaller(ProtoUtils.marshaller(CreatePageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Page.getDefaultInstance())) + .build(); + private static final MethodDescriptor updatePageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Pages/UpdatePage") + .setRequestMarshaller(ProtoUtils.marshaller(UpdatePageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Page.getDefaultInstance())) + .build(); + private static final MethodDescriptor deletePageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Pages/DeletePage") + .setRequestMarshaller(ProtoUtils.marshaller(DeletePageRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable listPagesCallable; + private final UnaryCallable listPagesPagedCallable; + private final UnaryCallable getPageCallable; + private final UnaryCallable createPageCallable; + private final UnaryCallable updatePageCallable; + private final UnaryCallable deletePageCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcPagesStub create(PagesStubSettings settings) throws IOException { + return new GrpcPagesStub(settings, ClientContext.create(settings)); + } + + public static final GrpcPagesStub create(ClientContext clientContext) throws IOException { + return new GrpcPagesStub(PagesStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcPagesStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcPagesStub( + PagesStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcPagesStub, 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 GrpcPagesStub(PagesStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcPagesCallableFactory()); + } + + /** + * Constructs an instance of GrpcPagesStub, 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 GrpcPagesStub( + PagesStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings listPagesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listPagesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListPagesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getPageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getPageMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetPageRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createPageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createPageMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreatePageRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updatePageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updatePageMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdatePageRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("page.name", String.valueOf(request.getPage().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deletePageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deletePageMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeletePageRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listPagesCallable = + callableFactory.createUnaryCallable( + listPagesTransportSettings, settings.listPagesSettings(), clientContext); + this.listPagesPagedCallable = + callableFactory.createPagedCallable( + listPagesTransportSettings, settings.listPagesSettings(), clientContext); + this.getPageCallable = + callableFactory.createUnaryCallable( + getPageTransportSettings, settings.getPageSettings(), clientContext); + this.createPageCallable = + callableFactory.createUnaryCallable( + createPageTransportSettings, settings.createPageSettings(), clientContext); + this.updatePageCallable = + callableFactory.createUnaryCallable( + updatePageTransportSettings, settings.updatePageSettings(), clientContext); + this.deletePageCallable = + callableFactory.createUnaryCallable( + deletePageTransportSettings, settings.deletePageSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable listPagesPagedCallable() { + return listPagesPagedCallable; + } + + public UnaryCallable listPagesCallable() { + return listPagesCallable; + } + + public UnaryCallable getPageCallable() { + return getPageCallable; + } + + public UnaryCallable createPageCallable() { + return createPageCallable; + } + + public UnaryCallable updatePageCallable() { + return updatePageCallable; + } + + public UnaryCallable deletePageCallable() { + return deletePageCallable; + } + + @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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesCallableFactory.java new file mode 100644 index 000000000..27ec996d6 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesCallableFactory.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.dialogflow.cx.v3beta1.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 Dialogflow API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcSessionEntityTypesCallableFactory 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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesStub.java new file mode 100644 index 000000000..5476c267c --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesStub.java @@ -0,0 +1,330 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; + +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.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse; +import com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest; +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 Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { + + private static final MethodDescriptor< + ListSessionEntityTypesRequest, ListSessionEntityTypesResponse> + listSessionEntityTypesMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes/ListSessionEntityTypes") + .setRequestMarshaller( + ProtoUtils.marshaller(ListSessionEntityTypesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSessionEntityTypesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getSessionEntityTypeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes/GetSessionEntityType") + .setRequestMarshaller( + ProtoUtils.marshaller(GetSessionEntityTypeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SessionEntityType.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createSessionEntityTypeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes/CreateSessionEntityType") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSessionEntityTypeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SessionEntityType.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateSessionEntityTypeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes/UpdateSessionEntityType") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateSessionEntityTypeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SessionEntityType.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteSessionEntityTypeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes/DeleteSessionEntityType") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteSessionEntityTypeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable + listSessionEntityTypesCallable; + private final UnaryCallable + listSessionEntityTypesPagedCallable; + private final UnaryCallable + getSessionEntityTypeCallable; + private final UnaryCallable + createSessionEntityTypeCallable; + private final UnaryCallable + updateSessionEntityTypeCallable; + private final UnaryCallable + deleteSessionEntityTypeCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSessionEntityTypesStub create(SessionEntityTypesStubSettings settings) + throws IOException { + return new GrpcSessionEntityTypesStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSessionEntityTypesStub create(ClientContext clientContext) + throws IOException { + return new GrpcSessionEntityTypesStub( + SessionEntityTypesStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSessionEntityTypesStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSessionEntityTypesStub( + SessionEntityTypesStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSessionEntityTypesStub, 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 GrpcSessionEntityTypesStub( + SessionEntityTypesStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSessionEntityTypesCallableFactory()); + } + + /** + * Constructs an instance of GrpcSessionEntityTypesStub, 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 GrpcSessionEntityTypesStub( + SessionEntityTypesStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings + listSessionEntityTypesTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listSessionEntityTypesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListSessionEntityTypesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getSessionEntityTypeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSessionEntityTypeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetSessionEntityTypeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + createSessionEntityTypeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSessionEntityTypeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateSessionEntityTypeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + updateSessionEntityTypeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSessionEntityTypeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateSessionEntityTypeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "session_entity_type.name", + String.valueOf(request.getSessionEntityType().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + deleteSessionEntityTypeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSessionEntityTypeMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteSessionEntityTypeRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listSessionEntityTypesCallable = + callableFactory.createUnaryCallable( + listSessionEntityTypesTransportSettings, + settings.listSessionEntityTypesSettings(), + clientContext); + this.listSessionEntityTypesPagedCallable = + callableFactory.createPagedCallable( + listSessionEntityTypesTransportSettings, + settings.listSessionEntityTypesSettings(), + clientContext); + this.getSessionEntityTypeCallable = + callableFactory.createUnaryCallable( + getSessionEntityTypeTransportSettings, + settings.getSessionEntityTypeSettings(), + clientContext); + this.createSessionEntityTypeCallable = + callableFactory.createUnaryCallable( + createSessionEntityTypeTransportSettings, + settings.createSessionEntityTypeSettings(), + clientContext); + this.updateSessionEntityTypeCallable = + callableFactory.createUnaryCallable( + updateSessionEntityTypeTransportSettings, + settings.updateSessionEntityTypeSettings(), + clientContext); + this.deleteSessionEntityTypeCallable = + callableFactory.createUnaryCallable( + deleteSessionEntityTypeTransportSettings, + settings.deleteSessionEntityTypeSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable + listSessionEntityTypesPagedCallable() { + return listSessionEntityTypesPagedCallable; + } + + public UnaryCallable + listSessionEntityTypesCallable() { + return listSessionEntityTypesCallable; + } + + public UnaryCallable + getSessionEntityTypeCallable() { + return getSessionEntityTypeCallable; + } + + public UnaryCallable + createSessionEntityTypeCallable() { + return createSessionEntityTypeCallable; + } + + public UnaryCallable + updateSessionEntityTypeCallable() { + return updateSessionEntityTypeCallable; + } + + public UnaryCallable deleteSessionEntityTypeCallable() { + return deleteSessionEntityTypeCallable; + } + + @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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsCallableFactory.java new file mode 100644 index 000000000..47122b3da --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsCallableFactory.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.dialogflow.cx.v3beta1.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 Dialogflow API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcSessionsCallableFactory 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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsStub.java new file mode 100644 index 000000000..79c41c521 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsStub.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. + */ +package com.google.cloud.dialogflow.cx.v3beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse; +import com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse; +import com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse; +import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse; +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 Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcSessionsStub extends SessionsStub { + + private static final MethodDescriptor + detectIntentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Sessions/DetectIntent") + .setRequestMarshaller(ProtoUtils.marshaller(DetectIntentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(DetectIntentResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + streamingDetectIntentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.Sessions/StreamingDetectIntent") + .setRequestMarshaller( + ProtoUtils.marshaller(StreamingDetectIntentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamingDetectIntentResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + matchIntentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Sessions/MatchIntent") + .setRequestMarshaller(ProtoUtils.marshaller(MatchIntentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(MatchIntentResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + fulfillIntentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Sessions/FulfillIntent") + .setRequestMarshaller( + ProtoUtils.marshaller(FulfillIntentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(FulfillIntentResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable detectIntentCallable; + private final BidiStreamingCallable + streamingDetectIntentCallable; + private final UnaryCallable matchIntentCallable; + private final UnaryCallable fulfillIntentCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSessionsStub create(SessionsStubSettings settings) throws IOException { + return new GrpcSessionsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSessionsStub create(ClientContext clientContext) throws IOException { + return new GrpcSessionsStub(SessionsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSessionsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSessionsStub( + SessionsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSessionsStub, 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 GrpcSessionsStub(SessionsStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcSessionsCallableFactory()); + } + + /** + * Constructs an instance of GrpcSessionsStub, 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 GrpcSessionsStub( + SessionsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings detectIntentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(detectIntentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DetectIntentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("session", String.valueOf(request.getSession())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + streamingDetectIntentTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(streamingDetectIntentMethodDescriptor) + .build(); + GrpcCallSettings matchIntentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(matchIntentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(MatchIntentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("session", String.valueOf(request.getSession())); + return params.build(); + } + }) + .build(); + GrpcCallSettings fulfillIntentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(fulfillIntentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(FulfillIntentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "match_intent_request.session", + String.valueOf(request.getMatchIntentRequest().getSession())); + return params.build(); + } + }) + .build(); + + this.detectIntentCallable = + callableFactory.createUnaryCallable( + detectIntentTransportSettings, settings.detectIntentSettings(), clientContext); + this.streamingDetectIntentCallable = + callableFactory.createBidiStreamingCallable( + streamingDetectIntentTransportSettings, + settings.streamingDetectIntentSettings(), + clientContext); + this.matchIntentCallable = + callableFactory.createUnaryCallable( + matchIntentTransportSettings, settings.matchIntentSettings(), clientContext); + this.fulfillIntentCallable = + callableFactory.createUnaryCallable( + fulfillIntentTransportSettings, settings.fulfillIntentSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable detectIntentCallable() { + return detectIntentCallable; + } + + public BidiStreamingCallable + streamingDetectIntentCallable() { + return streamingDetectIntentCallable; + } + + public UnaryCallable matchIntentCallable() { + return matchIntentCallable; + } + + public UnaryCallable fulfillIntentCallable() { + return fulfillIntentCallable; + } + + @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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsCallableFactory.java new file mode 100644 index 000000000..c2368b6e1 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsCallableFactory.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.dialogflow.cx.v3beta1.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 Dialogflow API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcTransitionRouteGroupsCallableFactory 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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsStub.java new file mode 100644 index 000000000..25cf8b708 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsStub.java @@ -0,0 +1,338 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; + +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.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest; +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 Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { + + private static final MethodDescriptor< + ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsResponse> + listTransitionRouteGroupsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups/ListTransitionRouteGroups") + .setRequestMarshaller( + ProtoUtils.marshaller(ListTransitionRouteGroupsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListTransitionRouteGroupsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getTransitionRouteGroupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups/GetTransitionRouteGroup") + .setRequestMarshaller( + ProtoUtils.marshaller(GetTransitionRouteGroupRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TransitionRouteGroup.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createTransitionRouteGroupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups/CreateTransitionRouteGroup") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateTransitionRouteGroupRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TransitionRouteGroup.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateTransitionRouteGroupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups/UpdateTransitionRouteGroup") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateTransitionRouteGroupRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TransitionRouteGroup.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteTransitionRouteGroupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups/DeleteTransitionRouteGroup") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteTransitionRouteGroupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable + listTransitionRouteGroupsCallable; + private final UnaryCallable< + ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsPagedResponse> + listTransitionRouteGroupsPagedCallable; + private final UnaryCallable + getTransitionRouteGroupCallable; + private final UnaryCallable + createTransitionRouteGroupCallable; + private final UnaryCallable + updateTransitionRouteGroupCallable; + private final UnaryCallable + deleteTransitionRouteGroupCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcTransitionRouteGroupsStub create( + TransitionRouteGroupsStubSettings settings) throws IOException { + return new GrpcTransitionRouteGroupsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcTransitionRouteGroupsStub create(ClientContext clientContext) + throws IOException { + return new GrpcTransitionRouteGroupsStub( + TransitionRouteGroupsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcTransitionRouteGroupsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcTransitionRouteGroupsStub( + TransitionRouteGroupsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcTransitionRouteGroupsStub, 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 GrpcTransitionRouteGroupsStub( + TransitionRouteGroupsStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcTransitionRouteGroupsCallableFactory()); + } + + /** + * Constructs an instance of GrpcTransitionRouteGroupsStub, 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 GrpcTransitionRouteGroupsStub( + TransitionRouteGroupsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings + listTransitionRouteGroupsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listTransitionRouteGroupsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListTransitionRouteGroupsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getTransitionRouteGroupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getTransitionRouteGroupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetTransitionRouteGroupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + createTransitionRouteGroupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createTransitionRouteGroupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + CreateTransitionRouteGroupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + updateTransitionRouteGroupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateTransitionRouteGroupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + UpdateTransitionRouteGroupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "transition_route_group.name", + String.valueOf(request.getTransitionRouteGroup().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + deleteTransitionRouteGroupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteTransitionRouteGroupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + DeleteTransitionRouteGroupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listTransitionRouteGroupsCallable = + callableFactory.createUnaryCallable( + listTransitionRouteGroupsTransportSettings, + settings.listTransitionRouteGroupsSettings(), + clientContext); + this.listTransitionRouteGroupsPagedCallable = + callableFactory.createPagedCallable( + listTransitionRouteGroupsTransportSettings, + settings.listTransitionRouteGroupsSettings(), + clientContext); + this.getTransitionRouteGroupCallable = + callableFactory.createUnaryCallable( + getTransitionRouteGroupTransportSettings, + settings.getTransitionRouteGroupSettings(), + clientContext); + this.createTransitionRouteGroupCallable = + callableFactory.createUnaryCallable( + createTransitionRouteGroupTransportSettings, + settings.createTransitionRouteGroupSettings(), + clientContext); + this.updateTransitionRouteGroupCallable = + callableFactory.createUnaryCallable( + updateTransitionRouteGroupTransportSettings, + settings.updateTransitionRouteGroupSettings(), + clientContext); + this.deleteTransitionRouteGroupCallable = + callableFactory.createUnaryCallable( + deleteTransitionRouteGroupTransportSettings, + settings.deleteTransitionRouteGroupSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable + listTransitionRouteGroupsPagedCallable() { + return listTransitionRouteGroupsPagedCallable; + } + + public UnaryCallable + listTransitionRouteGroupsCallable() { + return listTransitionRouteGroupsCallable; + } + + public UnaryCallable + getTransitionRouteGroupCallable() { + return getTransitionRouteGroupCallable; + } + + public UnaryCallable + createTransitionRouteGroupCallable() { + return createTransitionRouteGroupCallable; + } + + public UnaryCallable + updateTransitionRouteGroupCallable() { + return updateTransitionRouteGroupCallable; + } + + public UnaryCallable + deleteTransitionRouteGroupCallable() { + return deleteTransitionRouteGroupCallable; + } + + @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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsCallableFactory.java new file mode 100644 index 000000000..a91c079f5 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsCallableFactory.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.dialogflow.cx.v3beta1.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 Dialogflow API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcVersionsCallableFactory 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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsStub.java new file mode 100644 index 000000000..c3d8e22f0 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsStub.java @@ -0,0 +1,350 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.VersionsClient.ListVersionsPagedResponse; + +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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata; +import com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Version; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.protobuf.Struct; +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 Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcVersionsStub extends VersionsStub { + + private static final MethodDescriptor + listVersionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Versions/ListVersions") + .setRequestMarshaller(ProtoUtils.marshaller(ListVersionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListVersionsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Versions/GetVersion") + .setRequestMarshaller(ProtoUtils.marshaller(GetVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Version.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Versions/CreateVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Versions/UpdateVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Version.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Versions/DeleteVersion") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor loadVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Versions/LoadVersion") + .setRequestMarshaller(ProtoUtils.marshaller(LoadVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable listVersionsCallable; + private final UnaryCallable + listVersionsPagedCallable; + private final UnaryCallable getVersionCallable; + private final UnaryCallable createVersionCallable; + private final OperationCallable + createVersionOperationCallable; + private final UnaryCallable updateVersionCallable; + private final UnaryCallable deleteVersionCallable; + private final UnaryCallable loadVersionCallable; + private final OperationCallable loadVersionOperationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcVersionsStub create(VersionsStubSettings settings) throws IOException { + return new GrpcVersionsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcVersionsStub create(ClientContext clientContext) throws IOException { + return new GrpcVersionsStub(VersionsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcVersionsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcVersionsStub( + VersionsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcVersionsStub, 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 GrpcVersionsStub(VersionsStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcVersionsCallableFactory()); + } + + /** + * Constructs an instance of GrpcVersionsStub, 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 GrpcVersionsStub( + VersionsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listVersionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listVersionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListVersionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getVersionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetVersionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createVersionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateVersionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateVersionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateVersionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("version.name", String.valueOf(request.getVersion().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteVersionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteVersionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings loadVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(loadVersionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(LoadVersionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listVersionsCallable = + callableFactory.createUnaryCallable( + listVersionsTransportSettings, settings.listVersionsSettings(), clientContext); + this.listVersionsPagedCallable = + callableFactory.createPagedCallable( + listVersionsTransportSettings, settings.listVersionsSettings(), clientContext); + this.getVersionCallable = + callableFactory.createUnaryCallable( + getVersionTransportSettings, settings.getVersionSettings(), clientContext); + this.createVersionCallable = + callableFactory.createUnaryCallable( + createVersionTransportSettings, settings.createVersionSettings(), clientContext); + this.createVersionOperationCallable = + callableFactory.createOperationCallable( + createVersionTransportSettings, + settings.createVersionOperationSettings(), + clientContext, + this.operationsStub); + this.updateVersionCallable = + callableFactory.createUnaryCallable( + updateVersionTransportSettings, settings.updateVersionSettings(), clientContext); + this.deleteVersionCallable = + callableFactory.createUnaryCallable( + deleteVersionTransportSettings, settings.deleteVersionSettings(), clientContext); + this.loadVersionCallable = + callableFactory.createUnaryCallable( + loadVersionTransportSettings, settings.loadVersionSettings(), clientContext); + this.loadVersionOperationCallable = + callableFactory.createOperationCallable( + loadVersionTransportSettings, + settings.loadVersionOperationSettings(), + 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 listVersionsPagedCallable() { + return listVersionsPagedCallable; + } + + public UnaryCallable listVersionsCallable() { + return listVersionsCallable; + } + + public UnaryCallable getVersionCallable() { + return getVersionCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createVersionOperationCallable() { + return createVersionOperationCallable; + } + + public UnaryCallable createVersionCallable() { + return createVersionCallable; + } + + public UnaryCallable updateVersionCallable() { + return updateVersionCallable; + } + + public UnaryCallable deleteVersionCallable() { + return deleteVersionCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable loadVersionOperationCallable() { + return loadVersionOperationCallable; + } + + public UnaryCallable loadVersionCallable() { + return loadVersionCallable; + } + + @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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksCallableFactory.java new file mode 100644 index 000000000..cc82f36f9 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksCallableFactory.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.dialogflow.cx.v3beta1.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 Dialogflow API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcWebhooksCallableFactory 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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksStub.java new file mode 100644 index 000000000..b61fe2afd --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksStub.java @@ -0,0 +1,283 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.WebhooksClient.ListWebhooksPagedResponse; + +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.dialogflow.cx.v3beta1.CreateWebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Webhook; +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 Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcWebhooksStub extends WebhooksStub { + + private static final MethodDescriptor + listWebhooksMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Webhooks/ListWebhooks") + .setRequestMarshaller(ProtoUtils.marshaller(ListWebhooksRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListWebhooksResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getWebhookMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Webhooks/GetWebhook") + .setRequestMarshaller(ProtoUtils.marshaller(GetWebhookRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Webhook.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createWebhookMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Webhooks/CreateWebhook") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateWebhookRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Webhook.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateWebhookMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Webhooks/UpdateWebhook") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateWebhookRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Webhook.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteWebhookMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.dialogflow.cx.v3beta1.Webhooks/DeleteWebhook") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteWebhookRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable listWebhooksCallable; + private final UnaryCallable + listWebhooksPagedCallable; + private final UnaryCallable getWebhookCallable; + private final UnaryCallable createWebhookCallable; + private final UnaryCallable updateWebhookCallable; + private final UnaryCallable deleteWebhookCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcWebhooksStub create(WebhooksStubSettings settings) throws IOException { + return new GrpcWebhooksStub(settings, ClientContext.create(settings)); + } + + public static final GrpcWebhooksStub create(ClientContext clientContext) throws IOException { + return new GrpcWebhooksStub(WebhooksStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcWebhooksStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcWebhooksStub( + WebhooksStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcWebhooksStub, 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 GrpcWebhooksStub(WebhooksStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcWebhooksCallableFactory()); + } + + /** + * Constructs an instance of GrpcWebhooksStub, 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 GrpcWebhooksStub( + WebhooksStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings listWebhooksTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listWebhooksMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListWebhooksRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getWebhookTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getWebhookMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetWebhookRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createWebhookTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createWebhookMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateWebhookRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateWebhookTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateWebhookMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateWebhookRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("webhook.name", String.valueOf(request.getWebhook().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteWebhookTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteWebhookMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteWebhookRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listWebhooksCallable = + callableFactory.createUnaryCallable( + listWebhooksTransportSettings, settings.listWebhooksSettings(), clientContext); + this.listWebhooksPagedCallable = + callableFactory.createPagedCallable( + listWebhooksTransportSettings, settings.listWebhooksSettings(), clientContext); + this.getWebhookCallable = + callableFactory.createUnaryCallable( + getWebhookTransportSettings, settings.getWebhookSettings(), clientContext); + this.createWebhookCallable = + callableFactory.createUnaryCallable( + createWebhookTransportSettings, settings.createWebhookSettings(), clientContext); + this.updateWebhookCallable = + callableFactory.createUnaryCallable( + updateWebhookTransportSettings, settings.updateWebhookSettings(), clientContext); + this.deleteWebhookCallable = + callableFactory.createUnaryCallable( + deleteWebhookTransportSettings, settings.deleteWebhookSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable listWebhooksPagedCallable() { + return listWebhooksPagedCallable; + } + + public UnaryCallable listWebhooksCallable() { + return listWebhooksCallable; + } + + public UnaryCallable getWebhookCallable() { + return getWebhookCallable; + } + + public UnaryCallable createWebhookCallable() { + return createWebhookCallable; + } + + public UnaryCallable updateWebhookCallable() { + return updateWebhookCallable; + } + + public UnaryCallable deleteWebhookCallable() { + return deleteWebhookCallable; + } + + @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-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStub.java new file mode 100644 index 000000000..5c3af36e6 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStub.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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.IntentsClient.ListIntentsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Intent; +import com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class IntentsStub implements BackgroundResource { + + public UnaryCallable listIntentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listIntentsPagedCallable()"); + } + + public UnaryCallable listIntentsCallable() { + throw new UnsupportedOperationException("Not implemented: listIntentsCallable()"); + } + + public UnaryCallable getIntentCallable() { + throw new UnsupportedOperationException("Not implemented: getIntentCallable()"); + } + + public UnaryCallable createIntentCallable() { + throw new UnsupportedOperationException("Not implemented: createIntentCallable()"); + } + + public UnaryCallable updateIntentCallable() { + throw new UnsupportedOperationException("Not implemented: updateIntentCallable()"); + } + + public UnaryCallable deleteIntentCallable() { + throw new UnsupportedOperationException("Not implemented: deleteIntentCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStubSettings.java new file mode 100644 index 000000000..9627f555c --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStubSettings.java @@ -0,0 +1,464 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.IntentsClient.ListIntentsPagedResponse; + +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.dialogflow.cx.v3beta1.CreateIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Intent; +import com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest; +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 IntentsStub}. + * + *

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

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

+ * 
+ * IntentsStubSettings.Builder intentsSettingsBuilder =
+ *     IntentsStubSettings.newBuilder();
+ * intentsSettingsBuilder
+ *     .getIntentSettings()
+ *     .setRetrySettings(
+ *         intentsSettingsBuilder.getIntentSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * IntentsStubSettings intentsSettings = intentsSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class IntentsStubSettings 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") + .add("https://www.googleapis.com/auth/dialogflow") + .build(); + + private final PagedCallSettings + listIntentsSettings; + private final UnaryCallSettings getIntentSettings; + private final UnaryCallSettings createIntentSettings; + private final UnaryCallSettings updateIntentSettings; + private final UnaryCallSettings deleteIntentSettings; + + /** Returns the object with the settings used for calls to listIntents. */ + public PagedCallSettings + listIntentsSettings() { + return listIntentsSettings; + } + + /** Returns the object with the settings used for calls to getIntent. */ + public UnaryCallSettings getIntentSettings() { + return getIntentSettings; + } + + /** Returns the object with the settings used for calls to createIntent. */ + public UnaryCallSettings createIntentSettings() { + return createIntentSettings; + } + + /** Returns the object with the settings used for calls to updateIntent. */ + public UnaryCallSettings updateIntentSettings() { + return updateIntentSettings; + } + + /** Returns the object with the settings used for calls to deleteIntent. */ + public UnaryCallSettings deleteIntentSettings() { + return deleteIntentSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public IntentsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcIntentsStub.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 "dialogflow.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(IntentsStubSettings.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 IntentsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listIntentsSettings = settingsBuilder.listIntentsSettings().build(); + getIntentSettings = settingsBuilder.getIntentSettings().build(); + createIntentSettings = settingsBuilder.createIntentSettings().build(); + updateIntentSettings = settingsBuilder.updateIntentSettings().build(); + deleteIntentSettings = settingsBuilder.deleteIntentSettings().build(); + } + + private static final PagedListDescriptor + LIST_INTENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListIntentsRequest injectToken(ListIntentsRequest payload, String token) { + return ListIntentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListIntentsRequest injectPageSize(ListIntentsRequest payload, int pageSize) { + return ListIntentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListIntentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListIntentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListIntentsResponse payload) { + return payload.getIntentsList() != null + ? payload.getIntentsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse> + LIST_INTENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListIntentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INTENTS_PAGE_STR_DESC, request, context); + return ListIntentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for IntentsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse> + listIntentsSettings; + private final UnaryCallSettings.Builder getIntentSettings; + private final UnaryCallSettings.Builder createIntentSettings; + private final UnaryCallSettings.Builder updateIntentSettings; + private final UnaryCallSettings.Builder deleteIntentSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listIntentsSettings = PagedCallSettings.newBuilder(LIST_INTENTS_PAGE_STR_FACT); + + getIntentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createIntentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateIntentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteIntentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listIntentsSettings, + getIntentSettings, + createIntentSettings, + updateIntentSettings, + deleteIntentSettings); + + 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 + .listIntentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getIntentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createIntentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateIntentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteIntentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + return builder; + } + + protected Builder(IntentsStubSettings settings) { + super(settings); + + listIntentsSettings = settings.listIntentsSettings.toBuilder(); + getIntentSettings = settings.getIntentSettings.toBuilder(); + createIntentSettings = settings.createIntentSettings.toBuilder(); + updateIntentSettings = settings.updateIntentSettings.toBuilder(); + deleteIntentSettings = settings.deleteIntentSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listIntentsSettings, + getIntentSettings, + createIntentSettings, + updateIntentSettings, + deleteIntentSettings); + } + + // 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 listIntents. */ + public PagedCallSettings.Builder< + ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse> + listIntentsSettings() { + return listIntentsSettings; + } + + /** Returns the builder for the settings used for calls to getIntent. */ + public UnaryCallSettings.Builder getIntentSettings() { + return getIntentSettings; + } + + /** Returns the builder for the settings used for calls to createIntent. */ + public UnaryCallSettings.Builder createIntentSettings() { + return createIntentSettings; + } + + /** Returns the builder for the settings used for calls to updateIntent. */ + public UnaryCallSettings.Builder updateIntentSettings() { + return updateIntentSettings; + } + + /** Returns the builder for the settings used for calls to deleteIntent. */ + public UnaryCallSettings.Builder deleteIntentSettings() { + return deleteIntentSettings; + } + + @Override + public IntentsStubSettings build() throws IOException { + return new IntentsStubSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStub.java new file mode 100644 index 000000000..205752417 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStub.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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.PagesClient.ListPagesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse; +import com.google.cloud.dialogflow.cx.v3beta1.Page; +import com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class PagesStub implements BackgroundResource { + + public UnaryCallable listPagesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listPagesPagedCallable()"); + } + + public UnaryCallable listPagesCallable() { + throw new UnsupportedOperationException("Not implemented: listPagesCallable()"); + } + + public UnaryCallable getPageCallable() { + throw new UnsupportedOperationException("Not implemented: getPageCallable()"); + } + + public UnaryCallable createPageCallable() { + throw new UnsupportedOperationException("Not implemented: createPageCallable()"); + } + + public UnaryCallable updatePageCallable() { + throw new UnsupportedOperationException("Not implemented: updatePageCallable()"); + } + + public UnaryCallable deletePageCallable() { + throw new UnsupportedOperationException("Not implemented: deletePageCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStubSettings.java new file mode 100644 index 000000000..4041228e7 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStubSettings.java @@ -0,0 +1,463 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.PagesClient.ListPagesPagedResponse; + +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.dialogflow.cx.v3beta1.CreatePageRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse; +import com.google.cloud.dialogflow.cx.v3beta1.Page; +import com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest; +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 PagesStub}. + * + *

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

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

+ * 
+ * PagesStubSettings.Builder pagesSettingsBuilder =
+ *     PagesStubSettings.newBuilder();
+ * pagesSettingsBuilder
+ *     .getPageSettings()
+ *     .setRetrySettings(
+ *         pagesSettingsBuilder.getPageSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PagesStubSettings pagesSettings = pagesSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class PagesStubSettings 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") + .add("https://www.googleapis.com/auth/dialogflow") + .build(); + + private final PagedCallSettings + listPagesSettings; + private final UnaryCallSettings getPageSettings; + private final UnaryCallSettings createPageSettings; + private final UnaryCallSettings updatePageSettings; + private final UnaryCallSettings deletePageSettings; + + /** Returns the object with the settings used for calls to listPages. */ + public PagedCallSettings + listPagesSettings() { + return listPagesSettings; + } + + /** Returns the object with the settings used for calls to getPage. */ + public UnaryCallSettings getPageSettings() { + return getPageSettings; + } + + /** Returns the object with the settings used for calls to createPage. */ + public UnaryCallSettings createPageSettings() { + return createPageSettings; + } + + /** Returns the object with the settings used for calls to updatePage. */ + public UnaryCallSettings updatePageSettings() { + return updatePageSettings; + } + + /** Returns the object with the settings used for calls to deletePage. */ + public UnaryCallSettings deletePageSettings() { + return deletePageSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public PagesStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcPagesStub.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 "dialogflow.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(PagesStubSettings.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 PagesStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listPagesSettings = settingsBuilder.listPagesSettings().build(); + getPageSettings = settingsBuilder.getPageSettings().build(); + createPageSettings = settingsBuilder.createPageSettings().build(); + updatePageSettings = settingsBuilder.updatePageSettings().build(); + deletePageSettings = settingsBuilder.deletePageSettings().build(); + } + + private static final PagedListDescriptor + LIST_PAGES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListPagesRequest injectToken(ListPagesRequest payload, String token) { + return ListPagesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListPagesRequest injectPageSize(ListPagesRequest payload, int pageSize) { + return ListPagesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListPagesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListPagesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListPagesResponse payload) { + return payload.getPagesList() != null + ? payload.getPagesList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListPagesRequest, ListPagesResponse, ListPagesPagedResponse> + LIST_PAGES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListPagesRequest, ListPagesResponse, ListPagesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListPagesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PAGES_PAGE_STR_DESC, request, context); + return ListPagesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for PagesStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListPagesRequest, ListPagesResponse, ListPagesPagedResponse> + listPagesSettings; + private final UnaryCallSettings.Builder getPageSettings; + private final UnaryCallSettings.Builder createPageSettings; + private final UnaryCallSettings.Builder updatePageSettings; + private final UnaryCallSettings.Builder deletePageSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listPagesSettings = PagedCallSettings.newBuilder(LIST_PAGES_PAGE_STR_FACT); + + getPageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createPageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updatePageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deletePageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listPagesSettings, + getPageSettings, + createPageSettings, + updatePageSettings, + deletePageSettings); + + 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 + .listPagesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getPageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createPageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updatePageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deletePageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + return builder; + } + + protected Builder(PagesStubSettings settings) { + super(settings); + + listPagesSettings = settings.listPagesSettings.toBuilder(); + getPageSettings = settings.getPageSettings.toBuilder(); + createPageSettings = settings.createPageSettings.toBuilder(); + updatePageSettings = settings.updatePageSettings.toBuilder(); + deletePageSettings = settings.deletePageSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listPagesSettings, + getPageSettings, + createPageSettings, + updatePageSettings, + deletePageSettings); + } + + // 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 listPages. */ + public PagedCallSettings.Builder + listPagesSettings() { + return listPagesSettings; + } + + /** Returns the builder for the settings used for calls to getPage. */ + public UnaryCallSettings.Builder getPageSettings() { + return getPageSettings; + } + + /** Returns the builder for the settings used for calls to createPage. */ + public UnaryCallSettings.Builder createPageSettings() { + return createPageSettings; + } + + /** Returns the builder for the settings used for calls to updatePage. */ + public UnaryCallSettings.Builder updatePageSettings() { + return updatePageSettings; + } + + /** Returns the builder for the settings used for calls to deletePage. */ + public UnaryCallSettings.Builder deletePageSettings() { + return deletePageSettings; + } + + @Override + public PagesStubSettings build() throws IOException { + return new PagesStubSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStub.java new file mode 100644 index 000000000..768ad88bb --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStub.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse; +import com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class SessionEntityTypesStub implements BackgroundResource { + + public UnaryCallable + listSessionEntityTypesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listSessionEntityTypesPagedCallable()"); + } + + public UnaryCallable + listSessionEntityTypesCallable() { + throw new UnsupportedOperationException("Not implemented: listSessionEntityTypesCallable()"); + } + + public UnaryCallable + getSessionEntityTypeCallable() { + throw new UnsupportedOperationException("Not implemented: getSessionEntityTypeCallable()"); + } + + public UnaryCallable + createSessionEntityTypeCallable() { + throw new UnsupportedOperationException("Not implemented: createSessionEntityTypeCallable()"); + } + + public UnaryCallable + updateSessionEntityTypeCallable() { + throw new UnsupportedOperationException("Not implemented: updateSessionEntityTypeCallable()"); + } + + public UnaryCallable deleteSessionEntityTypeCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSessionEntityTypeCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStubSettings.java new file mode 100644 index 000000000..65d27cf0e --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStubSettings.java @@ -0,0 +1,510 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; + +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.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse; +import com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest; +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 SessionEntityTypesStub}. + * + *

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

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

+ * 
+ * SessionEntityTypesStubSettings.Builder sessionEntityTypesSettingsBuilder =
+ *     SessionEntityTypesStubSettings.newBuilder();
+ * sessionEntityTypesSettingsBuilder
+ *     .getSessionEntityTypeSettings()
+ *     .setRetrySettings(
+ *         sessionEntityTypesSettingsBuilder.getSessionEntityTypeSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SessionEntityTypesStubSettings sessionEntityTypesSettings = sessionEntityTypesSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class SessionEntityTypesStubSettings 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") + .add("https://www.googleapis.com/auth/dialogflow") + .build(); + + private final PagedCallSettings< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + ListSessionEntityTypesPagedResponse> + listSessionEntityTypesSettings; + private final UnaryCallSettings + getSessionEntityTypeSettings; + private final UnaryCallSettings + createSessionEntityTypeSettings; + private final UnaryCallSettings + updateSessionEntityTypeSettings; + private final UnaryCallSettings + deleteSessionEntityTypeSettings; + + /** Returns the object with the settings used for calls to listSessionEntityTypes. */ + public PagedCallSettings< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + ListSessionEntityTypesPagedResponse> + listSessionEntityTypesSettings() { + return listSessionEntityTypesSettings; + } + + /** Returns the object with the settings used for calls to getSessionEntityType. */ + public UnaryCallSettings + getSessionEntityTypeSettings() { + return getSessionEntityTypeSettings; + } + + /** Returns the object with the settings used for calls to createSessionEntityType. */ + public UnaryCallSettings + createSessionEntityTypeSettings() { + return createSessionEntityTypeSettings; + } + + /** Returns the object with the settings used for calls to updateSessionEntityType. */ + public UnaryCallSettings + updateSessionEntityTypeSettings() { + return updateSessionEntityTypeSettings; + } + + /** Returns the object with the settings used for calls to deleteSessionEntityType. */ + public UnaryCallSettings + deleteSessionEntityTypeSettings() { + return deleteSessionEntityTypeSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SessionEntityTypesStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSessionEntityTypesStub.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 "dialogflow.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(SessionEntityTypesStubSettings.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 SessionEntityTypesStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listSessionEntityTypesSettings = settingsBuilder.listSessionEntityTypesSettings().build(); + getSessionEntityTypeSettings = settingsBuilder.getSessionEntityTypeSettings().build(); + createSessionEntityTypeSettings = settingsBuilder.createSessionEntityTypeSettings().build(); + updateSessionEntityTypeSettings = settingsBuilder.updateSessionEntityTypeSettings().build(); + deleteSessionEntityTypeSettings = settingsBuilder.deleteSessionEntityTypeSettings().build(); + } + + private static final PagedListDescriptor< + ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, SessionEntityType> + LIST_SESSION_ENTITY_TYPES_PAGE_STR_DESC = + new PagedListDescriptor< + ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, SessionEntityType>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSessionEntityTypesRequest injectToken( + ListSessionEntityTypesRequest payload, String token) { + return ListSessionEntityTypesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSessionEntityTypesRequest injectPageSize( + ListSessionEntityTypesRequest payload, int pageSize) { + return ListSessionEntityTypesRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListSessionEntityTypesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSessionEntityTypesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListSessionEntityTypesResponse payload) { + return payload.getSessionEntityTypesList() != null + ? payload.getSessionEntityTypesList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + ListSessionEntityTypesPagedResponse> + LIST_SESSION_ENTITY_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + ListSessionEntityTypesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListSessionEntityTypesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + SessionEntityType> + pageContext = + PageContext.create( + callable, LIST_SESSION_ENTITY_TYPES_PAGE_STR_DESC, request, context); + return ListSessionEntityTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for SessionEntityTypesStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + ListSessionEntityTypesPagedResponse> + listSessionEntityTypesSettings; + private final UnaryCallSettings.Builder + getSessionEntityTypeSettings; + private final UnaryCallSettings.Builder + createSessionEntityTypeSettings; + private final UnaryCallSettings.Builder + updateSessionEntityTypeSettings; + private final UnaryCallSettings.Builder + deleteSessionEntityTypeSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listSessionEntityTypesSettings = + PagedCallSettings.newBuilder(LIST_SESSION_ENTITY_TYPES_PAGE_STR_FACT); + + getSessionEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createSessionEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateSessionEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteSessionEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listSessionEntityTypesSettings, + getSessionEntityTypeSettings, + createSessionEntityTypeSettings, + updateSessionEntityTypeSettings, + deleteSessionEntityTypeSettings); + + 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 + .listSessionEntityTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getSessionEntityTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createSessionEntityTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateSessionEntityTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteSessionEntityTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + return builder; + } + + protected Builder(SessionEntityTypesStubSettings settings) { + super(settings); + + listSessionEntityTypesSettings = settings.listSessionEntityTypesSettings.toBuilder(); + getSessionEntityTypeSettings = settings.getSessionEntityTypeSettings.toBuilder(); + createSessionEntityTypeSettings = settings.createSessionEntityTypeSettings.toBuilder(); + updateSessionEntityTypeSettings = settings.updateSessionEntityTypeSettings.toBuilder(); + deleteSessionEntityTypeSettings = settings.deleteSessionEntityTypeSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listSessionEntityTypesSettings, + getSessionEntityTypeSettings, + createSessionEntityTypeSettings, + updateSessionEntityTypeSettings, + deleteSessionEntityTypeSettings); + } + + // 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 listSessionEntityTypes. */ + public PagedCallSettings.Builder< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + ListSessionEntityTypesPagedResponse> + listSessionEntityTypesSettings() { + return listSessionEntityTypesSettings; + } + + /** Returns the builder for the settings used for calls to getSessionEntityType. */ + public UnaryCallSettings.Builder + getSessionEntityTypeSettings() { + return getSessionEntityTypeSettings; + } + + /** Returns the builder for the settings used for calls to createSessionEntityType. */ + public UnaryCallSettings.Builder + createSessionEntityTypeSettings() { + return createSessionEntityTypeSettings; + } + + /** Returns the builder for the settings used for calls to updateSessionEntityType. */ + public UnaryCallSettings.Builder + updateSessionEntityTypeSettings() { + return updateSessionEntityTypeSettings; + } + + /** Returns the builder for the settings used for calls to deleteSessionEntityType. */ + public UnaryCallSettings.Builder + deleteSessionEntityTypeSettings() { + return deleteSessionEntityTypeSettings; + } + + @Override + public SessionEntityTypesStubSettings build() throws IOException { + return new SessionEntityTypesStubSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionsStub.java new file mode 100644 index 000000000..40d767ef6 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionsStub.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse; +import com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse; +import com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse; +import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class SessionsStub implements BackgroundResource { + + public UnaryCallable detectIntentCallable() { + throw new UnsupportedOperationException("Not implemented: detectIntentCallable()"); + } + + public BidiStreamingCallable + streamingDetectIntentCallable() { + throw new UnsupportedOperationException("Not implemented: streamingDetectIntentCallable()"); + } + + public UnaryCallable matchIntentCallable() { + throw new UnsupportedOperationException("Not implemented: matchIntentCallable()"); + } + + public UnaryCallable fulfillIntentCallable() { + throw new UnsupportedOperationException("Not implemented: fulfillIntentCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionsStubSettings.java new file mode 100644 index 000000000..9e8f7c58b --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionsStubSettings.java @@ -0,0 +1,376 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse; +import com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse; +import com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse; +import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse; +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 SessionsStub}. + * + *

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

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

+ * 
+ * SessionsStubSettings.Builder sessionsSettingsBuilder =
+ *     SessionsStubSettings.newBuilder();
+ * sessionsSettingsBuilder
+ *     .detectIntentSettings()
+ *     .setRetrySettings(
+ *         sessionsSettingsBuilder.detectIntentSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SessionsStubSettings sessionsSettings = sessionsSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class SessionsStubSettings 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") + .add("https://www.googleapis.com/auth/dialogflow") + .build(); + + private final UnaryCallSettings detectIntentSettings; + private final StreamingCallSettings + streamingDetectIntentSettings; + private final UnaryCallSettings matchIntentSettings; + private final UnaryCallSettings + fulfillIntentSettings; + + /** Returns the object with the settings used for calls to detectIntent. */ + public UnaryCallSettings detectIntentSettings() { + return detectIntentSettings; + } + + /** Returns the object with the settings used for calls to streamingDetectIntent. */ + public StreamingCallSettings + streamingDetectIntentSettings() { + return streamingDetectIntentSettings; + } + + /** Returns the object with the settings used for calls to matchIntent. */ + public UnaryCallSettings matchIntentSettings() { + return matchIntentSettings; + } + + /** Returns the object with the settings used for calls to fulfillIntent. */ + public UnaryCallSettings fulfillIntentSettings() { + return fulfillIntentSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SessionsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSessionsStub.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 "dialogflow.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(SessionsStubSettings.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 SessionsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + detectIntentSettings = settingsBuilder.detectIntentSettings().build(); + streamingDetectIntentSettings = settingsBuilder.streamingDetectIntentSettings().build(); + matchIntentSettings = settingsBuilder.matchIntentSettings().build(); + fulfillIntentSettings = settingsBuilder.fulfillIntentSettings().build(); + } + + /** Builder for SessionsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + detectIntentSettings; + private final StreamingCallSettings.Builder< + StreamingDetectIntentRequest, StreamingDetectIntentResponse> + streamingDetectIntentSettings; + private final UnaryCallSettings.Builder + matchIntentSettings; + private final UnaryCallSettings.Builder + fulfillIntentSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + detectIntentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + streamingDetectIntentSettings = StreamingCallSettings.newBuilder(); + + matchIntentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + fulfillIntentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + detectIntentSettings, matchIntentSettings, fulfillIntentSettings); + + 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 + .detectIntentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .matchIntentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .fulfillIntentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + return builder; + } + + protected Builder(SessionsStubSettings settings) { + super(settings); + + detectIntentSettings = settings.detectIntentSettings.toBuilder(); + streamingDetectIntentSettings = settings.streamingDetectIntentSettings.toBuilder(); + matchIntentSettings = settings.matchIntentSettings.toBuilder(); + fulfillIntentSettings = settings.fulfillIntentSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + detectIntentSettings, matchIntentSettings, fulfillIntentSettings); + } + + // 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 detectIntent. */ + public UnaryCallSettings.Builder + detectIntentSettings() { + return detectIntentSettings; + } + + /** Returns the builder for the settings used for calls to streamingDetectIntent. */ + public StreamingCallSettings.Builder< + StreamingDetectIntentRequest, StreamingDetectIntentResponse> + streamingDetectIntentSettings() { + return streamingDetectIntentSettings; + } + + /** Returns the builder for the settings used for calls to matchIntent. */ + public UnaryCallSettings.Builder + matchIntentSettings() { + return matchIntentSettings; + } + + /** Returns the builder for the settings used for calls to fulfillIntent. */ + public UnaryCallSettings.Builder + fulfillIntentSettings() { + return fulfillIntentSettings; + } + + @Override + public SessionsStubSettings build() throws IOException { + return new SessionsStubSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStub.java new file mode 100644 index 000000000..f0ea471c4 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStub.java @@ -0,0 +1,79 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class TransitionRouteGroupsStub implements BackgroundResource { + + public UnaryCallable + listTransitionRouteGroupsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listTransitionRouteGroupsPagedCallable()"); + } + + public UnaryCallable + listTransitionRouteGroupsCallable() { + throw new UnsupportedOperationException("Not implemented: listTransitionRouteGroupsCallable()"); + } + + public UnaryCallable + getTransitionRouteGroupCallable() { + throw new UnsupportedOperationException("Not implemented: getTransitionRouteGroupCallable()"); + } + + public UnaryCallable + createTransitionRouteGroupCallable() { + throw new UnsupportedOperationException( + "Not implemented: createTransitionRouteGroupCallable()"); + } + + public UnaryCallable + updateTransitionRouteGroupCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateTransitionRouteGroupCallable()"); + } + + public UnaryCallable + deleteTransitionRouteGroupCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteTransitionRouteGroupCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStubSettings.java new file mode 100644 index 000000000..b33052338 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStubSettings.java @@ -0,0 +1,519 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; + +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.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest; +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 TransitionRouteGroupsStub}. + * + *

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

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

+ * 
+ * TransitionRouteGroupsStubSettings.Builder transitionRouteGroupsSettingsBuilder =
+ *     TransitionRouteGroupsStubSettings.newBuilder();
+ * transitionRouteGroupsSettingsBuilder
+ *     .getTransitionRouteGroupSettings()
+ *     .setRetrySettings(
+ *         transitionRouteGroupsSettingsBuilder.getTransitionRouteGroupSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * TransitionRouteGroupsStubSettings transitionRouteGroupsSettings = transitionRouteGroupsSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class TransitionRouteGroupsStubSettings + 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") + .add("https://www.googleapis.com/auth/dialogflow") + .build(); + + private final PagedCallSettings< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + ListTransitionRouteGroupsPagedResponse> + listTransitionRouteGroupsSettings; + private final UnaryCallSettings + getTransitionRouteGroupSettings; + private final UnaryCallSettings + createTransitionRouteGroupSettings; + private final UnaryCallSettings + updateTransitionRouteGroupSettings; + private final UnaryCallSettings + deleteTransitionRouteGroupSettings; + + /** Returns the object with the settings used for calls to listTransitionRouteGroups. */ + public PagedCallSettings< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + ListTransitionRouteGroupsPagedResponse> + listTransitionRouteGroupsSettings() { + return listTransitionRouteGroupsSettings; + } + + /** Returns the object with the settings used for calls to getTransitionRouteGroup. */ + public UnaryCallSettings + getTransitionRouteGroupSettings() { + return getTransitionRouteGroupSettings; + } + + /** Returns the object with the settings used for calls to createTransitionRouteGroup. */ + public UnaryCallSettings + createTransitionRouteGroupSettings() { + return createTransitionRouteGroupSettings; + } + + /** Returns the object with the settings used for calls to updateTransitionRouteGroup. */ + public UnaryCallSettings + updateTransitionRouteGroupSettings() { + return updateTransitionRouteGroupSettings; + } + + /** Returns the object with the settings used for calls to deleteTransitionRouteGroup. */ + public UnaryCallSettings + deleteTransitionRouteGroupSettings() { + return deleteTransitionRouteGroupSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TransitionRouteGroupsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcTransitionRouteGroupsStub.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 "dialogflow.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(TransitionRouteGroupsStubSettings.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 TransitionRouteGroupsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listTransitionRouteGroupsSettings = settingsBuilder.listTransitionRouteGroupsSettings().build(); + getTransitionRouteGroupSettings = settingsBuilder.getTransitionRouteGroupSettings().build(); + createTransitionRouteGroupSettings = + settingsBuilder.createTransitionRouteGroupSettings().build(); + updateTransitionRouteGroupSettings = + settingsBuilder.updateTransitionRouteGroupSettings().build(); + deleteTransitionRouteGroupSettings = + settingsBuilder.deleteTransitionRouteGroupSettings().build(); + } + + private static final PagedListDescriptor< + ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsResponse, TransitionRouteGroup> + LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_DESC = + new PagedListDescriptor< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + TransitionRouteGroup>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTransitionRouteGroupsRequest injectToken( + ListTransitionRouteGroupsRequest payload, String token) { + return ListTransitionRouteGroupsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListTransitionRouteGroupsRequest injectPageSize( + ListTransitionRouteGroupsRequest payload, int pageSize) { + return ListTransitionRouteGroupsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListTransitionRouteGroupsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTransitionRouteGroupsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListTransitionRouteGroupsResponse payload) { + return payload.getTransitionRouteGroupsList() != null + ? payload.getTransitionRouteGroupsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + ListTransitionRouteGroupsPagedResponse> + LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + ListTransitionRouteGroupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListTransitionRouteGroupsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + TransitionRouteGroup> + pageContext = + PageContext.create( + callable, LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_DESC, request, context); + return ListTransitionRouteGroupsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + /** Builder for TransitionRouteGroupsStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + ListTransitionRouteGroupsPagedResponse> + listTransitionRouteGroupsSettings; + private final UnaryCallSettings.Builder + getTransitionRouteGroupSettings; + private final UnaryCallSettings.Builder + createTransitionRouteGroupSettings; + private final UnaryCallSettings.Builder + updateTransitionRouteGroupSettings; + private final UnaryCallSettings.Builder + deleteTransitionRouteGroupSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listTransitionRouteGroupsSettings = + PagedCallSettings.newBuilder(LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_FACT); + + getTransitionRouteGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createTransitionRouteGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateTransitionRouteGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteTransitionRouteGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listTransitionRouteGroupsSettings, + getTransitionRouteGroupSettings, + createTransitionRouteGroupSettings, + updateTransitionRouteGroupSettings, + deleteTransitionRouteGroupSettings); + + 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 + .listTransitionRouteGroupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getTransitionRouteGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createTransitionRouteGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateTransitionRouteGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteTransitionRouteGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + return builder; + } + + protected Builder(TransitionRouteGroupsStubSettings settings) { + super(settings); + + listTransitionRouteGroupsSettings = settings.listTransitionRouteGroupsSettings.toBuilder(); + getTransitionRouteGroupSettings = settings.getTransitionRouteGroupSettings.toBuilder(); + createTransitionRouteGroupSettings = settings.createTransitionRouteGroupSettings.toBuilder(); + updateTransitionRouteGroupSettings = settings.updateTransitionRouteGroupSettings.toBuilder(); + deleteTransitionRouteGroupSettings = settings.deleteTransitionRouteGroupSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listTransitionRouteGroupsSettings, + getTransitionRouteGroupSettings, + createTransitionRouteGroupSettings, + updateTransitionRouteGroupSettings, + deleteTransitionRouteGroupSettings); + } + + // 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 listTransitionRouteGroups. */ + public PagedCallSettings.Builder< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + ListTransitionRouteGroupsPagedResponse> + listTransitionRouteGroupsSettings() { + return listTransitionRouteGroupsSettings; + } + + /** Returns the builder for the settings used for calls to getTransitionRouteGroup. */ + public UnaryCallSettings.Builder + getTransitionRouteGroupSettings() { + return getTransitionRouteGroupSettings; + } + + /** Returns the builder for the settings used for calls to createTransitionRouteGroup. */ + public UnaryCallSettings.Builder + createTransitionRouteGroupSettings() { + return createTransitionRouteGroupSettings; + } + + /** Returns the builder for the settings used for calls to updateTransitionRouteGroup. */ + public UnaryCallSettings.Builder + updateTransitionRouteGroupSettings() { + return updateTransitionRouteGroupSettings; + } + + /** Returns the builder for the settings used for calls to deleteTransitionRouteGroup. */ + public UnaryCallSettings.Builder + deleteTransitionRouteGroupSettings() { + return deleteTransitionRouteGroupSettings; + } + + @Override + public TransitionRouteGroupsStubSettings build() throws IOException { + return new TransitionRouteGroupsStubSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStub.java new file mode 100644 index 000000000..c8f517ae4 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStub.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. + */ +package com.google.cloud.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.VersionsClient.ListVersionsPagedResponse; + +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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata; +import com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Version; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import com.google.protobuf.Struct; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class VersionsStub 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 listVersionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listVersionsPagedCallable()"); + } + + public UnaryCallable listVersionsCallable() { + throw new UnsupportedOperationException("Not implemented: listVersionsCallable()"); + } + + public UnaryCallable getVersionCallable() { + throw new UnsupportedOperationException("Not implemented: getVersionCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createVersionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createVersionOperationCallable()"); + } + + public UnaryCallable createVersionCallable() { + throw new UnsupportedOperationException("Not implemented: createVersionCallable()"); + } + + public UnaryCallable updateVersionCallable() { + throw new UnsupportedOperationException("Not implemented: updateVersionCallable()"); + } + + public UnaryCallable deleteVersionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteVersionCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable loadVersionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: loadVersionOperationCallable()"); + } + + public UnaryCallable loadVersionCallable() { + throw new UnsupportedOperationException("Not implemented: loadVersionCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStubSettings.java new file mode 100644 index 000000000..ea2ee7465 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStubSettings.java @@ -0,0 +1,589 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.VersionsClient.ListVersionsPagedResponse; + +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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata; +import com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse; +import com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Version; +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 com.google.protobuf.Struct; +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 VersionsStub}. + * + *

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

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

+ * 
+ * VersionsStubSettings.Builder versionsSettingsBuilder =
+ *     VersionsStubSettings.newBuilder();
+ * versionsSettingsBuilder
+ *     .getVersionSettings()
+ *     .setRetrySettings(
+ *         versionsSettingsBuilder.getVersionSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * VersionsStubSettings versionsSettings = versionsSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class VersionsStubSettings 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") + .add("https://www.googleapis.com/auth/dialogflow") + .build(); + + private final PagedCallSettings< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> + listVersionsSettings; + private final UnaryCallSettings getVersionSettings; + private final UnaryCallSettings createVersionSettings; + private final OperationCallSettings + createVersionOperationSettings; + private final UnaryCallSettings updateVersionSettings; + private final UnaryCallSettings deleteVersionSettings; + private final UnaryCallSettings loadVersionSettings; + private final OperationCallSettings + loadVersionOperationSettings; + + /** Returns the object with the settings used for calls to listVersions. */ + public PagedCallSettings + listVersionsSettings() { + return listVersionsSettings; + } + + /** Returns the object with the settings used for calls to getVersion. */ + public UnaryCallSettings getVersionSettings() { + return getVersionSettings; + } + + /** Returns the object with the settings used for calls to createVersion. */ + public UnaryCallSettings createVersionSettings() { + return createVersionSettings; + } + + /** Returns the object with the settings used for calls to createVersion. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + createVersionOperationSettings() { + return createVersionOperationSettings; + } + + /** Returns the object with the settings used for calls to updateVersion. */ + public UnaryCallSettings updateVersionSettings() { + return updateVersionSettings; + } + + /** Returns the object with the settings used for calls to deleteVersion. */ + public UnaryCallSettings deleteVersionSettings() { + return deleteVersionSettings; + } + + /** Returns the object with the settings used for calls to loadVersion. */ + public UnaryCallSettings loadVersionSettings() { + return loadVersionSettings; + } + + /** Returns the object with the settings used for calls to loadVersion. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings loadVersionOperationSettings() { + return loadVersionOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public VersionsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcVersionsStub.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 "dialogflow.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(VersionsStubSettings.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 VersionsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listVersionsSettings = settingsBuilder.listVersionsSettings().build(); + getVersionSettings = settingsBuilder.getVersionSettings().build(); + createVersionSettings = settingsBuilder.createVersionSettings().build(); + createVersionOperationSettings = settingsBuilder.createVersionOperationSettings().build(); + updateVersionSettings = settingsBuilder.updateVersionSettings().build(); + deleteVersionSettings = settingsBuilder.deleteVersionSettings().build(); + loadVersionSettings = settingsBuilder.loadVersionSettings().build(); + loadVersionOperationSettings = settingsBuilder.loadVersionOperationSettings().build(); + } + + private static final PagedListDescriptor + LIST_VERSIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListVersionsRequest injectToken(ListVersionsRequest payload, String token) { + return ListVersionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListVersionsRequest injectPageSize(ListVersionsRequest payload, int pageSize) { + return ListVersionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListVersionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListVersionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListVersionsResponse payload) { + return payload.getVersionsList() != null + ? payload.getVersionsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> + LIST_VERSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListVersionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_VERSIONS_PAGE_STR_DESC, request, context); + return ListVersionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for VersionsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> + listVersionsSettings; + private final UnaryCallSettings.Builder getVersionSettings; + private final UnaryCallSettings.Builder createVersionSettings; + private final OperationCallSettings.Builder< + CreateVersionRequest, Version, CreateVersionOperationMetadata> + createVersionOperationSettings; + private final UnaryCallSettings.Builder updateVersionSettings; + private final UnaryCallSettings.Builder deleteVersionSettings; + private final UnaryCallSettings.Builder loadVersionSettings; + private final OperationCallSettings.Builder + loadVersionOperationSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listVersionsSettings = PagedCallSettings.newBuilder(LIST_VERSIONS_PAGE_STR_FACT); + + getVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createVersionOperationSettings = OperationCallSettings.newBuilder(); + + updateVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + loadVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + loadVersionOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listVersionsSettings, + getVersionSettings, + createVersionSettings, + updateVersionSettings, + deleteVersionSettings, + loadVersionSettings); + + 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 + .listVersionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .loadVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + builder + .createVersionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Version.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + CreateVersionOperationMetadata.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 + .loadVersionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Struct.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(VersionsStubSettings settings) { + super(settings); + + listVersionsSettings = settings.listVersionsSettings.toBuilder(); + getVersionSettings = settings.getVersionSettings.toBuilder(); + createVersionSettings = settings.createVersionSettings.toBuilder(); + createVersionOperationSettings = settings.createVersionOperationSettings.toBuilder(); + updateVersionSettings = settings.updateVersionSettings.toBuilder(); + deleteVersionSettings = settings.deleteVersionSettings.toBuilder(); + loadVersionSettings = settings.loadVersionSettings.toBuilder(); + loadVersionOperationSettings = settings.loadVersionOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listVersionsSettings, + getVersionSettings, + createVersionSettings, + updateVersionSettings, + deleteVersionSettings, + loadVersionSettings); + } + + // 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 listVersions. */ + public PagedCallSettings.Builder< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> + listVersionsSettings() { + return listVersionsSettings; + } + + /** Returns the builder for the settings used for calls to getVersion. */ + public UnaryCallSettings.Builder getVersionSettings() { + return getVersionSettings; + } + + /** Returns the builder for the settings used for calls to createVersion. */ + public UnaryCallSettings.Builder createVersionSettings() { + return createVersionSettings; + } + + /** Returns the builder for the settings used for calls to createVersion. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateVersionRequest, Version, CreateVersionOperationMetadata> + createVersionOperationSettings() { + return createVersionOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateVersion. */ + public UnaryCallSettings.Builder updateVersionSettings() { + return updateVersionSettings; + } + + /** Returns the builder for the settings used for calls to deleteVersion. */ + public UnaryCallSettings.Builder deleteVersionSettings() { + return deleteVersionSettings; + } + + /** Returns the builder for the settings used for calls to loadVersion. */ + public UnaryCallSettings.Builder loadVersionSettings() { + return loadVersionSettings; + } + + /** Returns the builder for the settings used for calls to loadVersion. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + loadVersionOperationSettings() { + return loadVersionOperationSettings; + } + + @Override + public VersionsStubSettings build() throws IOException { + return new VersionsStubSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStub.java new file mode 100644 index 000000000..e0c1fdeb4 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStub.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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.WebhooksClient.ListWebhooksPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Webhook; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Dialogflow API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class WebhooksStub implements BackgroundResource { + + public UnaryCallable listWebhooksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listWebhooksPagedCallable()"); + } + + public UnaryCallable listWebhooksCallable() { + throw new UnsupportedOperationException("Not implemented: listWebhooksCallable()"); + } + + public UnaryCallable getWebhookCallable() { + throw new UnsupportedOperationException("Not implemented: getWebhookCallable()"); + } + + public UnaryCallable createWebhookCallable() { + throw new UnsupportedOperationException("Not implemented: createWebhookCallable()"); + } + + public UnaryCallable updateWebhookCallable() { + throw new UnsupportedOperationException("Not implemented: updateWebhookCallable()"); + } + + public UnaryCallable deleteWebhookCallable() { + throw new UnsupportedOperationException("Not implemented: deleteWebhookCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStubSettings.java new file mode 100644 index 000000000..a898bec2d --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStubSettings.java @@ -0,0 +1,465 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1.stub; + +import static com.google.cloud.dialogflow.cx.v3beta1.WebhooksClient.ListWebhooksPagedResponse; + +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.dialogflow.cx.v3beta1.CreateWebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest; +import com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse; +import com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.Webhook; +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 WebhooksStub}. + * + *

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

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

+ * 
+ * WebhooksStubSettings.Builder webhooksSettingsBuilder =
+ *     WebhooksStubSettings.newBuilder();
+ * webhooksSettingsBuilder
+ *     .getWebhookSettings()
+ *     .setRetrySettings(
+ *         webhooksSettingsBuilder.getWebhookSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * WebhooksStubSettings webhooksSettings = webhooksSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class WebhooksStubSettings 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") + .add("https://www.googleapis.com/auth/dialogflow") + .build(); + + private final PagedCallSettings< + ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse> + listWebhooksSettings; + private final UnaryCallSettings getWebhookSettings; + private final UnaryCallSettings createWebhookSettings; + private final UnaryCallSettings updateWebhookSettings; + private final UnaryCallSettings deleteWebhookSettings; + + /** Returns the object with the settings used for calls to listWebhooks. */ + public PagedCallSettings + listWebhooksSettings() { + return listWebhooksSettings; + } + + /** Returns the object with the settings used for calls to getWebhook. */ + public UnaryCallSettings getWebhookSettings() { + return getWebhookSettings; + } + + /** Returns the object with the settings used for calls to createWebhook. */ + public UnaryCallSettings createWebhookSettings() { + return createWebhookSettings; + } + + /** Returns the object with the settings used for calls to updateWebhook. */ + public UnaryCallSettings updateWebhookSettings() { + return updateWebhookSettings; + } + + /** Returns the object with the settings used for calls to deleteWebhook. */ + public UnaryCallSettings deleteWebhookSettings() { + return deleteWebhookSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public WebhooksStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcWebhooksStub.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 "dialogflow.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(WebhooksStubSettings.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 WebhooksStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listWebhooksSettings = settingsBuilder.listWebhooksSettings().build(); + getWebhookSettings = settingsBuilder.getWebhookSettings().build(); + createWebhookSettings = settingsBuilder.createWebhookSettings().build(); + updateWebhookSettings = settingsBuilder.updateWebhookSettings().build(); + deleteWebhookSettings = settingsBuilder.deleteWebhookSettings().build(); + } + + private static final PagedListDescriptor + LIST_WEBHOOKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListWebhooksRequest injectToken(ListWebhooksRequest payload, String token) { + return ListWebhooksRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListWebhooksRequest injectPageSize(ListWebhooksRequest payload, int pageSize) { + return ListWebhooksRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListWebhooksRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListWebhooksResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListWebhooksResponse payload) { + return payload.getWebhooksList() != null + ? payload.getWebhooksList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse> + LIST_WEBHOOKS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListWebhooksRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_WEBHOOKS_PAGE_STR_DESC, request, context); + return ListWebhooksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for WebhooksStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse> + listWebhooksSettings; + private final UnaryCallSettings.Builder getWebhookSettings; + private final UnaryCallSettings.Builder createWebhookSettings; + private final UnaryCallSettings.Builder updateWebhookSettings; + private final UnaryCallSettings.Builder deleteWebhookSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(220000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(220000L)) + .setTotalTimeout(Duration.ofMillis(220000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listWebhooksSettings = PagedCallSettings.newBuilder(LIST_WEBHOOKS_PAGE_STR_FACT); + + getWebhookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createWebhookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateWebhookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteWebhookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listWebhooksSettings, + getWebhookSettings, + createWebhookSettings, + updateWebhookSettings, + deleteWebhookSettings); + + 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 + .listWebhooksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getWebhookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createWebhookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateWebhookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteWebhookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + return builder; + } + + protected Builder(WebhooksStubSettings settings) { + super(settings); + + listWebhooksSettings = settings.listWebhooksSettings.toBuilder(); + getWebhookSettings = settings.getWebhookSettings.toBuilder(); + createWebhookSettings = settings.createWebhookSettings.toBuilder(); + updateWebhookSettings = settings.updateWebhookSettings.toBuilder(); + deleteWebhookSettings = settings.deleteWebhookSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listWebhooksSettings, + getWebhookSettings, + createWebhookSettings, + updateWebhookSettings, + deleteWebhookSettings); + } + + // 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 listWebhooks. */ + public PagedCallSettings.Builder< + ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse> + listWebhooksSettings() { + return listWebhooksSettings; + } + + /** Returns the builder for the settings used for calls to getWebhook. */ + public UnaryCallSettings.Builder getWebhookSettings() { + return getWebhookSettings; + } + + /** Returns the builder for the settings used for calls to createWebhook. */ + public UnaryCallSettings.Builder createWebhookSettings() { + return createWebhookSettings; + } + + /** Returns the builder for the settings used for calls to updateWebhook. */ + public UnaryCallSettings.Builder updateWebhookSettings() { + return updateWebhookSettings; + } + + /** Returns the builder for the settings used for calls to deleteWebhook. */ + public UnaryCallSettings.Builder deleteWebhookSettings() { + return deleteWebhookSettings; + } + + @Override + public WebhooksStubSettings build() throws IOException { + return new WebhooksStubSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClientTest.java new file mode 100644 index 000000000..fca8adb89 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClientTest.java @@ -0,0 +1,481 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.AgentsClient.ListAgentsPagedResponse; + +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 com.google.protobuf.FieldMask; +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 AgentsClientTest { + private static MockPages mockPages; + private static MockFlows mockFlows; + private static MockAgents mockAgents; + private static MockEntityTypes mockEntityTypes; + private static MockEnvironments mockEnvironments; + private static MockIntents mockIntents; + private static MockSessionEntityTypes mockSessionEntityTypes; + private static MockSessions mockSessions; + private static MockTransitionRouteGroups mockTransitionRouteGroups; + private static MockVersions mockVersions; + private static MockWebhooks mockWebhooks; + private static MockServiceHelper serviceHelper; + private AgentsClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockPages = new MockPages(); + mockFlows = new MockFlows(); + mockAgents = new MockAgents(); + mockEntityTypes = new MockEntityTypes(); + mockEnvironments = new MockEnvironments(); + mockIntents = new MockIntents(); + mockSessionEntityTypes = new MockSessionEntityTypes(); + mockSessions = new MockSessions(); + mockTransitionRouteGroups = new MockTransitionRouteGroups(); + mockVersions = new MockVersions(); + mockWebhooks = new MockWebhooks(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockPages, + mockFlows, + mockAgents, + mockEntityTypes, + mockEnvironments, + mockIntents, + mockSessionEntityTypes, + mockSessions, + mockTransitionRouteGroups, + mockVersions, + mockWebhooks)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + AgentsSettings settings = + AgentsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AgentsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listAgentsTest() { + String nextPageToken = ""; + Agent agentsElement = Agent.newBuilder().build(); + List agents = Arrays.asList(agentsElement); + ListAgentsResponse expectedResponse = + ListAgentsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllAgents(agents) + .build(); + mockAgents.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListAgentsPagedResponse pagedListResponse = client.listAgents(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAgentsList().get(0), resources.get(0)); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAgentsRequest actualRequest = (ListAgentsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listAgentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + client.listAgents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getAgentTest() { + AgentName name2 = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + String displayName = "displayName1615086568"; + String defaultLanguageCode = "defaultLanguageCode856575222"; + String timeZone = "timeZone36848094"; + String description = "description-1724546052"; + String avatarUri = "avatarUri-402824826"; + FlowName startFlow = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + boolean enableStackdriverLogging = true; + boolean enableSpellCorrection = false; + Agent expectedResponse = + Agent.newBuilder() + .setName(name2.toString()) + .setDisplayName(displayName) + .setDefaultLanguageCode(defaultLanguageCode) + .setTimeZone(timeZone) + .setDescription(description) + .setAvatarUri(avatarUri) + .setStartFlow(startFlow.toString()) + .setEnableStackdriverLogging(enableStackdriverLogging) + .setEnableSpellCorrection(enableSpellCorrection) + .build(); + mockAgents.addResponse(expectedResponse); + + AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + + Agent actualResponse = client.getAgent(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAgentRequest actualRequest = (GetAgentRequest) actualRequests.get(0); + + Assert.assertEquals(name, AgentName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getAgentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + + try { + AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + + client.getAgent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createAgentTest() { + AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + String displayName = "displayName1615086568"; + String defaultLanguageCode = "defaultLanguageCode856575222"; + String timeZone = "timeZone36848094"; + String description = "description-1724546052"; + String avatarUri = "avatarUri-402824826"; + FlowName startFlow = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + boolean enableStackdriverLogging = true; + boolean enableSpellCorrection = false; + Agent expectedResponse = + Agent.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setDefaultLanguageCode(defaultLanguageCode) + .setTimeZone(timeZone) + .setDescription(description) + .setAvatarUri(avatarUri) + .setStartFlow(startFlow.toString()) + .setEnableStackdriverLogging(enableStackdriverLogging) + .setEnableSpellCorrection(enableSpellCorrection) + .build(); + mockAgents.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Agent agent = Agent.newBuilder().build(); + + Agent actualResponse = client.createAgent(parent, agent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAgentRequest actualRequest = (CreateAgentRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(agent, actualRequest.getAgent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createAgentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Agent agent = Agent.newBuilder().build(); + + client.createAgent(parent, agent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateAgentTest() { + AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + String displayName = "displayName1615086568"; + String defaultLanguageCode = "defaultLanguageCode856575222"; + String timeZone = "timeZone36848094"; + String description = "description-1724546052"; + String avatarUri = "avatarUri-402824826"; + FlowName startFlow = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + boolean enableStackdriverLogging = true; + boolean enableSpellCorrection = false; + Agent expectedResponse = + Agent.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setDefaultLanguageCode(defaultLanguageCode) + .setTimeZone(timeZone) + .setDescription(description) + .setAvatarUri(avatarUri) + .setStartFlow(startFlow.toString()) + .setEnableStackdriverLogging(enableStackdriverLogging) + .setEnableSpellCorrection(enableSpellCorrection) + .build(); + mockAgents.addResponse(expectedResponse); + + Agent agent = Agent.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Agent actualResponse = client.updateAgent(agent, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateAgentRequest actualRequest = (UpdateAgentRequest) actualRequests.get(0); + + Assert.assertEquals(agent, actualRequest.getAgent()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateAgentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + + try { + Agent agent = Agent.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateAgent(agent, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteAgentTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockAgents.addResponse(expectedResponse); + + AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + + client.deleteAgent(name); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAgentRequest actualRequest = (DeleteAgentRequest) actualRequests.get(0); + + Assert.assertEquals(name, AgentName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteAgentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + + try { + AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + + client.deleteAgent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void exportAgentTest() throws Exception { + String agentUri = "agentUri-1700713166"; + ExportAgentResponse expectedResponse = + ExportAgentResponse.newBuilder().setAgentUri(agentUri).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("exportAgentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAgents.addResponse(resultOperation); + + AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + ExportAgentRequest request = ExportAgentRequest.newBuilder().setName(name.toString()).build(); + + ExportAgentResponse actualResponse = client.exportAgentAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ExportAgentRequest actualRequest = (ExportAgentRequest) actualRequests.get(0); + + Assert.assertEquals(name, AgentName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void exportAgentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + + try { + AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + ExportAgentRequest request = ExportAgentRequest.newBuilder().setName(name.toString()).build(); + + client.exportAgentAsync(request).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 restoreAgentTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restoreAgentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAgents.addResponse(resultOperation); + + AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + RestoreAgentRequest request = RestoreAgentRequest.newBuilder().setName(name.toString()).build(); + + Empty actualResponse = client.restoreAgentAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestoreAgentRequest actualRequest = (RestoreAgentRequest) actualRequests.get(0); + + Assert.assertEquals(name, AgentName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void restoreAgentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + + try { + AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + RestoreAgentRequest request = + RestoreAgentRequest.newBuilder().setName(name.toString()).build(); + + client.restoreAgentAsync(request).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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClientTest.java new file mode 100644 index 000000000..dc208f801 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClientTest.java @@ -0,0 +1,344 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.EntityTypesClient.ListEntityTypesPagedResponse; + +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 com.google.protobuf.FieldMask; +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 EntityTypesClientTest { + private static MockPages mockPages; + private static MockFlows mockFlows; + private static MockAgents mockAgents; + private static MockEntityTypes mockEntityTypes; + private static MockEnvironments mockEnvironments; + private static MockIntents mockIntents; + private static MockSessionEntityTypes mockSessionEntityTypes; + private static MockSessions mockSessions; + private static MockTransitionRouteGroups mockTransitionRouteGroups; + private static MockVersions mockVersions; + private static MockWebhooks mockWebhooks; + private static MockServiceHelper serviceHelper; + private EntityTypesClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockPages = new MockPages(); + mockFlows = new MockFlows(); + mockAgents = new MockAgents(); + mockEntityTypes = new MockEntityTypes(); + mockEnvironments = new MockEnvironments(); + mockIntents = new MockIntents(); + mockSessionEntityTypes = new MockSessionEntityTypes(); + mockSessions = new MockSessions(); + mockTransitionRouteGroups = new MockTransitionRouteGroups(); + mockVersions = new MockVersions(); + mockWebhooks = new MockWebhooks(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockPages, + mockFlows, + mockAgents, + mockEntityTypes, + mockEnvironments, + mockIntents, + mockSessionEntityTypes, + mockSessions, + mockTransitionRouteGroups, + mockVersions, + mockWebhooks)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + EntityTypesSettings settings = + EntityTypesSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = EntityTypesClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listEntityTypesTest() { + String nextPageToken = ""; + EntityType entityTypesElement = EntityType.newBuilder().build(); + List entityTypes = Arrays.asList(entityTypesElement); + ListEntityTypesResponse expectedResponse = + ListEntityTypesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllEntityTypes(entityTypes) + .build(); + mockEntityTypes.addResponse(expectedResponse); + + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + + ListEntityTypesPagedResponse pagedListResponse = client.listEntityTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEntityTypesList().get(0), resources.get(0)); + + List actualRequests = mockEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEntityTypesRequest actualRequest = (ListEntityTypesRequest) actualRequests.get(0); + + Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listEntityTypesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockEntityTypes.addException(exception); + + try { + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + + client.listEntityTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getEntityTypeTest() { + EntityTypeName name2 = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); + String displayName = "displayName1615086568"; + boolean enableFuzzyExtraction = true; + EntityType expectedResponse = + EntityType.newBuilder() + .setName(name2.toString()) + .setDisplayName(displayName) + .setEnableFuzzyExtraction(enableFuzzyExtraction) + .build(); + mockEntityTypes.addResponse(expectedResponse); + + EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); + + EntityType actualResponse = client.getEntityType(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEntityTypeRequest actualRequest = (GetEntityTypeRequest) actualRequests.get(0); + + Assert.assertEquals(name, EntityTypeName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getEntityTypeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockEntityTypes.addException(exception); + + try { + EntityTypeName name = + EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); + + client.getEntityType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createEntityTypeTest() { + EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); + String displayName = "displayName1615086568"; + boolean enableFuzzyExtraction = true; + EntityType expectedResponse = + EntityType.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setEnableFuzzyExtraction(enableFuzzyExtraction) + .build(); + mockEntityTypes.addResponse(expectedResponse); + + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + EntityType entityType = EntityType.newBuilder().build(); + + EntityType actualResponse = client.createEntityType(parent, entityType); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateEntityTypeRequest actualRequest = (CreateEntityTypeRequest) actualRequests.get(0); + + Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(entityType, actualRequest.getEntityType()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createEntityTypeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockEntityTypes.addException(exception); + + try { + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + EntityType entityType = EntityType.newBuilder().build(); + + client.createEntityType(parent, entityType); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateEntityTypeTest() { + EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); + String displayName = "displayName1615086568"; + boolean enableFuzzyExtraction = true; + EntityType expectedResponse = + EntityType.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setEnableFuzzyExtraction(enableFuzzyExtraction) + .build(); + mockEntityTypes.addResponse(expectedResponse); + + EntityType entityType = EntityType.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + EntityType actualResponse = client.updateEntityType(entityType, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateEntityTypeRequest actualRequest = (UpdateEntityTypeRequest) actualRequests.get(0); + + Assert.assertEquals(entityType, actualRequest.getEntityType()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateEntityTypeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockEntityTypes.addException(exception); + + try { + EntityType entityType = EntityType.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateEntityType(entityType, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteEntityTypeTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockEntityTypes.addResponse(expectedResponse); + + EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); + + client.deleteEntityType(name); + + List actualRequests = mockEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteEntityTypeRequest actualRequest = (DeleteEntityTypeRequest) actualRequests.get(0); + + Assert.assertEquals(name, EntityTypeName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteEntityTypeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockEntityTypes.addException(exception); + + try { + EntityTypeName name = + EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); + + client.deleteEntityType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClientTest.java new file mode 100644 index 000000000..ff913cbb0 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClientTest.java @@ -0,0 +1,421 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.ListEnvironmentsPagedResponse; +import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.LookupEnvironmentHistoryPagedResponse; + +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 com.google.protobuf.FieldMask; +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 EnvironmentsClientTest { + private static MockPages mockPages; + private static MockFlows mockFlows; + private static MockAgents mockAgents; + private static MockEntityTypes mockEntityTypes; + private static MockEnvironments mockEnvironments; + private static MockIntents mockIntents; + private static MockSessionEntityTypes mockSessionEntityTypes; + private static MockSessions mockSessions; + private static MockTransitionRouteGroups mockTransitionRouteGroups; + private static MockVersions mockVersions; + private static MockWebhooks mockWebhooks; + private static MockServiceHelper serviceHelper; + private EnvironmentsClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockPages = new MockPages(); + mockFlows = new MockFlows(); + mockAgents = new MockAgents(); + mockEntityTypes = new MockEntityTypes(); + mockEnvironments = new MockEnvironments(); + mockIntents = new MockIntents(); + mockSessionEntityTypes = new MockSessionEntityTypes(); + mockSessions = new MockSessions(); + mockTransitionRouteGroups = new MockTransitionRouteGroups(); + mockVersions = new MockVersions(); + mockWebhooks = new MockWebhooks(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockPages, + mockFlows, + mockAgents, + mockEntityTypes, + mockEnvironments, + mockIntents, + mockSessionEntityTypes, + mockSessions, + mockTransitionRouteGroups, + mockVersions, + mockWebhooks)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + EnvironmentsSettings settings = + EnvironmentsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = EnvironmentsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listEnvironmentsTest() { + String nextPageToken = ""; + Environment environmentsElement = Environment.newBuilder().build(); + List environments = Arrays.asList(environmentsElement); + ListEnvironmentsResponse expectedResponse = + ListEnvironmentsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllEnvironments(environments) + .build(); + mockEnvironments.addResponse(expectedResponse); + + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + + ListEnvironmentsPagedResponse pagedListResponse = client.listEnvironments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEnvironmentsList().get(0), resources.get(0)); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEnvironmentsRequest actualRequest = (ListEnvironmentsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listEnvironmentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + + client.listEnvironments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getEnvironmentTest() { + EnvironmentName name2 = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Environment expectedResponse = + Environment.newBuilder() + .setName(name2.toString()) + .setDisplayName(displayName) + .setDescription(description) + .build(); + mockEnvironments.addResponse(expectedResponse); + + EnvironmentName name = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + + Environment actualResponse = client.getEnvironment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEnvironmentRequest actualRequest = (GetEnvironmentRequest) actualRequests.get(0); + + Assert.assertEquals(name, EnvironmentName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getEnvironmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + EnvironmentName name = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + + client.getEnvironment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createEnvironmentTest() throws Exception { + EnvironmentName name = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Environment expectedResponse = + Environment.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setDescription(description) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createEnvironmentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEnvironments.addResponse(resultOperation); + + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + Environment environment = Environment.newBuilder().build(); + + Environment actualResponse = client.createEnvironmentAsync(parent, environment).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateEnvironmentRequest actualRequest = (CreateEnvironmentRequest) actualRequests.get(0); + + Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(environment, actualRequest.getEnvironment()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createEnvironmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + Environment environment = Environment.newBuilder().build(); + + client.createEnvironmentAsync(parent, environment).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 updateEnvironmentTest() throws Exception { + EnvironmentName name = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Environment expectedResponse = + Environment.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setDescription(description) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateEnvironmentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEnvironments.addResponse(resultOperation); + + Environment environment = Environment.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Environment actualResponse = client.updateEnvironmentAsync(environment, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateEnvironmentRequest actualRequest = (UpdateEnvironmentRequest) actualRequests.get(0); + + Assert.assertEquals(environment, actualRequest.getEnvironment()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateEnvironmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + Environment environment = Environment.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateEnvironmentAsync(environment, updateMask).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 deleteEnvironmentTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockEnvironments.addResponse(expectedResponse); + + EnvironmentName name = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + + client.deleteEnvironment(name); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteEnvironmentRequest actualRequest = (DeleteEnvironmentRequest) actualRequests.get(0); + + Assert.assertEquals(name, EnvironmentName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteEnvironmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + EnvironmentName name = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + + client.deleteEnvironment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void lookupEnvironmentHistoryTest() { + String nextPageToken = ""; + Environment environmentsElement = Environment.newBuilder().build(); + List environments = Arrays.asList(environmentsElement); + LookupEnvironmentHistoryResponse expectedResponse = + LookupEnvironmentHistoryResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllEnvironments(environments) + .build(); + mockEnvironments.addResponse(expectedResponse); + + EnvironmentName name = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + + LookupEnvironmentHistoryPagedResponse pagedListResponse = client.lookupEnvironmentHistory(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEnvironmentsList().get(0), resources.get(0)); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LookupEnvironmentHistoryRequest actualRequest = + (LookupEnvironmentHistoryRequest) actualRequests.get(0); + + Assert.assertEquals(name, EnvironmentName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void lookupEnvironmentHistoryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + EnvironmentName name = + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + + client.lookupEnvironmentHistory(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClientTest.java new file mode 100644 index 000000000..a0a00ce77 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClientTest.java @@ -0,0 +1,389 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.FlowsClient.ListFlowsPagedResponse; + +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 com.google.protobuf.FieldMask; +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 FlowsClientTest { + private static MockPages mockPages; + private static MockFlows mockFlows; + private static MockAgents mockAgents; + private static MockEntityTypes mockEntityTypes; + private static MockEnvironments mockEnvironments; + private static MockIntents mockIntents; + private static MockSessionEntityTypes mockSessionEntityTypes; + private static MockSessions mockSessions; + private static MockTransitionRouteGroups mockTransitionRouteGroups; + private static MockVersions mockVersions; + private static MockWebhooks mockWebhooks; + private static MockServiceHelper serviceHelper; + private FlowsClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockPages = new MockPages(); + mockFlows = new MockFlows(); + mockAgents = new MockAgents(); + mockEntityTypes = new MockEntityTypes(); + mockEnvironments = new MockEnvironments(); + mockIntents = new MockIntents(); + mockSessionEntityTypes = new MockSessionEntityTypes(); + mockSessions = new MockSessions(); + mockTransitionRouteGroups = new MockTransitionRouteGroups(); + mockVersions = new MockVersions(); + mockWebhooks = new MockWebhooks(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockPages, + mockFlows, + mockAgents, + mockEntityTypes, + mockEnvironments, + mockIntents, + mockSessionEntityTypes, + mockSessions, + mockTransitionRouteGroups, + mockVersions, + mockWebhooks)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + FlowsSettings settings = + FlowsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = FlowsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createFlowTest() { + FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Flow expectedResponse = + Flow.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setDescription(description) + .build(); + mockFlows.addResponse(expectedResponse); + + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + Flow flow = Flow.newBuilder().build(); + + Flow actualResponse = client.createFlow(parent, flow); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFlowRequest actualRequest = (CreateFlowRequest) actualRequests.get(0); + + Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(flow, actualRequest.getFlow()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createFlowExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + Flow flow = Flow.newBuilder().build(); + + client.createFlow(parent, flow); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteFlowTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockFlows.addResponse(expectedResponse); + + FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + + client.deleteFlow(name); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFlowRequest actualRequest = (DeleteFlowRequest) actualRequests.get(0); + + Assert.assertEquals(name, FlowName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteFlowExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + + client.deleteFlow(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listFlowsTest() { + String nextPageToken = ""; + Flow flowsElement = Flow.newBuilder().build(); + List flows = Arrays.asList(flowsElement); + ListFlowsResponse expectedResponse = + ListFlowsResponse.newBuilder().setNextPageToken(nextPageToken).addAllFlows(flows).build(); + mockFlows.addResponse(expectedResponse); + + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + + ListFlowsPagedResponse pagedListResponse = client.listFlows(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFlowsList().get(0), resources.get(0)); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFlowsRequest actualRequest = (ListFlowsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listFlowsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + + client.listFlows(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getFlowTest() { + FlowName name2 = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Flow expectedResponse = + Flow.newBuilder() + .setName(name2.toString()) + .setDisplayName(displayName) + .setDescription(description) + .build(); + mockFlows.addResponse(expectedResponse); + + FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + + Flow actualResponse = client.getFlow(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFlowRequest actualRequest = (GetFlowRequest) actualRequests.get(0); + + Assert.assertEquals(name, FlowName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getFlowExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + + client.getFlow(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateFlowTest() { + FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Flow expectedResponse = + Flow.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setDescription(description) + .build(); + mockFlows.addResponse(expectedResponse); + + Flow flow = Flow.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Flow actualResponse = client.updateFlow(flow, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateFlowRequest actualRequest = (UpdateFlowRequest) actualRequests.get(0); + + Assert.assertEquals(flow, actualRequest.getFlow()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateFlowExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + Flow flow = Flow.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateFlow(flow, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void trainFlowTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("trainFlowTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFlows.addResponse(resultOperation); + + FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + + Empty actualResponse = client.trainFlowAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TrainFlowRequest actualRequest = (TrainFlowRequest) actualRequests.get(0); + + Assert.assertEquals(name, FlowName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void trainFlowExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + + client.trainFlowAsync(name).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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClientTest.java new file mode 100644 index 000000000..977ea6593 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClientTest.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. + */ +package com.google.cloud.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.IntentsClient.ListIntentsPagedResponse; + +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 com.google.protobuf.FieldMask; +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 IntentsClientTest { + private static MockPages mockPages; + private static MockFlows mockFlows; + private static MockAgents mockAgents; + private static MockEntityTypes mockEntityTypes; + private static MockEnvironments mockEnvironments; + private static MockIntents mockIntents; + private static MockSessionEntityTypes mockSessionEntityTypes; + private static MockSessions mockSessions; + private static MockTransitionRouteGroups mockTransitionRouteGroups; + private static MockVersions mockVersions; + private static MockWebhooks mockWebhooks; + private static MockServiceHelper serviceHelper; + private IntentsClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockPages = new MockPages(); + mockFlows = new MockFlows(); + mockAgents = new MockAgents(); + mockEntityTypes = new MockEntityTypes(); + mockEnvironments = new MockEnvironments(); + mockIntents = new MockIntents(); + mockSessionEntityTypes = new MockSessionEntityTypes(); + mockSessions = new MockSessions(); + mockTransitionRouteGroups = new MockTransitionRouteGroups(); + mockVersions = new MockVersions(); + mockWebhooks = new MockWebhooks(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockPages, + mockFlows, + mockAgents, + mockEntityTypes, + mockEnvironments, + mockIntents, + mockSessionEntityTypes, + mockSessions, + mockTransitionRouteGroups, + mockVersions, + mockWebhooks)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + IntentsSettings settings = + IntentsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = IntentsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listIntentsTest() { + String nextPageToken = ""; + Intent intentsElement = Intent.newBuilder().build(); + List intents = Arrays.asList(intentsElement); + ListIntentsResponse expectedResponse = + ListIntentsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllIntents(intents) + .build(); + mockIntents.addResponse(expectedResponse); + + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + + ListIntentsPagedResponse pagedListResponse = client.listIntents(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getIntentsList().get(0), resources.get(0)); + + List actualRequests = mockIntents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListIntentsRequest actualRequest = (ListIntentsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listIntentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockIntents.addException(exception); + + try { + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + + client.listIntents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getIntentTest() { + IntentName name2 = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); + String displayName = "displayName1615086568"; + int priority = 1165461084; + boolean isFallback = false; + Intent expectedResponse = + Intent.newBuilder() + .setName(name2.toString()) + .setDisplayName(displayName) + .setPriority(priority) + .setIsFallback(isFallback) + .build(); + mockIntents.addResponse(expectedResponse); + + IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); + + Intent actualResponse = client.getIntent(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIntents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIntentRequest actualRequest = (GetIntentRequest) actualRequests.get(0); + + Assert.assertEquals(name, IntentName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getIntentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockIntents.addException(exception); + + try { + IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); + + client.getIntent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createIntentTest() { + IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); + String displayName = "displayName1615086568"; + int priority = 1165461084; + boolean isFallback = false; + Intent expectedResponse = + Intent.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setPriority(priority) + .setIsFallback(isFallback) + .build(); + mockIntents.addResponse(expectedResponse); + + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + Intent intent = Intent.newBuilder().build(); + + Intent actualResponse = client.createIntent(parent, intent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIntents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateIntentRequest actualRequest = (CreateIntentRequest) actualRequests.get(0); + + Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(intent, actualRequest.getIntent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createIntentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockIntents.addException(exception); + + try { + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + Intent intent = Intent.newBuilder().build(); + + client.createIntent(parent, intent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateIntentTest() { + IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); + String displayName = "displayName1615086568"; + int priority = 1165461084; + boolean isFallback = false; + Intent expectedResponse = + Intent.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setPriority(priority) + .setIsFallback(isFallback) + .build(); + mockIntents.addResponse(expectedResponse); + + Intent intent = Intent.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Intent actualResponse = client.updateIntent(intent, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIntents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateIntentRequest actualRequest = (UpdateIntentRequest) actualRequests.get(0); + + Assert.assertEquals(intent, actualRequest.getIntent()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateIntentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockIntents.addException(exception); + + try { + Intent intent = Intent.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateIntent(intent, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteIntentTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockIntents.addResponse(expectedResponse); + + IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); + + client.deleteIntent(name); + + List actualRequests = mockIntents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteIntentRequest actualRequest = (DeleteIntentRequest) actualRequests.get(0); + + Assert.assertEquals(name, IntentName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteIntentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockIntents.addException(exception); + + try { + IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); + + client.deleteIntent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockAgents.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockAgents.java new file mode 100644 index 000000000..740ffe3e5 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockAgents.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.dialogflow.cx.v3beta1; + +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 MockAgents implements MockGrpcService { + private final MockAgentsImpl serviceImpl; + + public MockAgents() { + serviceImpl = new MockAgentsImpl(); + } + + @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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockAgentsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockAgentsImpl.java new file mode 100644 index 000000000..e500b3ac8 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockAgentsImpl.java @@ -0,0 +1,160 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.dialogflow.cx.v3beta1.AgentsGrpc.AgentsImplBase; +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 MockAgentsImpl extends AgentsImplBase { + private List requests; + private Queue responses; + + public MockAgentsImpl() { + 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 listAgents( + ListAgentsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListAgentsResponse) { + requests.add(request); + responseObserver.onNext((ListAgentsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getAgent(GetAgentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Agent) { + requests.add(request); + responseObserver.onNext((Agent) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createAgent(CreateAgentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Agent) { + requests.add(request); + responseObserver.onNext((Agent) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateAgent(UpdateAgentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Agent) { + requests.add(request); + responseObserver.onNext((Agent) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteAgent(DeleteAgentRequest 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 exportAgent(ExportAgentRequest 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 restoreAgent( + RestoreAgentRequest 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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEntityTypes.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEntityTypes.java new file mode 100644 index 000000000..a326826ab --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEntityTypes.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.dialogflow.cx.v3beta1; + +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 MockEntityTypes implements MockGrpcService { + private final MockEntityTypesImpl serviceImpl; + + public MockEntityTypes() { + serviceImpl = new MockEntityTypesImpl(); + } + + @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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEntityTypesImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEntityTypesImpl.java new file mode 100644 index 000000000..6fddd9790 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEntityTypesImpl.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.dialogflow.cx.v3beta1.EntityTypesGrpc.EntityTypesImplBase; +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 MockEntityTypesImpl extends EntityTypesImplBase { + private List requests; + private Queue responses; + + public MockEntityTypesImpl() { + 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 listEntityTypes( + ListEntityTypesRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListEntityTypesResponse) { + requests.add(request); + responseObserver.onNext((ListEntityTypesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getEntityType( + GetEntityTypeRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof EntityType) { + requests.add(request); + responseObserver.onNext((EntityType) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createEntityType( + CreateEntityTypeRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof EntityType) { + requests.add(request); + responseObserver.onNext((EntityType) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateEntityType( + UpdateEntityTypeRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof EntityType) { + requests.add(request); + responseObserver.onNext((EntityType) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteEntityType( + DeleteEntityTypeRequest 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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEnvironments.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEnvironments.java new file mode 100644 index 000000000..5c5888ec7 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEnvironments.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.dialogflow.cx.v3beta1; + +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 MockEnvironments implements MockGrpcService { + private final MockEnvironmentsImpl serviceImpl; + + public MockEnvironments() { + serviceImpl = new MockEnvironmentsImpl(); + } + + @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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEnvironmentsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEnvironmentsImpl.java new file mode 100644 index 000000000..2eb17cdd5 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEnvironmentsImpl.java @@ -0,0 +1,151 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsGrpc.EnvironmentsImplBase; +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 MockEnvironmentsImpl extends EnvironmentsImplBase { + private List requests; + private Queue responses; + + public MockEnvironmentsImpl() { + 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 listEnvironments( + ListEnvironmentsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListEnvironmentsResponse) { + requests.add(request); + responseObserver.onNext((ListEnvironmentsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getEnvironment( + GetEnvironmentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Environment) { + requests.add(request); + responseObserver.onNext((Environment) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createEnvironment( + CreateEnvironmentRequest 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 updateEnvironment( + UpdateEnvironmentRequest 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 deleteEnvironment( + DeleteEnvironmentRequest 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 lookupEnvironmentHistory( + LookupEnvironmentHistoryRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof LookupEnvironmentHistoryResponse) { + requests.add(request); + responseObserver.onNext((LookupEnvironmentHistoryResponse) 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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockFlows.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockFlows.java new file mode 100644 index 000000000..01fed1242 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockFlows.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.dialogflow.cx.v3beta1; + +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 MockFlows implements MockGrpcService { + private final MockFlowsImpl serviceImpl; + + public MockFlows() { + serviceImpl = new MockFlowsImpl(); + } + + @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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockFlowsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockFlowsImpl.java new file mode 100644 index 000000000..5f81de1df --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockFlowsImpl.java @@ -0,0 +1,145 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.dialogflow.cx.v3beta1.FlowsGrpc.FlowsImplBase; +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 MockFlowsImpl extends FlowsImplBase { + private List requests; + private Queue responses; + + public MockFlowsImpl() { + 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 createFlow(CreateFlowRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Flow) { + requests.add(request); + responseObserver.onNext((Flow) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteFlow(DeleteFlowRequest 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 listFlows( + ListFlowsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListFlowsResponse) { + requests.add(request); + responseObserver.onNext((ListFlowsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getFlow(GetFlowRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Flow) { + requests.add(request); + responseObserver.onNext((Flow) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateFlow(UpdateFlowRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Flow) { + requests.add(request); + responseObserver.onNext((Flow) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void trainFlow(TrainFlowRequest 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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockIntents.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockIntents.java new file mode 100644 index 000000000..67297127e --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockIntents.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.dialogflow.cx.v3beta1; + +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 MockIntents implements MockGrpcService { + private final MockIntentsImpl serviceImpl; + + public MockIntents() { + serviceImpl = new MockIntentsImpl(); + } + + @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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockIntentsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockIntentsImpl.java new file mode 100644 index 000000000..d51edbb92 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockIntentsImpl.java @@ -0,0 +1,130 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.dialogflow.cx.v3beta1.IntentsGrpc.IntentsImplBase; +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 MockIntentsImpl extends IntentsImplBase { + private List requests; + private Queue responses; + + public MockIntentsImpl() { + 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 listIntents( + ListIntentsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListIntentsResponse) { + requests.add(request); + responseObserver.onNext((ListIntentsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getIntent(GetIntentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Intent) { + requests.add(request); + responseObserver.onNext((Intent) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createIntent(CreateIntentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Intent) { + requests.add(request); + responseObserver.onNext((Intent) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateIntent(UpdateIntentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Intent) { + requests.add(request); + responseObserver.onNext((Intent) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteIntent(DeleteIntentRequest 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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockPages.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockPages.java new file mode 100644 index 000000000..76faba3d6 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockPages.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.dialogflow.cx.v3beta1; + +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 MockPages implements MockGrpcService { + private final MockPagesImpl serviceImpl; + + public MockPages() { + serviceImpl = new MockPagesImpl(); + } + + @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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockPagesImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockPagesImpl.java new file mode 100644 index 000000000..13b734fb2 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockPagesImpl.java @@ -0,0 +1,130 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.dialogflow.cx.v3beta1.PagesGrpc.PagesImplBase; +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 MockPagesImpl extends PagesImplBase { + private List requests; + private Queue responses; + + public MockPagesImpl() { + 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 listPages( + ListPagesRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListPagesResponse) { + requests.add(request); + responseObserver.onNext((ListPagesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getPage(GetPageRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Page) { + requests.add(request); + responseObserver.onNext((Page) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createPage(CreatePageRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Page) { + requests.add(request); + responseObserver.onNext((Page) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updatePage(UpdatePageRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Page) { + requests.add(request); + responseObserver.onNext((Page) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deletePage(DeletePageRequest 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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionEntityTypes.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionEntityTypes.java new file mode 100644 index 000000000..aaa494d90 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionEntityTypes.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.dialogflow.cx.v3beta1; + +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 MockSessionEntityTypes implements MockGrpcService { + private final MockSessionEntityTypesImpl serviceImpl; + + public MockSessionEntityTypes() { + serviceImpl = new MockSessionEntityTypesImpl(); + } + + @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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionEntityTypesImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionEntityTypesImpl.java new file mode 100644 index 000000000..8745b9ab4 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionEntityTypesImpl.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.dialogflow.cx.v3beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypesGrpc.SessionEntityTypesImplBase; +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 MockSessionEntityTypesImpl extends SessionEntityTypesImplBase { + private List requests; + private Queue responses; + + public MockSessionEntityTypesImpl() { + 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 listSessionEntityTypes( + ListSessionEntityTypesRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListSessionEntityTypesResponse) { + requests.add(request); + responseObserver.onNext((ListSessionEntityTypesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getSessionEntityType( + GetSessionEntityTypeRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof SessionEntityType) { + requests.add(request); + responseObserver.onNext((SessionEntityType) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createSessionEntityType( + CreateSessionEntityTypeRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof SessionEntityType) { + requests.add(request); + responseObserver.onNext((SessionEntityType) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateSessionEntityType( + UpdateSessionEntityTypeRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof SessionEntityType) { + requests.add(request); + responseObserver.onNext((SessionEntityType) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteSessionEntityType( + DeleteSessionEntityTypeRequest 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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessions.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessions.java new file mode 100644 index 000000000..3e1f1fe67 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessions.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.dialogflow.cx.v3beta1; + +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 MockSessions implements MockGrpcService { + private final MockSessionsImpl serviceImpl; + + public MockSessions() { + serviceImpl = new MockSessionsImpl(); + } + + @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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionsImpl.java new file mode 100644 index 000000000..da8b721ff --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionsImpl.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.dialogflow.cx.v3beta1.SessionsGrpc.SessionsImplBase; +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 MockSessionsImpl extends SessionsImplBase { + private List requests; + private Queue responses; + + public MockSessionsImpl() { + 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 detectIntent( + DetectIntentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof DetectIntentResponse) { + requests.add(request); + responseObserver.onNext((DetectIntentResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public StreamObserver streamingDetectIntent( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(StreamingDetectIntentRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof StreamingDetectIntentResponse) { + responseObserver.onNext((StreamingDetectIntentResponse) response); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public void matchIntent( + MatchIntentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof MatchIntentResponse) { + requests.add(request); + responseObserver.onNext((MatchIntentResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void fulfillIntent( + FulfillIntentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof FulfillIntentResponse) { + requests.add(request); + responseObserver.onNext((FulfillIntentResponse) 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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockTransitionRouteGroups.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockTransitionRouteGroups.java new file mode 100644 index 000000000..c0e8f6d5b --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockTransitionRouteGroups.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.dialogflow.cx.v3beta1; + +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 MockTransitionRouteGroups implements MockGrpcService { + private final MockTransitionRouteGroupsImpl serviceImpl; + + public MockTransitionRouteGroups() { + serviceImpl = new MockTransitionRouteGroupsImpl(); + } + + @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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockTransitionRouteGroupsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockTransitionRouteGroupsImpl.java new file mode 100644 index 000000000..51e9944a0 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockTransitionRouteGroupsImpl.java @@ -0,0 +1,138 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsGrpc.TransitionRouteGroupsImplBase; +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 MockTransitionRouteGroupsImpl extends TransitionRouteGroupsImplBase { + private List requests; + private Queue responses; + + public MockTransitionRouteGroupsImpl() { + 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 listTransitionRouteGroups( + ListTransitionRouteGroupsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListTransitionRouteGroupsResponse) { + requests.add(request); + responseObserver.onNext((ListTransitionRouteGroupsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getTransitionRouteGroup( + GetTransitionRouteGroupRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof TransitionRouteGroup) { + requests.add(request); + responseObserver.onNext((TransitionRouteGroup) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createTransitionRouteGroup( + CreateTransitionRouteGroupRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof TransitionRouteGroup) { + requests.add(request); + responseObserver.onNext((TransitionRouteGroup) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateTransitionRouteGroup( + UpdateTransitionRouteGroupRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof TransitionRouteGroup) { + requests.add(request); + responseObserver.onNext((TransitionRouteGroup) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteTransitionRouteGroup( + DeleteTransitionRouteGroupRequest 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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockVersions.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockVersions.java new file mode 100644 index 000000000..0eda34bfe --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockVersions.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.dialogflow.cx.v3beta1; + +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 MockVersions implements MockGrpcService { + private final MockVersionsImpl serviceImpl; + + public MockVersions() { + serviceImpl = new MockVersionsImpl(); + } + + @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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockVersionsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockVersionsImpl.java new file mode 100644 index 000000000..e8662d51b --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockVersionsImpl.java @@ -0,0 +1,147 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.dialogflow.cx.v3beta1.VersionsGrpc.VersionsImplBase; +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 MockVersionsImpl extends VersionsImplBase { + private List requests; + private Queue responses; + + public MockVersionsImpl() { + 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 listVersions( + ListVersionsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListVersionsResponse) { + requests.add(request); + responseObserver.onNext((ListVersionsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getVersion(GetVersionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Version) { + requests.add(request); + responseObserver.onNext((Version) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createVersion( + CreateVersionRequest 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 updateVersion( + UpdateVersionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Version) { + requests.add(request); + responseObserver.onNext((Version) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteVersion(DeleteVersionRequest 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 loadVersion(LoadVersionRequest 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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockWebhooks.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockWebhooks.java new file mode 100644 index 000000000..08ac7c1a2 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockWebhooks.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.dialogflow.cx.v3beta1; + +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 MockWebhooks implements MockGrpcService { + private final MockWebhooksImpl serviceImpl; + + public MockWebhooks() { + serviceImpl = new MockWebhooksImpl(); + } + + @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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockWebhooksImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockWebhooksImpl.java new file mode 100644 index 000000000..2b8cb77e8 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockWebhooksImpl.java @@ -0,0 +1,132 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.dialogflow.cx.v3beta1.WebhooksGrpc.WebhooksImplBase; +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 MockWebhooksImpl extends WebhooksImplBase { + private List requests; + private Queue responses; + + public MockWebhooksImpl() { + 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 listWebhooks( + ListWebhooksRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListWebhooksResponse) { + requests.add(request); + responseObserver.onNext((ListWebhooksResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getWebhook(GetWebhookRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Webhook) { + requests.add(request); + responseObserver.onNext((Webhook) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createWebhook( + CreateWebhookRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Webhook) { + requests.add(request); + responseObserver.onNext((Webhook) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateWebhook( + UpdateWebhookRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Webhook) { + requests.add(request); + responseObserver.onNext((Webhook) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteWebhook(DeleteWebhookRequest 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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClientTest.java new file mode 100644 index 000000000..af86c613a --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClientTest.java @@ -0,0 +1,324 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.PagesClient.ListPagesPagedResponse; + +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 com.google.protobuf.FieldMask; +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 PagesClientTest { + private static MockPages mockPages; + private static MockFlows mockFlows; + private static MockAgents mockAgents; + private static MockEntityTypes mockEntityTypes; + private static MockEnvironments mockEnvironments; + private static MockIntents mockIntents; + private static MockSessionEntityTypes mockSessionEntityTypes; + private static MockSessions mockSessions; + private static MockTransitionRouteGroups mockTransitionRouteGroups; + private static MockVersions mockVersions; + private static MockWebhooks mockWebhooks; + private static MockServiceHelper serviceHelper; + private PagesClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockPages = new MockPages(); + mockFlows = new MockFlows(); + mockAgents = new MockAgents(); + mockEntityTypes = new MockEntityTypes(); + mockEnvironments = new MockEnvironments(); + mockIntents = new MockIntents(); + mockSessionEntityTypes = new MockSessionEntityTypes(); + mockSessions = new MockSessions(); + mockTransitionRouteGroups = new MockTransitionRouteGroups(); + mockVersions = new MockVersions(); + mockWebhooks = new MockWebhooks(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockPages, + mockFlows, + mockAgents, + mockEntityTypes, + mockEnvironments, + mockIntents, + mockSessionEntityTypes, + mockSessions, + mockTransitionRouteGroups, + mockVersions, + mockWebhooks)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + PagesSettings settings = + PagesSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = PagesClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listPagesTest() { + String nextPageToken = ""; + Page pagesElement = Page.newBuilder().build(); + List pages = Arrays.asList(pagesElement); + ListPagesResponse expectedResponse = + ListPagesResponse.newBuilder().setNextPageToken(nextPageToken).addAllPages(pages).build(); + mockPages.addResponse(expectedResponse); + + FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + + ListPagesPagedResponse pagedListResponse = client.listPages(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPagesList().get(0), resources.get(0)); + + List actualRequests = mockPages.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPagesRequest actualRequest = (ListPagesRequest) actualRequests.get(0); + + Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listPagesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockPages.addException(exception); + + try { + FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + + client.listPages(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getPageTest() { + PageName name2 = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); + String displayName = "displayName1615086568"; + Page expectedResponse = + Page.newBuilder().setName(name2.toString()).setDisplayName(displayName).build(); + mockPages.addResponse(expectedResponse); + + PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); + + Page actualResponse = client.getPage(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPages.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPageRequest actualRequest = (GetPageRequest) actualRequests.get(0); + + Assert.assertEquals(name, PageName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getPageExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockPages.addException(exception); + + try { + PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); + + client.getPage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createPageTest() { + PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); + String displayName = "displayName1615086568"; + Page expectedResponse = + Page.newBuilder().setName(name.toString()).setDisplayName(displayName).build(); + mockPages.addResponse(expectedResponse); + + FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + Page page = Page.newBuilder().build(); + + Page actualResponse = client.createPage(parent, page); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPages.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePageRequest actualRequest = (CreatePageRequest) actualRequests.get(0); + + Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(page, actualRequest.getPage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createPageExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockPages.addException(exception); + + try { + FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + Page page = Page.newBuilder().build(); + + client.createPage(parent, page); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updatePageTest() { + PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); + String displayName = "displayName1615086568"; + Page expectedResponse = + Page.newBuilder().setName(name.toString()).setDisplayName(displayName).build(); + mockPages.addResponse(expectedResponse); + + Page page = Page.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Page actualResponse = client.updatePage(page, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPages.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdatePageRequest actualRequest = (UpdatePageRequest) actualRequests.get(0); + + Assert.assertEquals(page, actualRequest.getPage()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updatePageExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockPages.addException(exception); + + try { + Page page = Page.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updatePage(page, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deletePageTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockPages.addResponse(expectedResponse); + + PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); + + client.deletePage(name); + + List actualRequests = mockPages.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePageRequest actualRequest = (DeletePageRequest) actualRequests.get(0); + + Assert.assertEquals(name, PageName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deletePageExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockPages.addException(exception); + + try { + PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); + + client.deletePage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClientTest.java new file mode 100644 index 000000000..c08705f0a --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClientTest.java @@ -0,0 +1,351 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; + +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 com.google.protobuf.FieldMask; +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 SessionEntityTypesClientTest { + private static MockPages mockPages; + private static MockFlows mockFlows; + private static MockAgents mockAgents; + private static MockEntityTypes mockEntityTypes; + private static MockEnvironments mockEnvironments; + private static MockIntents mockIntents; + private static MockSessionEntityTypes mockSessionEntityTypes; + private static MockSessions mockSessions; + private static MockTransitionRouteGroups mockTransitionRouteGroups; + private static MockVersions mockVersions; + private static MockWebhooks mockWebhooks; + private static MockServiceHelper serviceHelper; + private SessionEntityTypesClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockPages = new MockPages(); + mockFlows = new MockFlows(); + mockAgents = new MockAgents(); + mockEntityTypes = new MockEntityTypes(); + mockEnvironments = new MockEnvironments(); + mockIntents = new MockIntents(); + mockSessionEntityTypes = new MockSessionEntityTypes(); + mockSessions = new MockSessions(); + mockTransitionRouteGroups = new MockTransitionRouteGroups(); + mockVersions = new MockVersions(); + mockWebhooks = new MockWebhooks(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockPages, + mockFlows, + mockAgents, + mockEntityTypes, + mockEnvironments, + mockIntents, + mockSessionEntityTypes, + mockSessions, + mockTransitionRouteGroups, + mockVersions, + mockWebhooks)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + SessionEntityTypesSettings settings = + SessionEntityTypesSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SessionEntityTypesClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listSessionEntityTypesTest() { + String nextPageToken = ""; + SessionEntityType sessionEntityTypesElement = SessionEntityType.newBuilder().build(); + List sessionEntityTypes = Arrays.asList(sessionEntityTypesElement); + ListSessionEntityTypesResponse expectedResponse = + ListSessionEntityTypesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllSessionEntityTypes(sessionEntityTypes) + .build(); + mockSessionEntityTypes.addResponse(expectedResponse); + + SessionName parent = + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); + + ListSessionEntityTypesPagedResponse pagedListResponse = client.listSessionEntityTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionEntityTypesList().get(0), resources.get(0)); + + List actualRequests = mockSessionEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSessionEntityTypesRequest actualRequest = + (ListSessionEntityTypesRequest) actualRequests.get(0); + + Assert.assertEquals(parent, SessionName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listSessionEntityTypesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSessionEntityTypes.addException(exception); + + try { + SessionName parent = + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); + + client.listSessionEntityTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getSessionEntityTypeTest() { + SessionEntityTypeName name2 = + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + SessionEntityType expectedResponse = + SessionEntityType.newBuilder().setName(name2.toString()).build(); + mockSessionEntityTypes.addResponse(expectedResponse); + + SessionEntityTypeName name = + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + + SessionEntityType actualResponse = client.getSessionEntityType(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessionEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSessionEntityTypeRequest actualRequest = (GetSessionEntityTypeRequest) actualRequests.get(0); + + Assert.assertEquals(name, SessionEntityTypeName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getSessionEntityTypeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSessionEntityTypes.addException(exception); + + try { + SessionEntityTypeName name = + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + + client.getSessionEntityType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createSessionEntityTypeTest() { + SessionEntityTypeName name = + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + SessionEntityType expectedResponse = + SessionEntityType.newBuilder().setName(name.toString()).build(); + mockSessionEntityTypes.addResponse(expectedResponse); + + SessionName parent = + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); + SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); + + SessionEntityType actualResponse = client.createSessionEntityType(parent, sessionEntityType); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessionEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSessionEntityTypeRequest actualRequest = + (CreateSessionEntityTypeRequest) actualRequests.get(0); + + Assert.assertEquals(parent, SessionName.parse(actualRequest.getParent())); + Assert.assertEquals(sessionEntityType, actualRequest.getSessionEntityType()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createSessionEntityTypeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSessionEntityTypes.addException(exception); + + try { + SessionName parent = + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); + SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); + + client.createSessionEntityType(parent, sessionEntityType); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateSessionEntityTypeTest() { + SessionEntityTypeName name = + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + SessionEntityType expectedResponse = + SessionEntityType.newBuilder().setName(name.toString()).build(); + mockSessionEntityTypes.addResponse(expectedResponse); + + SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + SessionEntityType actualResponse = + client.updateSessionEntityType(sessionEntityType, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessionEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSessionEntityTypeRequest actualRequest = + (UpdateSessionEntityTypeRequest) actualRequests.get(0); + + Assert.assertEquals(sessionEntityType, actualRequest.getSessionEntityType()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateSessionEntityTypeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSessionEntityTypes.addException(exception); + + try { + SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateSessionEntityType(sessionEntityType, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteSessionEntityTypeTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockSessionEntityTypes.addResponse(expectedResponse); + + SessionEntityTypeName name = + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + + client.deleteSessionEntityType(name); + + List actualRequests = mockSessionEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSessionEntityTypeRequest actualRequest = + (DeleteSessionEntityTypeRequest) actualRequests.get(0); + + Assert.assertEquals(name, SessionEntityTypeName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteSessionEntityTypeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSessionEntityTypes.addException(exception); + + try { + SessionEntityTypeName name = + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + + client.deleteSessionEntityType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClientTest.java new file mode 100644 index 000000000..b50df1371 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClientTest.java @@ -0,0 +1,327 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.protobuf.AbstractMessage; +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 SessionsClientTest { + private static MockPages mockPages; + private static MockFlows mockFlows; + private static MockAgents mockAgents; + private static MockEntityTypes mockEntityTypes; + private static MockEnvironments mockEnvironments; + private static MockIntents mockIntents; + private static MockSessionEntityTypes mockSessionEntityTypes; + private static MockSessions mockSessions; + private static MockTransitionRouteGroups mockTransitionRouteGroups; + private static MockVersions mockVersions; + private static MockWebhooks mockWebhooks; + private static MockServiceHelper serviceHelper; + private SessionsClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockPages = new MockPages(); + mockFlows = new MockFlows(); + mockAgents = new MockAgents(); + mockEntityTypes = new MockEntityTypes(); + mockEnvironments = new MockEnvironments(); + mockIntents = new MockIntents(); + mockSessionEntityTypes = new MockSessionEntityTypes(); + mockSessions = new MockSessions(); + mockTransitionRouteGroups = new MockTransitionRouteGroups(); + mockVersions = new MockVersions(); + mockWebhooks = new MockWebhooks(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockPages, + mockFlows, + mockAgents, + mockEntityTypes, + mockEnvironments, + mockIntents, + mockSessionEntityTypes, + mockSessions, + mockTransitionRouteGroups, + mockVersions, + mockWebhooks)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + SessionsSettings settings = + SessionsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SessionsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void detectIntentTest() { + String responseId = "responseId1847552473"; + ByteString outputAudio = ByteString.copyFromUtf8("24"); + DetectIntentResponse expectedResponse = + DetectIntentResponse.newBuilder() + .setResponseId(responseId) + .setOutputAudio(outputAudio) + .build(); + mockSessions.addResponse(expectedResponse); + + SessionName session = + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); + QueryInput queryInput = QueryInput.newBuilder().build(); + DetectIntentRequest request = + DetectIntentRequest.newBuilder() + .setSession(session.toString()) + .setQueryInput(queryInput) + .build(); + + DetectIntentResponse actualResponse = client.detectIntent(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DetectIntentRequest actualRequest = (DetectIntentRequest) actualRequests.get(0); + + Assert.assertEquals(session, SessionName.parse(actualRequest.getSession())); + Assert.assertEquals(queryInput, actualRequest.getQueryInput()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void detectIntentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSessions.addException(exception); + + try { + SessionName session = + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); + QueryInput queryInput = QueryInput.newBuilder().build(); + DetectIntentRequest request = + DetectIntentRequest.newBuilder() + .setSession(session.toString()) + .setQueryInput(queryInput) + .build(); + + client.detectIntent(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void streamingDetectIntentTest() throws Exception { + StreamingDetectIntentResponse expectedResponse = + StreamingDetectIntentResponse.newBuilder().build(); + mockSessions.addResponse(expectedResponse); + QueryInput queryInput = QueryInput.newBuilder().build(); + StreamingDetectIntentRequest request = + StreamingDetectIntentRequest.newBuilder().setQueryInput(queryInput).build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.streamingDetectIntentCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + @SuppressWarnings("all") + public void streamingDetectIntentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSessions.addException(exception); + QueryInput queryInput = QueryInput.newBuilder().build(); + StreamingDetectIntentRequest request = + StreamingDetectIntentRequest.newBuilder().setQueryInput(queryInput).build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.streamingDetectIntentCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void matchIntentTest() { + String text = "text3556653"; + MatchIntentResponse expectedResponse = MatchIntentResponse.newBuilder().setText(text).build(); + mockSessions.addResponse(expectedResponse); + + SessionName session = + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); + QueryInput queryInput = QueryInput.newBuilder().build(); + MatchIntentRequest request = + MatchIntentRequest.newBuilder() + .setSession(session.toString()) + .setQueryInput(queryInput) + .build(); + + MatchIntentResponse actualResponse = client.matchIntent(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MatchIntentRequest actualRequest = (MatchIntentRequest) actualRequests.get(0); + + Assert.assertEquals(session, SessionName.parse(actualRequest.getSession())); + Assert.assertEquals(queryInput, actualRequest.getQueryInput()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void matchIntentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSessions.addException(exception); + + try { + SessionName session = + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); + QueryInput queryInput = QueryInput.newBuilder().build(); + MatchIntentRequest request = + MatchIntentRequest.newBuilder() + .setSession(session.toString()) + .setQueryInput(queryInput) + .build(); + + client.matchIntent(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void fulfillIntentTest() { + String responseId = "responseId1847552473"; + ByteString outputAudio = ByteString.copyFromUtf8("24"); + FulfillIntentResponse expectedResponse = + FulfillIntentResponse.newBuilder() + .setResponseId(responseId) + .setOutputAudio(outputAudio) + .build(); + mockSessions.addResponse(expectedResponse); + + FulfillIntentRequest request = FulfillIntentRequest.newBuilder().build(); + + FulfillIntentResponse actualResponse = client.fulfillIntent(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FulfillIntentRequest actualRequest = (FulfillIntentRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void fulfillIntentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSessions.addException(exception); + + try { + FulfillIntentRequest request = FulfillIntentRequest.newBuilder().build(); + + client.fulfillIntent(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClientTest.java new file mode 100644 index 000000000..ae3224fde --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClientTest.java @@ -0,0 +1,358 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; + +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 com.google.protobuf.FieldMask; +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 TransitionRouteGroupsClientTest { + private static MockPages mockPages; + private static MockFlows mockFlows; + private static MockAgents mockAgents; + private static MockEntityTypes mockEntityTypes; + private static MockEnvironments mockEnvironments; + private static MockIntents mockIntents; + private static MockSessionEntityTypes mockSessionEntityTypes; + private static MockSessions mockSessions; + private static MockTransitionRouteGroups mockTransitionRouteGroups; + private static MockVersions mockVersions; + private static MockWebhooks mockWebhooks; + private static MockServiceHelper serviceHelper; + private TransitionRouteGroupsClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockPages = new MockPages(); + mockFlows = new MockFlows(); + mockAgents = new MockAgents(); + mockEntityTypes = new MockEntityTypes(); + mockEnvironments = new MockEnvironments(); + mockIntents = new MockIntents(); + mockSessionEntityTypes = new MockSessionEntityTypes(); + mockSessions = new MockSessions(); + mockTransitionRouteGroups = new MockTransitionRouteGroups(); + mockVersions = new MockVersions(); + mockWebhooks = new MockWebhooks(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockPages, + mockFlows, + mockAgents, + mockEntityTypes, + mockEnvironments, + mockIntents, + mockSessionEntityTypes, + mockSessions, + mockTransitionRouteGroups, + mockVersions, + mockWebhooks)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + TransitionRouteGroupsSettings settings = + TransitionRouteGroupsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TransitionRouteGroupsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listTransitionRouteGroupsTest() { + String nextPageToken = ""; + TransitionRouteGroup transitionRouteGroupsElement = TransitionRouteGroup.newBuilder().build(); + List transitionRouteGroups = Arrays.asList(transitionRouteGroupsElement); + ListTransitionRouteGroupsResponse expectedResponse = + ListTransitionRouteGroupsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllTransitionRouteGroups(transitionRouteGroups) + .build(); + mockTransitionRouteGroups.addResponse(expectedResponse); + + FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + + ListTransitionRouteGroupsPagedResponse pagedListResponse = + client.listTransitionRouteGroups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTransitionRouteGroupsList().get(0), resources.get(0)); + + List actualRequests = mockTransitionRouteGroups.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTransitionRouteGroupsRequest actualRequest = + (ListTransitionRouteGroupsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listTransitionRouteGroupsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockTransitionRouteGroups.addException(exception); + + try { + FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + + client.listTransitionRouteGroups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getTransitionRouteGroupTest() { + TransitionRouteGroupName name2 = + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); + String displayName = "displayName1615086568"; + TransitionRouteGroup expectedResponse = + TransitionRouteGroup.newBuilder() + .setName(name2.toString()) + .setDisplayName(displayName) + .build(); + mockTransitionRouteGroups.addResponse(expectedResponse); + + TransitionRouteGroupName name = + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); + + TransitionRouteGroup actualResponse = client.getTransitionRouteGroup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTransitionRouteGroups.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTransitionRouteGroupRequest actualRequest = + (GetTransitionRouteGroupRequest) actualRequests.get(0); + + Assert.assertEquals(name, TransitionRouteGroupName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getTransitionRouteGroupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockTransitionRouteGroups.addException(exception); + + try { + TransitionRouteGroupName name = + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); + + client.getTransitionRouteGroup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createTransitionRouteGroupTest() { + TransitionRouteGroupName name = + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); + String displayName = "displayName1615086568"; + TransitionRouteGroup expectedResponse = + TransitionRouteGroup.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .build(); + mockTransitionRouteGroups.addResponse(expectedResponse); + + FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build(); + + TransitionRouteGroup actualResponse = + client.createTransitionRouteGroup(parent, transitionRouteGroup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTransitionRouteGroups.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateTransitionRouteGroupRequest actualRequest = + (CreateTransitionRouteGroupRequest) actualRequests.get(0); + + Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(transitionRouteGroup, actualRequest.getTransitionRouteGroup()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createTransitionRouteGroupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockTransitionRouteGroups.addException(exception); + + try { + FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build(); + + client.createTransitionRouteGroup(parent, transitionRouteGroup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateTransitionRouteGroupTest() { + TransitionRouteGroupName name = + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); + String displayName = "displayName1615086568"; + TransitionRouteGroup expectedResponse = + TransitionRouteGroup.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .build(); + mockTransitionRouteGroups.addResponse(expectedResponse); + + TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + TransitionRouteGroup actualResponse = + client.updateTransitionRouteGroup(transitionRouteGroup, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTransitionRouteGroups.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateTransitionRouteGroupRequest actualRequest = + (UpdateTransitionRouteGroupRequest) actualRequests.get(0); + + Assert.assertEquals(transitionRouteGroup, actualRequest.getTransitionRouteGroup()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateTransitionRouteGroupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockTransitionRouteGroups.addException(exception); + + try { + TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateTransitionRouteGroup(transitionRouteGroup, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteTransitionRouteGroupTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockTransitionRouteGroups.addResponse(expectedResponse); + + TransitionRouteGroupName name = + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); + + client.deleteTransitionRouteGroup(name); + + List actualRequests = mockTransitionRouteGroups.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTransitionRouteGroupRequest actualRequest = + (DeleteTransitionRouteGroupRequest) actualRequests.get(0); + + Assert.assertEquals(name, TransitionRouteGroupName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteTransitionRouteGroupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockTransitionRouteGroups.addException(exception); + + try { + TransitionRouteGroupName name = + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); + + client.deleteTransitionRouteGroup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClientTest.java new file mode 100644 index 000000000..46f74f9cc --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClientTest.java @@ -0,0 +1,403 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.VersionsClient.ListVersionsPagedResponse; + +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 com.google.protobuf.FieldMask; +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 VersionsClientTest { + private static MockPages mockPages; + private static MockFlows mockFlows; + private static MockAgents mockAgents; + private static MockEntityTypes mockEntityTypes; + private static MockEnvironments mockEnvironments; + private static MockIntents mockIntents; + private static MockSessionEntityTypes mockSessionEntityTypes; + private static MockSessions mockSessions; + private static MockTransitionRouteGroups mockTransitionRouteGroups; + private static MockVersions mockVersions; + private static MockWebhooks mockWebhooks; + private static MockServiceHelper serviceHelper; + private VersionsClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockPages = new MockPages(); + mockFlows = new MockFlows(); + mockAgents = new MockAgents(); + mockEntityTypes = new MockEntityTypes(); + mockEnvironments = new MockEnvironments(); + mockIntents = new MockIntents(); + mockSessionEntityTypes = new MockSessionEntityTypes(); + mockSessions = new MockSessions(); + mockTransitionRouteGroups = new MockTransitionRouteGroups(); + mockVersions = new MockVersions(); + mockWebhooks = new MockWebhooks(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockPages, + mockFlows, + mockAgents, + mockEntityTypes, + mockEnvironments, + mockIntents, + mockSessionEntityTypes, + mockSessions, + mockTransitionRouteGroups, + mockVersions, + mockWebhooks)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + VersionsSettings settings = + VersionsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = VersionsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listVersionsTest() { + String nextPageToken = ""; + Version versionsElement = Version.newBuilder().build(); + List versions = Arrays.asList(versionsElement); + ListVersionsResponse expectedResponse = + ListVersionsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllVersions(versions) + .build(); + mockVersions.addResponse(expectedResponse); + + FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + + ListVersionsPagedResponse pagedListResponse = client.listVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getVersionsList().get(0), resources.get(0)); + + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListVersionsRequest actualRequest = (ListVersionsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listVersionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + + client.listVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getVersionTest() { + VersionName name2 = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Version expectedResponse = + Version.newBuilder() + .setName(name2.toString()) + .setDisplayName(displayName) + .setDescription(description) + .build(); + mockVersions.addResponse(expectedResponse); + + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + + Version actualResponse = client.getVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetVersionRequest actualRequest = (GetVersionRequest) actualRequests.get(0); + + Assert.assertEquals(name, VersionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + VersionName name = + VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + + client.getVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createVersionTest() throws Exception { + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Version expectedResponse = + Version.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setDescription(description) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockVersions.addResponse(resultOperation); + + FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + Version version = Version.newBuilder().build(); + + Version actualResponse = client.createVersionAsync(parent, version).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateVersionRequest actualRequest = (CreateVersionRequest) actualRequests.get(0); + + Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(version, actualRequest.getVersion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + Version version = Version.newBuilder().build(); + + client.createVersionAsync(parent, version).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 updateVersionTest() { + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Version expectedResponse = + Version.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setDescription(description) + .build(); + mockVersions.addResponse(expectedResponse); + + Version version = Version.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Version actualResponse = client.updateVersion(version, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateVersionRequest actualRequest = (UpdateVersionRequest) actualRequests.get(0); + + Assert.assertEquals(version, actualRequest.getVersion()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + Version version = Version.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateVersion(version, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteVersionTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockVersions.addResponse(expectedResponse); + + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + + client.deleteVersion(name); + + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteVersionRequest actualRequest = (DeleteVersionRequest) actualRequests.get(0); + + Assert.assertEquals(name, VersionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + VersionName name = + VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + + client.deleteVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void loadVersionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("loadVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockVersions.addResponse(resultOperation); + + VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + + Empty actualResponse = client.loadVersionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LoadVersionRequest actualRequest = (LoadVersionRequest) actualRequests.get(0); + + Assert.assertEquals(name, VersionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void loadVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + VersionName name = + VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + + client.loadVersionAsync(name).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-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClientTest.java new file mode 100644 index 000000000..23110d933 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClientTest.java @@ -0,0 +1,342 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static com.google.cloud.dialogflow.cx.v3beta1.WebhooksClient.ListWebhooksPagedResponse; + +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 com.google.protobuf.FieldMask; +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 WebhooksClientTest { + private static MockPages mockPages; + private static MockFlows mockFlows; + private static MockAgents mockAgents; + private static MockEntityTypes mockEntityTypes; + private static MockEnvironments mockEnvironments; + private static MockIntents mockIntents; + private static MockSessionEntityTypes mockSessionEntityTypes; + private static MockSessions mockSessions; + private static MockTransitionRouteGroups mockTransitionRouteGroups; + private static MockVersions mockVersions; + private static MockWebhooks mockWebhooks; + private static MockServiceHelper serviceHelper; + private WebhooksClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockPages = new MockPages(); + mockFlows = new MockFlows(); + mockAgents = new MockAgents(); + mockEntityTypes = new MockEntityTypes(); + mockEnvironments = new MockEnvironments(); + mockIntents = new MockIntents(); + mockSessionEntityTypes = new MockSessionEntityTypes(); + mockSessions = new MockSessions(); + mockTransitionRouteGroups = new MockTransitionRouteGroups(); + mockVersions = new MockVersions(); + mockWebhooks = new MockWebhooks(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockPages, + mockFlows, + mockAgents, + mockEntityTypes, + mockEnvironments, + mockIntents, + mockSessionEntityTypes, + mockSessions, + mockTransitionRouteGroups, + mockVersions, + mockWebhooks)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + WebhooksSettings settings = + WebhooksSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = WebhooksClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listWebhooksTest() { + String nextPageToken = ""; + Webhook webhooksElement = Webhook.newBuilder().build(); + List webhooks = Arrays.asList(webhooksElement); + ListWebhooksResponse expectedResponse = + ListWebhooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllWebhooks(webhooks) + .build(); + mockWebhooks.addResponse(expectedResponse); + + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + + ListWebhooksPagedResponse pagedListResponse = client.listWebhooks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWebhooksList().get(0), resources.get(0)); + + List actualRequests = mockWebhooks.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWebhooksRequest actualRequest = (ListWebhooksRequest) actualRequests.get(0); + + Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listWebhooksExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebhooks.addException(exception); + + try { + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + + client.listWebhooks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getWebhookTest() { + WebhookName name2 = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); + String displayName = "displayName1615086568"; + boolean disabled = true; + Webhook expectedResponse = + Webhook.newBuilder() + .setName(name2.toString()) + .setDisplayName(displayName) + .setDisabled(disabled) + .build(); + mockWebhooks.addResponse(expectedResponse); + + WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); + + Webhook actualResponse = client.getWebhook(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebhooks.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWebhookRequest actualRequest = (GetWebhookRequest) actualRequests.get(0); + + Assert.assertEquals(name, WebhookName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getWebhookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebhooks.addException(exception); + + try { + WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); + + client.getWebhook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createWebhookTest() { + WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); + String displayName = "displayName1615086568"; + boolean disabled = true; + Webhook expectedResponse = + Webhook.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setDisabled(disabled) + .build(); + mockWebhooks.addResponse(expectedResponse); + + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + Webhook webhook = Webhook.newBuilder().build(); + + Webhook actualResponse = client.createWebhook(parent, webhook); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebhooks.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWebhookRequest actualRequest = (CreateWebhookRequest) actualRequests.get(0); + + Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(webhook, actualRequest.getWebhook()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createWebhookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebhooks.addException(exception); + + try { + AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + Webhook webhook = Webhook.newBuilder().build(); + + client.createWebhook(parent, webhook); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateWebhookTest() { + WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); + String displayName = "displayName1615086568"; + boolean disabled = true; + Webhook expectedResponse = + Webhook.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setDisabled(disabled) + .build(); + mockWebhooks.addResponse(expectedResponse); + + Webhook webhook = Webhook.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Webhook actualResponse = client.updateWebhook(webhook, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebhooks.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateWebhookRequest actualRequest = (UpdateWebhookRequest) actualRequests.get(0); + + Assert.assertEquals(webhook, actualRequest.getWebhook()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateWebhookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebhooks.addException(exception); + + try { + Webhook webhook = Webhook.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateWebhook(webhook, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteWebhookTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockWebhooks.addResponse(expectedResponse); + + WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); + + client.deleteWebhook(name); + + List actualRequests = mockWebhooks.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteWebhookRequest actualRequest = (DeleteWebhookRequest) actualRequests.get(0); + + Assert.assertEquals(name, WebhookName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteWebhookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebhooks.addException(exception); + + try { + WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); + + client.deleteWebhook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/pom.xml b/grpc-google-cloud-dialogflow-cx-v3beta1/pom.xml new file mode 100644 index 000000000..a7696fe4c --- /dev/null +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-dialogflow-cx-v3beta1 + 0.0.1-SNAPSHOT + grpc-google-cloud-dialogflow-cx-v3beta1 + GRPC library for grpc-google-cloud-dialogflow-cx-v3beta1 + + com.google.cloud + google-cloud-dialogflow-cx-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-dialogflow-cx-v3beta1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsGrpc.java new file mode 100644 index 000000000..1d8e090e1 --- /dev/null +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsGrpc.java @@ -0,0 +1,1043 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/dialogflow/cx/v3beta1/agent.proto") +public final class AgentsGrpc { + + private AgentsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.dialogflow.cx.v3beta1.Agents"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse> + getListAgentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAgents", + requestType = com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse> + getListAgentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse> + getListAgentsMethod; + if ((getListAgentsMethod = AgentsGrpc.getListAgentsMethod) == null) { + synchronized (AgentsGrpc.class) { + if ((getListAgentsMethod = AgentsGrpc.getListAgentsMethod) == null) { + AgentsGrpc.getListAgentsMethod = + getListAgentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListAgents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new AgentsMethodDescriptorSupplier("ListAgents")) + .build(); + } + } + } + return getListAgentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Agent> + getGetAgentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAgent", + requestType = com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Agent.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Agent> + getGetAgentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Agent> + getGetAgentMethod; + if ((getGetAgentMethod = AgentsGrpc.getGetAgentMethod) == null) { + synchronized (AgentsGrpc.class) { + if ((getGetAgentMethod = AgentsGrpc.getGetAgentMethod) == null) { + AgentsGrpc.getGetAgentMethod = + getGetAgentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAgent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Agent.getDefaultInstance())) + .setSchemaDescriptor(new AgentsMethodDescriptorSupplier("GetAgent")) + .build(); + } + } + } + return getGetAgentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Agent> + getCreateAgentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateAgent", + requestType = com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Agent.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Agent> + getCreateAgentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Agent> + getCreateAgentMethod; + if ((getCreateAgentMethod = AgentsGrpc.getCreateAgentMethod) == null) { + synchronized (AgentsGrpc.class) { + if ((getCreateAgentMethod = AgentsGrpc.getCreateAgentMethod) == null) { + AgentsGrpc.getCreateAgentMethod = + getCreateAgentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateAgent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Agent.getDefaultInstance())) + .setSchemaDescriptor(new AgentsMethodDescriptorSupplier("CreateAgent")) + .build(); + } + } + } + return getCreateAgentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Agent> + getUpdateAgentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateAgent", + requestType = com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Agent.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Agent> + getUpdateAgentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Agent> + getUpdateAgentMethod; + if ((getUpdateAgentMethod = AgentsGrpc.getUpdateAgentMethod) == null) { + synchronized (AgentsGrpc.class) { + if ((getUpdateAgentMethod = AgentsGrpc.getUpdateAgentMethod) == null) { + AgentsGrpc.getUpdateAgentMethod = + getUpdateAgentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateAgent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Agent.getDefaultInstance())) + .setSchemaDescriptor(new AgentsMethodDescriptorSupplier("UpdateAgent")) + .build(); + } + } + } + return getUpdateAgentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest, com.google.protobuf.Empty> + getDeleteAgentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteAgent", + requestType = com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest, com.google.protobuf.Empty> + getDeleteAgentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest, com.google.protobuf.Empty> + getDeleteAgentMethod; + if ((getDeleteAgentMethod = AgentsGrpc.getDeleteAgentMethod) == null) { + synchronized (AgentsGrpc.class) { + if ((getDeleteAgentMethod = AgentsGrpc.getDeleteAgentMethod) == null) { + AgentsGrpc.getDeleteAgentMethod = + getDeleteAgentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteAgent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new AgentsMethodDescriptorSupplier("DeleteAgent")) + .build(); + } + } + } + return getDeleteAgentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest, + com.google.longrunning.Operation> + getExportAgentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ExportAgent", + requestType = com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest, + com.google.longrunning.Operation> + getExportAgentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest, + com.google.longrunning.Operation> + getExportAgentMethod; + if ((getExportAgentMethod = AgentsGrpc.getExportAgentMethod) == null) { + synchronized (AgentsGrpc.class) { + if ((getExportAgentMethod = AgentsGrpc.getExportAgentMethod) == null) { + AgentsGrpc.getExportAgentMethod = + getExportAgentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ExportAgent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AgentsMethodDescriptorSupplier("ExportAgent")) + .build(); + } + } + } + return getExportAgentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest, + com.google.longrunning.Operation> + getRestoreAgentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RestoreAgent", + requestType = com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest, + com.google.longrunning.Operation> + getRestoreAgentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest, + com.google.longrunning.Operation> + getRestoreAgentMethod; + if ((getRestoreAgentMethod = AgentsGrpc.getRestoreAgentMethod) == null) { + synchronized (AgentsGrpc.class) { + if ((getRestoreAgentMethod = AgentsGrpc.getRestoreAgentMethod) == null) { + AgentsGrpc.getRestoreAgentMethod = + getRestoreAgentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RestoreAgent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AgentsMethodDescriptorSupplier("RestoreAgent")) + .build(); + } + } + } + return getRestoreAgentMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AgentsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AgentsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AgentsStub(channel, callOptions); + } + }; + return AgentsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AgentsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AgentsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AgentsBlockingStub(channel, callOptions); + } + }; + return AgentsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AgentsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AgentsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AgentsFutureStub(channel, callOptions); + } + }; + return AgentsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
+   * 
+ */ + public abstract static class AgentsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns the list of all agents in the specified location.
+     * 
+ */ + public void listAgents( + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListAgentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified agent.
+     * 
+ */ + public void getAgent( + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetAgentMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates an agent in the specified location.
+     * 
+ */ + public void createAgent( + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateAgentMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the specified agent.
+     * 
+ */ + public void updateAgent( + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateAgentMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified agent.
+     * 
+ */ + public void deleteAgent( + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteAgentMethod(), responseObserver); + } + + /** + * + * + *
+     * Exports the specified agent to a ZIP file.
+     * 
+ */ + public void exportAgent( + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getExportAgentMethod(), responseObserver); + } + + /** + * + * + *
+     * Restores the specified agent from a ZIP file.
+     * Note that all existing intents, intent routes, entity types, pages and
+     * webhooks in the agent will be deleted.
+     * 
+ */ + public void restoreAgent( + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getRestoreAgentMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListAgentsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse>( + this, METHODID_LIST_AGENTS))) + .addMethod( + getGetAgentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Agent>(this, METHODID_GET_AGENT))) + .addMethod( + getCreateAgentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Agent>(this, METHODID_CREATE_AGENT))) + .addMethod( + getUpdateAgentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Agent>(this, METHODID_UPDATE_AGENT))) + .addMethod( + getDeleteAgentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_AGENT))) + .addMethod( + getExportAgentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest, + com.google.longrunning.Operation>(this, METHODID_EXPORT_AGENT))) + .addMethod( + getRestoreAgentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest, + com.google.longrunning.Operation>(this, METHODID_RESTORE_AGENT))) + .build(); + } + } + + /** + * + * + *
+   * Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
+   * 
+ */ + public static final class AgentsStub extends io.grpc.stub.AbstractAsyncStub { + private AgentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AgentsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AgentsStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all agents in the specified location.
+     * 
+ */ + public void listAgents( + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListAgentsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified agent.
+     * 
+ */ + public void getAgent( + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetAgentMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates an agent in the specified location.
+     * 
+ */ + public void createAgent( + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateAgentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the specified agent.
+     * 
+ */ + public void updateAgent( + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateAgentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified agent.
+     * 
+ */ + public void deleteAgent( + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteAgentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Exports the specified agent to a ZIP file.
+     * 
+ */ + public void exportAgent( + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getExportAgentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Restores the specified agent from a ZIP file.
+     * Note that all existing intents, intent routes, entity types, pages and
+     * webhooks in the agent will be deleted.
+     * 
+ */ + public void restoreAgent( + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getRestoreAgentMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
+   * 
+ */ + public static final class AgentsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AgentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AgentsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AgentsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all agents in the specified location.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse listAgents( + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest request) { + return blockingUnaryCall(getChannel(), getListAgentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the specified agent.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Agent getAgent( + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest request) { + return blockingUnaryCall(getChannel(), getGetAgentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates an agent in the specified location.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Agent createAgent( + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest request) { + return blockingUnaryCall(getChannel(), getCreateAgentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified agent.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Agent updateAgent( + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest request) { + return blockingUnaryCall(getChannel(), getUpdateAgentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified agent.
+     * 
+ */ + public com.google.protobuf.Empty deleteAgent( + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest request) { + return blockingUnaryCall(getChannel(), getDeleteAgentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Exports the specified agent to a ZIP file.
+     * 
+ */ + public com.google.longrunning.Operation exportAgent( + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest request) { + return blockingUnaryCall(getChannel(), getExportAgentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Restores the specified agent from a ZIP file.
+     * Note that all existing intents, intent routes, entity types, pages and
+     * webhooks in the agent will be deleted.
+     * 
+ */ + public com.google.longrunning.Operation restoreAgent( + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest request) { + return blockingUnaryCall(getChannel(), getRestoreAgentMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
+   * 
+ */ + public static final class AgentsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AgentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AgentsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all agents in the specified location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse> + listAgents(com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListAgentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the specified agent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Agent> + getAgent(com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest request) { + return futureUnaryCall(getChannel().newCall(getGetAgentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates an agent in the specified location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Agent> + createAgent(com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateAgentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the specified agent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Agent> + updateAgent(com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateAgentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified agent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteAgent(com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteAgentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Exports the specified agent to a ZIP file.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + exportAgent(com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest request) { + return futureUnaryCall( + getChannel().newCall(getExportAgentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Restores the specified agent from a ZIP file.
+     * Note that all existing intents, intent routes, entity types, pages and
+     * webhooks in the agent will be deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + restoreAgent(com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest request) { + return futureUnaryCall( + getChannel().newCall(getRestoreAgentMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_AGENTS = 0; + private static final int METHODID_GET_AGENT = 1; + private static final int METHODID_CREATE_AGENT = 2; + private static final int METHODID_UPDATE_AGENT = 3; + private static final int METHODID_DELETE_AGENT = 4; + private static final int METHODID_EXPORT_AGENT = 5; + private static final int METHODID_RESTORE_AGENT = 6; + + 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 AgentsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AgentsImplBase 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_LIST_AGENTS: + serviceImpl.listAgents( + (com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse>) + responseObserver); + break; + case METHODID_GET_AGENT: + serviceImpl.getAgent( + (com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_AGENT: + serviceImpl.createAgent( + (com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_AGENT: + serviceImpl.updateAgent( + (com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_AGENT: + serviceImpl.deleteAgent( + (com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EXPORT_AGENT: + serviceImpl.exportAgent( + (com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESTORE_AGENT: + serviceImpl.restoreAgent( + (com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest) 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 AgentsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AgentsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Agents"); + } + } + + private static final class AgentsFileDescriptorSupplier extends AgentsBaseDescriptorSupplier { + AgentsFileDescriptorSupplier() {} + } + + private static final class AgentsMethodDescriptorSupplier extends AgentsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AgentsMethodDescriptorSupplier(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 (AgentsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AgentsFileDescriptorSupplier()) + .addMethod(getListAgentsMethod()) + .addMethod(getGetAgentMethod()) + .addMethod(getCreateAgentMethod()) + .addMethod(getUpdateAgentMethod()) + .addMethod(getDeleteAgentMethod()) + .addMethod(getExportAgentMethod()) + .addMethod(getRestoreAgentMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesGrpc.java new file mode 100644 index 000000000..d31f19492 --- /dev/null +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesGrpc.java @@ -0,0 +1,835 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/dialogflow/cx/v3beta1/entity_type.proto") +public final class EntityTypesGrpc { + + private EntityTypesGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.dialogflow.cx.v3beta1.EntityTypes"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse> + getListEntityTypesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListEntityTypes", + requestType = com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse> + getListEntityTypesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse> + getListEntityTypesMethod; + if ((getListEntityTypesMethod = EntityTypesGrpc.getListEntityTypesMethod) == null) { + synchronized (EntityTypesGrpc.class) { + if ((getListEntityTypesMethod = EntityTypesGrpc.getListEntityTypesMethod) == null) { + EntityTypesGrpc.getListEntityTypesMethod = + getListEntityTypesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListEntityTypes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new EntityTypesMethodDescriptorSupplier("ListEntityTypes")) + .build(); + } + } + } + return getListEntityTypesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.EntityType> + getGetEntityTypeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEntityType", + requestType = com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.EntityType.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.EntityType> + getGetEntityTypeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.EntityType> + getGetEntityTypeMethod; + if ((getGetEntityTypeMethod = EntityTypesGrpc.getGetEntityTypeMethod) == null) { + synchronized (EntityTypesGrpc.class) { + if ((getGetEntityTypeMethod = EntityTypesGrpc.getGetEntityTypeMethod) == null) { + EntityTypesGrpc.getGetEntityTypeMethod = + getGetEntityTypeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEntityType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.EntityType + .getDefaultInstance())) + .setSchemaDescriptor(new EntityTypesMethodDescriptorSupplier("GetEntityType")) + .build(); + } + } + } + return getGetEntityTypeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.EntityType> + getCreateEntityTypeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateEntityType", + requestType = com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.EntityType.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.EntityType> + getCreateEntityTypeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.EntityType> + getCreateEntityTypeMethod; + if ((getCreateEntityTypeMethod = EntityTypesGrpc.getCreateEntityTypeMethod) == null) { + synchronized (EntityTypesGrpc.class) { + if ((getCreateEntityTypeMethod = EntityTypesGrpc.getCreateEntityTypeMethod) == null) { + EntityTypesGrpc.getCreateEntityTypeMethod = + getCreateEntityTypeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateEntityType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.EntityType + .getDefaultInstance())) + .setSchemaDescriptor( + new EntityTypesMethodDescriptorSupplier("CreateEntityType")) + .build(); + } + } + } + return getCreateEntityTypeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.EntityType> + getUpdateEntityTypeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateEntityType", + requestType = com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.EntityType.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.EntityType> + getUpdateEntityTypeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.EntityType> + getUpdateEntityTypeMethod; + if ((getUpdateEntityTypeMethod = EntityTypesGrpc.getUpdateEntityTypeMethod) == null) { + synchronized (EntityTypesGrpc.class) { + if ((getUpdateEntityTypeMethod = EntityTypesGrpc.getUpdateEntityTypeMethod) == null) { + EntityTypesGrpc.getUpdateEntityTypeMethod = + getUpdateEntityTypeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateEntityType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.EntityType + .getDefaultInstance())) + .setSchemaDescriptor( + new EntityTypesMethodDescriptorSupplier("UpdateEntityType")) + .build(); + } + } + } + return getUpdateEntityTypeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest, com.google.protobuf.Empty> + getDeleteEntityTypeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteEntityType", + requestType = com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest, com.google.protobuf.Empty> + getDeleteEntityTypeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest, + com.google.protobuf.Empty> + getDeleteEntityTypeMethod; + if ((getDeleteEntityTypeMethod = EntityTypesGrpc.getDeleteEntityTypeMethod) == null) { + synchronized (EntityTypesGrpc.class) { + if ((getDeleteEntityTypeMethod = EntityTypesGrpc.getDeleteEntityTypeMethod) == null) { + EntityTypesGrpc.getDeleteEntityTypeMethod = + getDeleteEntityTypeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteEntityType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new EntityTypesMethodDescriptorSupplier("DeleteEntityType")) + .build(); + } + } + } + return getDeleteEntityTypeMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static EntityTypesStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EntityTypesStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EntityTypesStub(channel, callOptions); + } + }; + return EntityTypesStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static EntityTypesBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EntityTypesBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EntityTypesBlockingStub(channel, callOptions); + } + }; + return EntityTypesBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static EntityTypesFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EntityTypesFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EntityTypesFutureStub(channel, callOptions); + } + }; + return EntityTypesFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
+   * 
+ */ + public abstract static class EntityTypesImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns the list of all entity types in the specified agent.
+     * 
+ */ + public void listEntityTypes( + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListEntityTypesMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified entity type.
+     * 
+ */ + public void getEntityType( + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetEntityTypeMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates an entity type in the specified agent.
+     * 
+ */ + public void createEntityType( + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateEntityTypeMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the specified entity type.
+     * 
+ */ + public void updateEntityType( + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateEntityTypeMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified entity type.
+     * 
+ */ + public void deleteEntityType( + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteEntityTypeMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListEntityTypesMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse>( + this, METHODID_LIST_ENTITY_TYPES))) + .addMethod( + getGetEntityTypeMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.EntityType>( + this, METHODID_GET_ENTITY_TYPE))) + .addMethod( + getCreateEntityTypeMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.EntityType>( + this, METHODID_CREATE_ENTITY_TYPE))) + .addMethod( + getUpdateEntityTypeMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.EntityType>( + this, METHODID_UPDATE_ENTITY_TYPE))) + .addMethod( + getDeleteEntityTypeMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_ENTITY_TYPE))) + .build(); + } + } + + /** + * + * + *
+   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
+   * 
+ */ + public static final class EntityTypesStub + extends io.grpc.stub.AbstractAsyncStub { + private EntityTypesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EntityTypesStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EntityTypesStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all entity types in the specified agent.
+     * 
+ */ + public void listEntityTypes( + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListEntityTypesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified entity type.
+     * 
+ */ + public void getEntityType( + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetEntityTypeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates an entity type in the specified agent.
+     * 
+ */ + public void createEntityType( + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateEntityTypeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the specified entity type.
+     * 
+ */ + public void updateEntityType( + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateEntityTypeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified entity type.
+     * 
+ */ + public void deleteEntityType( + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteEntityTypeMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
+   * 
+ */ + public static final class EntityTypesBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private EntityTypesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EntityTypesBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EntityTypesBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all entity types in the specified agent.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse listEntityTypes( + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest request) { + return blockingUnaryCall(getChannel(), getListEntityTypesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the specified entity type.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType getEntityType( + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest request) { + return blockingUnaryCall(getChannel(), getGetEntityTypeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates an entity type in the specified agent.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType createEntityType( + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest request) { + return blockingUnaryCall( + getChannel(), getCreateEntityTypeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified entity type.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType updateEntityType( + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateEntityTypeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified entity type.
+     * 
+ */ + public com.google.protobuf.Empty deleteEntityType( + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteEntityTypeMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
+   * 
+ */ + public static final class EntityTypesFutureStub + extends io.grpc.stub.AbstractFutureStub { + private EntityTypesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EntityTypesFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EntityTypesFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all entity types in the specified agent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse> + listEntityTypes(com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListEntityTypesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the specified entity type.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.EntityType> + getEntityType(com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetEntityTypeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates an entity type in the specified agent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.EntityType> + createEntityType(com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateEntityTypeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the specified entity type.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.EntityType> + updateEntityType(com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateEntityTypeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified entity type.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteEntityType(com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteEntityTypeMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_ENTITY_TYPES = 0; + private static final int METHODID_GET_ENTITY_TYPE = 1; + private static final int METHODID_CREATE_ENTITY_TYPE = 2; + private static final int METHODID_UPDATE_ENTITY_TYPE = 3; + private static final int METHODID_DELETE_ENTITY_TYPE = 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 EntityTypesImplBase serviceImpl; + private final int methodId; + + MethodHandlers(EntityTypesImplBase 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_LIST_ENTITY_TYPES: + serviceImpl.listEntityTypes( + (com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse>) + responseObserver); + break; + case METHODID_GET_ENTITY_TYPE: + serviceImpl.getEntityType( + (com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_ENTITY_TYPE: + serviceImpl.createEntityType( + (com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_ENTITY_TYPE: + serviceImpl.updateEntityType( + (com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_ENTITY_TYPE: + serviceImpl.deleteEntityType( + (com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest) 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 EntityTypesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + EntityTypesBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("EntityTypes"); + } + } + + private static final class EntityTypesFileDescriptorSupplier + extends EntityTypesBaseDescriptorSupplier { + EntityTypesFileDescriptorSupplier() {} + } + + private static final class EntityTypesMethodDescriptorSupplier + extends EntityTypesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + EntityTypesMethodDescriptorSupplier(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 (EntityTypesGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new EntityTypesFileDescriptorSupplier()) + .addMethod(getListEntityTypesMethod()) + .addMethod(getGetEntityTypeMethod()) + .addMethod(getCreateEntityTypeMethod()) + .addMethod(getUpdateEntityTypeMethod()) + .addMethod(getDeleteEntityTypeMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsGrpc.java new file mode 100644 index 000000000..8b917626f --- /dev/null +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsGrpc.java @@ -0,0 +1,956 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/dialogflow/cx/v3beta1/environment.proto") +public final class EnvironmentsGrpc { + + private EnvironmentsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.dialogflow.cx.v3beta1.Environments"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse> + getListEnvironmentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListEnvironments", + requestType = com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse> + getListEnvironmentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse> + getListEnvironmentsMethod; + if ((getListEnvironmentsMethod = EnvironmentsGrpc.getListEnvironmentsMethod) == null) { + synchronized (EnvironmentsGrpc.class) { + if ((getListEnvironmentsMethod = EnvironmentsGrpc.getListEnvironmentsMethod) == null) { + EnvironmentsGrpc.getListEnvironmentsMethod = + getListEnvironmentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListEnvironments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new EnvironmentsMethodDescriptorSupplier("ListEnvironments")) + .build(); + } + } + } + return getListEnvironmentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Environment> + getGetEnvironmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEnvironment", + requestType = com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Environment.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Environment> + getGetEnvironmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Environment> + getGetEnvironmentMethod; + if ((getGetEnvironmentMethod = EnvironmentsGrpc.getGetEnvironmentMethod) == null) { + synchronized (EnvironmentsGrpc.class) { + if ((getGetEnvironmentMethod = EnvironmentsGrpc.getGetEnvironmentMethod) == null) { + EnvironmentsGrpc.getGetEnvironmentMethod = + getGetEnvironmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEnvironment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Environment + .getDefaultInstance())) + .setSchemaDescriptor( + new EnvironmentsMethodDescriptorSupplier("GetEnvironment")) + .build(); + } + } + } + return getGetEnvironmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest, + com.google.longrunning.Operation> + getCreateEnvironmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateEnvironment", + requestType = com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest, + com.google.longrunning.Operation> + getCreateEnvironmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest, + com.google.longrunning.Operation> + getCreateEnvironmentMethod; + if ((getCreateEnvironmentMethod = EnvironmentsGrpc.getCreateEnvironmentMethod) == null) { + synchronized (EnvironmentsGrpc.class) { + if ((getCreateEnvironmentMethod = EnvironmentsGrpc.getCreateEnvironmentMethod) == null) { + EnvironmentsGrpc.getCreateEnvironmentMethod = + getCreateEnvironmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateEnvironment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new EnvironmentsMethodDescriptorSupplier("CreateEnvironment")) + .build(); + } + } + } + return getCreateEnvironmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest, + com.google.longrunning.Operation> + getUpdateEnvironmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateEnvironment", + requestType = com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest, + com.google.longrunning.Operation> + getUpdateEnvironmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest, + com.google.longrunning.Operation> + getUpdateEnvironmentMethod; + if ((getUpdateEnvironmentMethod = EnvironmentsGrpc.getUpdateEnvironmentMethod) == null) { + synchronized (EnvironmentsGrpc.class) { + if ((getUpdateEnvironmentMethod = EnvironmentsGrpc.getUpdateEnvironmentMethod) == null) { + EnvironmentsGrpc.getUpdateEnvironmentMethod = + getUpdateEnvironmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateEnvironment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new EnvironmentsMethodDescriptorSupplier("UpdateEnvironment")) + .build(); + } + } + } + return getUpdateEnvironmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest, + com.google.protobuf.Empty> + getDeleteEnvironmentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteEnvironment", + requestType = com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest, + com.google.protobuf.Empty> + getDeleteEnvironmentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest, + com.google.protobuf.Empty> + getDeleteEnvironmentMethod; + if ((getDeleteEnvironmentMethod = EnvironmentsGrpc.getDeleteEnvironmentMethod) == null) { + synchronized (EnvironmentsGrpc.class) { + if ((getDeleteEnvironmentMethod = EnvironmentsGrpc.getDeleteEnvironmentMethod) == null) { + EnvironmentsGrpc.getDeleteEnvironmentMethod = + getDeleteEnvironmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteEnvironment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new EnvironmentsMethodDescriptorSupplier("DeleteEnvironment")) + .build(); + } + } + } + return getDeleteEnvironmentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest, + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse> + getLookupEnvironmentHistoryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "LookupEnvironmentHistory", + requestType = com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest, + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse> + getLookupEnvironmentHistoryMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest, + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse> + getLookupEnvironmentHistoryMethod; + if ((getLookupEnvironmentHistoryMethod = EnvironmentsGrpc.getLookupEnvironmentHistoryMethod) + == null) { + synchronized (EnvironmentsGrpc.class) { + if ((getLookupEnvironmentHistoryMethod = EnvironmentsGrpc.getLookupEnvironmentHistoryMethod) + == null) { + EnvironmentsGrpc.getLookupEnvironmentHistoryMethod = + getLookupEnvironmentHistoryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "LookupEnvironmentHistory")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1 + .LookupEnvironmentHistoryResponse.getDefaultInstance())) + .setSchemaDescriptor( + new EnvironmentsMethodDescriptorSupplier("LookupEnvironmentHistory")) + .build(); + } + } + } + return getLookupEnvironmentHistoryMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static EnvironmentsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EnvironmentsStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EnvironmentsStub(channel, callOptions); + } + }; + return EnvironmentsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static EnvironmentsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EnvironmentsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EnvironmentsBlockingStub(channel, callOptions); + } + }; + return EnvironmentsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static EnvironmentsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EnvironmentsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EnvironmentsFutureStub(channel, callOptions); + } + }; + return EnvironmentsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
+   * 
+ */ + public abstract static class EnvironmentsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ + public void listEnvironments( + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListEnvironmentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public void getEnvironment( + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetEnvironmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ + public void createEnvironment( + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateEnvironmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public void updateEnvironment( + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateEnvironmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public void deleteEnvironment( + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteEnvironmentMethod(), responseObserver); + } + + /** + * + * + *
+     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public void lookupEnvironmentHistory( + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getLookupEnvironmentHistoryMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListEnvironmentsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse>( + this, METHODID_LIST_ENVIRONMENTS))) + .addMethod( + getGetEnvironmentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Environment>( + this, METHODID_GET_ENVIRONMENT))) + .addMethod( + getCreateEnvironmentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_ENVIRONMENT))) + .addMethod( + getUpdateEnvironmentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_ENVIRONMENT))) + .addMethod( + getDeleteEnvironmentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_ENVIRONMENT))) + .addMethod( + getLookupEnvironmentHistoryMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest, + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse>( + this, METHODID_LOOKUP_ENVIRONMENT_HISTORY))) + .build(); + } + } + + /** + * + * + *
+   * Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
+   * 
+ */ + public static final class EnvironmentsStub + extends io.grpc.stub.AbstractAsyncStub { + private EnvironmentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EnvironmentsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EnvironmentsStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ + public void listEnvironments( + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListEnvironmentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public void getEnvironment( + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetEnvironmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ + public void createEnvironment( + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateEnvironmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public void updateEnvironment( + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateEnvironmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public void deleteEnvironment( + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteEnvironmentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public void lookupEnvironmentHistory( + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getLookupEnvironmentHistoryMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
+   * 
+ */ + public static final class EnvironmentsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private EnvironmentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EnvironmentsBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EnvironmentsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse listEnvironments( + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest request) { + return blockingUnaryCall( + getChannel(), getListEnvironmentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironment( + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest request) { + return blockingUnaryCall(getChannel(), getGetEnvironmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ + public com.google.longrunning.Operation createEnvironment( + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest request) { + return blockingUnaryCall( + getChannel(), getCreateEnvironmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public com.google.longrunning.Operation updateEnvironment( + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateEnvironmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public com.google.protobuf.Empty deleteEnvironment( + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteEnvironmentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + lookupEnvironmentHistory( + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest request) { + return blockingUnaryCall( + getChannel(), getLookupEnvironmentHistoryMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
+   * 
+ */ + public static final class EnvironmentsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private EnvironmentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EnvironmentsFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EnvironmentsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse> + listEnvironments(com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListEnvironmentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Environment> + getEnvironment(com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetEnvironmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createEnvironment(com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateEnvironmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateEnvironment(com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateEnvironmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteEnvironment(com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteEnvironmentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse> + lookupEnvironmentHistory( + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest request) { + return futureUnaryCall( + getChannel().newCall(getLookupEnvironmentHistoryMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_ENVIRONMENTS = 0; + private static final int METHODID_GET_ENVIRONMENT = 1; + private static final int METHODID_CREATE_ENVIRONMENT = 2; + private static final int METHODID_UPDATE_ENVIRONMENT = 3; + private static final int METHODID_DELETE_ENVIRONMENT = 4; + private static final int METHODID_LOOKUP_ENVIRONMENT_HISTORY = 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 EnvironmentsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(EnvironmentsImplBase 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_LIST_ENVIRONMENTS: + serviceImpl.listEnvironments( + (com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse>) + responseObserver); + break; + case METHODID_GET_ENVIRONMENT: + serviceImpl.getEnvironment( + (com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_ENVIRONMENT: + serviceImpl.createEnvironment( + (com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_ENVIRONMENT: + serviceImpl.updateEnvironment( + (com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_ENVIRONMENT: + serviceImpl.deleteEnvironment( + (com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LOOKUP_ENVIRONMENT_HISTORY: + serviceImpl.lookupEnvironmentHistory( + (com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse>) + 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 EnvironmentsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + EnvironmentsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Environments"); + } + } + + private static final class EnvironmentsFileDescriptorSupplier + extends EnvironmentsBaseDescriptorSupplier { + EnvironmentsFileDescriptorSupplier() {} + } + + private static final class EnvironmentsMethodDescriptorSupplier + extends EnvironmentsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + EnvironmentsMethodDescriptorSupplier(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 (EnvironmentsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new EnvironmentsFileDescriptorSupplier()) + .addMethod(getListEnvironmentsMethod()) + .addMethod(getGetEnvironmentMethod()) + .addMethod(getCreateEnvironmentMethod()) + .addMethod(getUpdateEnvironmentMethod()) + .addMethod(getDeleteEnvironmentMethod()) + .addMethod(getLookupEnvironmentHistoryMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsGrpc.java new file mode 100644 index 000000000..02652bcb6 --- /dev/null +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsGrpc.java @@ -0,0 +1,908 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/dialogflow/cx/v3beta1/flow.proto") +public final class FlowsGrpc { + + private FlowsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.dialogflow.cx.v3beta1.Flows"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest, + com.google.cloud.dialogflow.cx.v3beta1.Flow> + getCreateFlowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateFlow", + requestType = com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Flow.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest, + com.google.cloud.dialogflow.cx.v3beta1.Flow> + getCreateFlowMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest, + com.google.cloud.dialogflow.cx.v3beta1.Flow> + getCreateFlowMethod; + if ((getCreateFlowMethod = FlowsGrpc.getCreateFlowMethod) == null) { + synchronized (FlowsGrpc.class) { + if ((getCreateFlowMethod = FlowsGrpc.getCreateFlowMethod) == null) { + FlowsGrpc.getCreateFlowMethod = + getCreateFlowMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateFlow")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Flow.getDefaultInstance())) + .setSchemaDescriptor(new FlowsMethodDescriptorSupplier("CreateFlow")) + .build(); + } + } + } + return getCreateFlowMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest, com.google.protobuf.Empty> + getDeleteFlowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteFlow", + requestType = com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest, com.google.protobuf.Empty> + getDeleteFlowMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest, com.google.protobuf.Empty> + getDeleteFlowMethod; + if ((getDeleteFlowMethod = FlowsGrpc.getDeleteFlowMethod) == null) { + synchronized (FlowsGrpc.class) { + if ((getDeleteFlowMethod = FlowsGrpc.getDeleteFlowMethod) == null) { + FlowsGrpc.getDeleteFlowMethod = + getDeleteFlowMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteFlow")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new FlowsMethodDescriptorSupplier("DeleteFlow")) + .build(); + } + } + } + return getDeleteFlowMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse> + getListFlowsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListFlows", + requestType = com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse> + getListFlowsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse> + getListFlowsMethod; + if ((getListFlowsMethod = FlowsGrpc.getListFlowsMethod) == null) { + synchronized (FlowsGrpc.class) { + if ((getListFlowsMethod = FlowsGrpc.getListFlowsMethod) == null) { + FlowsGrpc.getListFlowsMethod = + getListFlowsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListFlows")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new FlowsMethodDescriptorSupplier("ListFlows")) + .build(); + } + } + } + return getListFlowsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest, + com.google.cloud.dialogflow.cx.v3beta1.Flow> + getGetFlowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetFlow", + requestType = com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Flow.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest, + com.google.cloud.dialogflow.cx.v3beta1.Flow> + getGetFlowMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest, + com.google.cloud.dialogflow.cx.v3beta1.Flow> + getGetFlowMethod; + if ((getGetFlowMethod = FlowsGrpc.getGetFlowMethod) == null) { + synchronized (FlowsGrpc.class) { + if ((getGetFlowMethod = FlowsGrpc.getGetFlowMethod) == null) { + FlowsGrpc.getGetFlowMethod = + getGetFlowMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetFlow")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Flow.getDefaultInstance())) + .setSchemaDescriptor(new FlowsMethodDescriptorSupplier("GetFlow")) + .build(); + } + } + } + return getGetFlowMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest, + com.google.cloud.dialogflow.cx.v3beta1.Flow> + getUpdateFlowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateFlow", + requestType = com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Flow.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest, + com.google.cloud.dialogflow.cx.v3beta1.Flow> + getUpdateFlowMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest, + com.google.cloud.dialogflow.cx.v3beta1.Flow> + getUpdateFlowMethod; + if ((getUpdateFlowMethod = FlowsGrpc.getUpdateFlowMethod) == null) { + synchronized (FlowsGrpc.class) { + if ((getUpdateFlowMethod = FlowsGrpc.getUpdateFlowMethod) == null) { + FlowsGrpc.getUpdateFlowMethod = + getUpdateFlowMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateFlow")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Flow.getDefaultInstance())) + .setSchemaDescriptor(new FlowsMethodDescriptorSupplier("UpdateFlow")) + .build(); + } + } + } + return getUpdateFlowMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest, com.google.longrunning.Operation> + getTrainFlowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TrainFlow", + requestType = com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest, com.google.longrunning.Operation> + getTrainFlowMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest, + com.google.longrunning.Operation> + getTrainFlowMethod; + if ((getTrainFlowMethod = FlowsGrpc.getTrainFlowMethod) == null) { + synchronized (FlowsGrpc.class) { + if ((getTrainFlowMethod = FlowsGrpc.getTrainFlowMethod) == null) { + FlowsGrpc.getTrainFlowMethod = + getTrainFlowMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TrainFlow")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new FlowsMethodDescriptorSupplier("TrainFlow")) + .build(); + } + } + } + return getTrainFlowMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static FlowsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FlowsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FlowsStub(channel, callOptions); + } + }; + return FlowsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static FlowsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FlowsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FlowsBlockingStub(channel, callOptions); + } + }; + return FlowsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static FlowsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FlowsFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FlowsFutureStub(channel, callOptions); + } + }; + return FlowsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
+   * 
+ */ + public abstract static class FlowsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a flow in the specified agent.
+     * 
+ */ + public void createFlow( + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateFlowMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a specified flow.
+     * 
+ */ + public void deleteFlow( + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteFlowMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns the list of all flows in the specified agent.
+     * 
+ */ + public void listFlows( + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListFlowsMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified flow.
+     * 
+ */ + public void getFlow( + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetFlowMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the specified flow.
+     * 
+ */ + public void updateFlow( + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateFlowMethod(), responseObserver); + } + + /** + * + * + *
+     * Trains the specified flow. Note that only the flow in 'draft' environment
+     * is trained.
+     * 
+ */ + public void trainFlow( + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getTrainFlowMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateFlowMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest, + com.google.cloud.dialogflow.cx.v3beta1.Flow>(this, METHODID_CREATE_FLOW))) + .addMethod( + getDeleteFlowMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_FLOW))) + .addMethod( + getListFlowsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse>( + this, METHODID_LIST_FLOWS))) + .addMethod( + getGetFlowMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest, + com.google.cloud.dialogflow.cx.v3beta1.Flow>(this, METHODID_GET_FLOW))) + .addMethod( + getUpdateFlowMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest, + com.google.cloud.dialogflow.cx.v3beta1.Flow>(this, METHODID_UPDATE_FLOW))) + .addMethod( + getTrainFlowMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest, + com.google.longrunning.Operation>(this, METHODID_TRAIN_FLOW))) + .build(); + } + } + + /** + * + * + *
+   * Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
+   * 
+ */ + public static final class FlowsStub extends io.grpc.stub.AbstractAsyncStub { + private FlowsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FlowsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FlowsStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a flow in the specified agent.
+     * 
+ */ + public void createFlow( + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateFlowMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Deletes a specified flow.
+     * 
+ */ + public void deleteFlow( + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteFlowMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Returns the list of all flows in the specified agent.
+     * 
+ */ + public void listFlows( + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListFlowsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified flow.
+     * 
+ */ + public void getFlow( + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetFlowMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates the specified flow.
+     * 
+ */ + public void updateFlow( + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateFlowMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Trains the specified flow. Note that only the flow in 'draft' environment
+     * is trained.
+     * 
+ */ + public void trainFlow( + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getTrainFlowMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * + * + *
+   * Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
+   * 
+ */ + public static final class FlowsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private FlowsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FlowsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FlowsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a flow in the specified agent.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Flow createFlow( + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest request) { + return blockingUnaryCall(getChannel(), getCreateFlowMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a specified flow.
+     * 
+ */ + public com.google.protobuf.Empty deleteFlow( + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest request) { + return blockingUnaryCall(getChannel(), getDeleteFlowMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns the list of all flows in the specified agent.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse listFlows( + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest request) { + return blockingUnaryCall(getChannel(), getListFlowsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the specified flow.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Flow getFlow( + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest request) { + return blockingUnaryCall(getChannel(), getGetFlowMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified flow.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Flow updateFlow( + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest request) { + return blockingUnaryCall(getChannel(), getUpdateFlowMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Trains the specified flow. Note that only the flow in 'draft' environment
+     * is trained.
+     * 
+ */ + public com.google.longrunning.Operation trainFlow( + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest request) { + return blockingUnaryCall(getChannel(), getTrainFlowMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
+   * 
+ */ + public static final class FlowsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private FlowsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FlowsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FlowsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a flow in the specified agent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Flow> + createFlow(com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateFlowMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a specified flow.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteFlow( + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteFlowMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns the list of all flows in the specified agent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse> + listFlows(com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest request) { + return futureUnaryCall(getChannel().newCall(getListFlowsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the specified flow.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Flow> + getFlow(com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest request) { + return futureUnaryCall(getChannel().newCall(getGetFlowMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the specified flow.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Flow> + updateFlow(com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateFlowMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Trains the specified flow. Note that only the flow in 'draft' environment
+     * is trained.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + trainFlow(com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest request) { + return futureUnaryCall(getChannel().newCall(getTrainFlowMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_FLOW = 0; + private static final int METHODID_DELETE_FLOW = 1; + private static final int METHODID_LIST_FLOWS = 2; + private static final int METHODID_GET_FLOW = 3; + private static final int METHODID_UPDATE_FLOW = 4; + private static final int METHODID_TRAIN_FLOW = 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 FlowsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(FlowsImplBase 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_FLOW: + serviceImpl.createFlow( + (com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_FLOW: + serviceImpl.deleteFlow( + (com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_FLOWS: + serviceImpl.listFlows( + (com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse>) + responseObserver); + break; + case METHODID_GET_FLOW: + serviceImpl.getFlow( + (com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_FLOW: + serviceImpl.updateFlow( + (com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_TRAIN_FLOW: + serviceImpl.trainFlow( + (com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest) 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 FlowsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + FlowsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Flows"); + } + } + + private static final class FlowsFileDescriptorSupplier extends FlowsBaseDescriptorSupplier { + FlowsFileDescriptorSupplier() {} + } + + private static final class FlowsMethodDescriptorSupplier extends FlowsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + FlowsMethodDescriptorSupplier(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 (FlowsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new FlowsFileDescriptorSupplier()) + .addMethod(getCreateFlowMethod()) + .addMethod(getDeleteFlowMethod()) + .addMethod(getListFlowsMethod()) + .addMethod(getGetFlowMethod()) + .addMethod(getUpdateFlowMethod()) + .addMethod(getTrainFlowMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsGrpc.java new file mode 100644 index 000000000..8d49ad05b --- /dev/null +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsGrpc.java @@ -0,0 +1,813 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/dialogflow/cx/v3beta1/intent.proto") +public final class IntentsGrpc { + + private IntentsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.dialogflow.cx.v3beta1.Intents"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse> + getListIntentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListIntents", + requestType = com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse> + getListIntentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse> + getListIntentsMethod; + if ((getListIntentsMethod = IntentsGrpc.getListIntentsMethod) == null) { + synchronized (IntentsGrpc.class) { + if ((getListIntentsMethod = IntentsGrpc.getListIntentsMethod) == null) { + IntentsGrpc.getListIntentsMethod = + getListIntentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListIntents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new IntentsMethodDescriptorSupplier("ListIntents")) + .build(); + } + } + } + return getListIntentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Intent> + getGetIntentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetIntent", + requestType = com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Intent.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Intent> + getGetIntentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Intent> + getGetIntentMethod; + if ((getGetIntentMethod = IntentsGrpc.getGetIntentMethod) == null) { + synchronized (IntentsGrpc.class) { + if ((getGetIntentMethod = IntentsGrpc.getGetIntentMethod) == null) { + IntentsGrpc.getGetIntentMethod = + getGetIntentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIntent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance())) + .setSchemaDescriptor(new IntentsMethodDescriptorSupplier("GetIntent")) + .build(); + } + } + } + return getGetIntentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Intent> + getCreateIntentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateIntent", + requestType = com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Intent.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Intent> + getCreateIntentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Intent> + getCreateIntentMethod; + if ((getCreateIntentMethod = IntentsGrpc.getCreateIntentMethod) == null) { + synchronized (IntentsGrpc.class) { + if ((getCreateIntentMethod = IntentsGrpc.getCreateIntentMethod) == null) { + IntentsGrpc.getCreateIntentMethod = + getCreateIntentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateIntent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance())) + .setSchemaDescriptor(new IntentsMethodDescriptorSupplier("CreateIntent")) + .build(); + } + } + } + return getCreateIntentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Intent> + getUpdateIntentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateIntent", + requestType = com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Intent.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Intent> + getUpdateIntentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Intent> + getUpdateIntentMethod; + if ((getUpdateIntentMethod = IntentsGrpc.getUpdateIntentMethod) == null) { + synchronized (IntentsGrpc.class) { + if ((getUpdateIntentMethod = IntentsGrpc.getUpdateIntentMethod) == null) { + IntentsGrpc.getUpdateIntentMethod = + getUpdateIntentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateIntent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance())) + .setSchemaDescriptor(new IntentsMethodDescriptorSupplier("UpdateIntent")) + .build(); + } + } + } + return getUpdateIntentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest, com.google.protobuf.Empty> + getDeleteIntentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteIntent", + requestType = com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest, com.google.protobuf.Empty> + getDeleteIntentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest, com.google.protobuf.Empty> + getDeleteIntentMethod; + if ((getDeleteIntentMethod = IntentsGrpc.getDeleteIntentMethod) == null) { + synchronized (IntentsGrpc.class) { + if ((getDeleteIntentMethod = IntentsGrpc.getDeleteIntentMethod) == null) { + IntentsGrpc.getDeleteIntentMethod = + getDeleteIntentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteIntent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new IntentsMethodDescriptorSupplier("DeleteIntent")) + .build(); + } + } + } + return getDeleteIntentMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static IntentsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IntentsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IntentsStub(channel, callOptions); + } + }; + return IntentsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static IntentsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IntentsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IntentsBlockingStub(channel, callOptions); + } + }; + return IntentsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static IntentsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IntentsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IntentsFutureStub(channel, callOptions); + } + }; + return IntentsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
+   * 
+ */ + public abstract static class IntentsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns the list of all intents in the specified agent.
+     * 
+ */ + public void listIntents( + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListIntentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified intent.
+     * 
+ */ + public void getIntent( + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetIntentMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates an intent in the specified agent.
+     * 
+ */ + public void createIntent( + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateIntentMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the specified intent.
+     * 
+ */ + public void updateIntent( + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateIntentMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified intent.
+     * 
+ */ + public void deleteIntent( + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteIntentMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListIntentsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse>( + this, METHODID_LIST_INTENTS))) + .addMethod( + getGetIntentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Intent>(this, METHODID_GET_INTENT))) + .addMethod( + getCreateIntentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Intent>(this, METHODID_CREATE_INTENT))) + .addMethod( + getUpdateIntentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.Intent>(this, METHODID_UPDATE_INTENT))) + .addMethod( + getDeleteIntentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_INTENT))) + .build(); + } + } + + /** + * + * + *
+   * Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
+   * 
+ */ + public static final class IntentsStub extends io.grpc.stub.AbstractAsyncStub { + private IntentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IntentsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IntentsStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all intents in the specified agent.
+     * 
+ */ + public void listIntents( + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListIntentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified intent.
+     * 
+ */ + public void getIntent( + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetIntentMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates an intent in the specified agent.
+     * 
+ */ + public void createIntent( + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateIntentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the specified intent.
+     * 
+ */ + public void updateIntent( + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateIntentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified intent.
+     * 
+ */ + public void deleteIntent( + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteIntentMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
+   * 
+ */ + public static final class IntentsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private IntentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IntentsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IntentsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all intents in the specified agent.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse listIntents( + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest request) { + return blockingUnaryCall(getChannel(), getListIntentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the specified intent.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent( + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest request) { + return blockingUnaryCall(getChannel(), getGetIntentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates an intent in the specified agent.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent createIntent( + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest request) { + return blockingUnaryCall(getChannel(), getCreateIntentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified intent.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent updateIntent( + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest request) { + return blockingUnaryCall(getChannel(), getUpdateIntentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified intent.
+     * 
+ */ + public com.google.protobuf.Empty deleteIntent( + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest request) { + return blockingUnaryCall(getChannel(), getDeleteIntentMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
+   * 
+ */ + public static final class IntentsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private IntentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IntentsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all intents in the specified agent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse> + listIntents(com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListIntentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the specified intent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Intent> + getIntent(com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest request) { + return futureUnaryCall(getChannel().newCall(getGetIntentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates an intent in the specified agent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Intent> + createIntent(com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateIntentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the specified intent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Intent> + updateIntent(com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateIntentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified intent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteIntent(com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteIntentMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_INTENTS = 0; + private static final int METHODID_GET_INTENT = 1; + private static final int METHODID_CREATE_INTENT = 2; + private static final int METHODID_UPDATE_INTENT = 3; + private static final int METHODID_DELETE_INTENT = 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 IntentsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(IntentsImplBase 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_LIST_INTENTS: + serviceImpl.listIntents( + (com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse>) + responseObserver); + break; + case METHODID_GET_INTENT: + serviceImpl.getIntent( + (com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_INTENT: + serviceImpl.createIntent( + (com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_INTENT: + serviceImpl.updateIntent( + (com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_INTENT: + serviceImpl.deleteIntent( + (com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest) 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 IntentsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + IntentsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Intents"); + } + } + + private static final class IntentsFileDescriptorSupplier extends IntentsBaseDescriptorSupplier { + IntentsFileDescriptorSupplier() {} + } + + private static final class IntentsMethodDescriptorSupplier extends IntentsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + IntentsMethodDescriptorSupplier(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 (IntentsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new IntentsFileDescriptorSupplier()) + .addMethod(getListIntentsMethod()) + .addMethod(getGetIntentMethod()) + .addMethod(getCreateIntentMethod()) + .addMethod(getUpdateIntentMethod()) + .addMethod(getDeleteIntentMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesGrpc.java new file mode 100644 index 000000000..c96f2ce69 --- /dev/null +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesGrpc.java @@ -0,0 +1,797 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/dialogflow/cx/v3beta1/page.proto") +public final class PagesGrpc { + + private PagesGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.dialogflow.cx.v3beta1.Pages"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse> + getListPagesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPages", + requestType = com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse> + getListPagesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse> + getListPagesMethod; + if ((getListPagesMethod = PagesGrpc.getListPagesMethod) == null) { + synchronized (PagesGrpc.class) { + if ((getListPagesMethod = PagesGrpc.getListPagesMethod) == null) { + PagesGrpc.getListPagesMethod = + getListPagesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListPages")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse + .getDefaultInstance())) + .setSchemaDescriptor(new PagesMethodDescriptorSupplier("ListPages")) + .build(); + } + } + } + return getListPagesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest, + com.google.cloud.dialogflow.cx.v3beta1.Page> + getGetPageMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPage", + requestType = com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Page.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest, + com.google.cloud.dialogflow.cx.v3beta1.Page> + getGetPageMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest, + com.google.cloud.dialogflow.cx.v3beta1.Page> + getGetPageMethod; + if ((getGetPageMethod = PagesGrpc.getGetPageMethod) == null) { + synchronized (PagesGrpc.class) { + if ((getGetPageMethod = PagesGrpc.getGetPageMethod) == null) { + PagesGrpc.getGetPageMethod = + getGetPageMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance())) + .setSchemaDescriptor(new PagesMethodDescriptorSupplier("GetPage")) + .build(); + } + } + } + return getGetPageMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest, + com.google.cloud.dialogflow.cx.v3beta1.Page> + getCreatePageMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreatePage", + requestType = com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Page.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest, + com.google.cloud.dialogflow.cx.v3beta1.Page> + getCreatePageMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest, + com.google.cloud.dialogflow.cx.v3beta1.Page> + getCreatePageMethod; + if ((getCreatePageMethod = PagesGrpc.getCreatePageMethod) == null) { + synchronized (PagesGrpc.class) { + if ((getCreatePageMethod = PagesGrpc.getCreatePageMethod) == null) { + PagesGrpc.getCreatePageMethod = + getCreatePageMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreatePage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance())) + .setSchemaDescriptor(new PagesMethodDescriptorSupplier("CreatePage")) + .build(); + } + } + } + return getCreatePageMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest, + com.google.cloud.dialogflow.cx.v3beta1.Page> + getUpdatePageMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdatePage", + requestType = com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Page.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest, + com.google.cloud.dialogflow.cx.v3beta1.Page> + getUpdatePageMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest, + com.google.cloud.dialogflow.cx.v3beta1.Page> + getUpdatePageMethod; + if ((getUpdatePageMethod = PagesGrpc.getUpdatePageMethod) == null) { + synchronized (PagesGrpc.class) { + if ((getUpdatePageMethod = PagesGrpc.getUpdatePageMethod) == null) { + PagesGrpc.getUpdatePageMethod = + getUpdatePageMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdatePage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance())) + .setSchemaDescriptor(new PagesMethodDescriptorSupplier("UpdatePage")) + .build(); + } + } + } + return getUpdatePageMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest, com.google.protobuf.Empty> + getDeletePageMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeletePage", + requestType = com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest, com.google.protobuf.Empty> + getDeletePageMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest, com.google.protobuf.Empty> + getDeletePageMethod; + if ((getDeletePageMethod = PagesGrpc.getDeletePageMethod) == null) { + synchronized (PagesGrpc.class) { + if ((getDeletePageMethod = PagesGrpc.getDeletePageMethod) == null) { + PagesGrpc.getDeletePageMethod = + getDeletePageMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeletePage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new PagesMethodDescriptorSupplier("DeletePage")) + .build(); + } + } + } + return getDeletePageMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static PagesStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PagesStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PagesStub(channel, callOptions); + } + }; + return PagesStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static PagesBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PagesBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PagesBlockingStub(channel, callOptions); + } + }; + return PagesBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static PagesFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PagesFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PagesFutureStub(channel, callOptions); + } + }; + return PagesFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
+   * 
+ */ + public abstract static class PagesImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns the list of all pages in the specified flow.
+     * 
+ */ + public void listPages( + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListPagesMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified page.
+     * 
+ */ + public void getPage( + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetPageMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a page in the specified flow.
+     * 
+ */ + public void createPage( + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreatePageMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the specified page.
+     * 
+ */ + public void updatePage( + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdatePageMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified page.
+     * 
+ */ + public void deletePage( + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeletePageMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListPagesMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse>( + this, METHODID_LIST_PAGES))) + .addMethod( + getGetPageMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest, + com.google.cloud.dialogflow.cx.v3beta1.Page>(this, METHODID_GET_PAGE))) + .addMethod( + getCreatePageMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest, + com.google.cloud.dialogflow.cx.v3beta1.Page>(this, METHODID_CREATE_PAGE))) + .addMethod( + getUpdatePageMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest, + com.google.cloud.dialogflow.cx.v3beta1.Page>(this, METHODID_UPDATE_PAGE))) + .addMethod( + getDeletePageMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_PAGE))) + .build(); + } + } + + /** + * + * + *
+   * Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
+   * 
+ */ + public static final class PagesStub extends io.grpc.stub.AbstractAsyncStub { + private PagesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PagesStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PagesStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all pages in the specified flow.
+     * 
+ */ + public void listPages( + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListPagesMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified page.
+     * 
+ */ + public void getPage( + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetPageMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a page in the specified flow.
+     * 
+ */ + public void createPage( + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreatePageMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates the specified page.
+     * 
+ */ + public void updatePage( + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdatePageMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Deletes the specified page.
+     * 
+ */ + public void deletePage( + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeletePageMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * + * + *
+   * Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
+   * 
+ */ + public static final class PagesBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private PagesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PagesBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PagesBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all pages in the specified flow.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse listPages( + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest request) { + return blockingUnaryCall(getChannel(), getListPagesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the specified page.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Page getPage( + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest request) { + return blockingUnaryCall(getChannel(), getGetPageMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a page in the specified flow.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Page createPage( + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest request) { + return blockingUnaryCall(getChannel(), getCreatePageMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified page.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Page updatePage( + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest request) { + return blockingUnaryCall(getChannel(), getUpdatePageMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified page.
+     * 
+ */ + public com.google.protobuf.Empty deletePage( + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest request) { + return blockingUnaryCall(getChannel(), getDeletePageMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
+   * 
+ */ + public static final class PagesFutureStub + extends io.grpc.stub.AbstractFutureStub { + private PagesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PagesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PagesFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all pages in the specified flow.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse> + listPages(com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest request) { + return futureUnaryCall(getChannel().newCall(getListPagesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the specified page.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Page> + getPage(com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest request) { + return futureUnaryCall(getChannel().newCall(getGetPageMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a page in the specified flow.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Page> + createPage(com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreatePageMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the specified page.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Page> + updatePage(com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdatePageMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified page.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deletePage( + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeletePageMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_PAGES = 0; + private static final int METHODID_GET_PAGE = 1; + private static final int METHODID_CREATE_PAGE = 2; + private static final int METHODID_UPDATE_PAGE = 3; + private static final int METHODID_DELETE_PAGE = 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 PagesImplBase serviceImpl; + private final int methodId; + + MethodHandlers(PagesImplBase 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_LIST_PAGES: + serviceImpl.listPages( + (com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse>) + responseObserver); + break; + case METHODID_GET_PAGE: + serviceImpl.getPage( + (com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_PAGE: + serviceImpl.createPage( + (com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_PAGE: + serviceImpl.updatePage( + (com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_PAGE: + serviceImpl.deletePage( + (com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest) 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 PagesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + PagesBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Pages"); + } + } + + private static final class PagesFileDescriptorSupplier extends PagesBaseDescriptorSupplier { + PagesFileDescriptorSupplier() {} + } + + private static final class PagesMethodDescriptorSupplier extends PagesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + PagesMethodDescriptorSupplier(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 (PagesGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new PagesFileDescriptorSupplier()) + .addMethod(getListPagesMethod()) + .addMethod(getGetPageMethod()) + .addMethod(getCreatePageMethod()) + .addMethod(getUpdatePageMethod()) + .addMethod(getDeletePageMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesGrpc.java new file mode 100644 index 000000000..7ebafc045 --- /dev/null +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesGrpc.java @@ -0,0 +1,881 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto") +public final class SessionEntityTypesGrpc { + + private SessionEntityTypesGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse> + getListSessionEntityTypesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSessionEntityTypes", + requestType = com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse> + getListSessionEntityTypesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse> + getListSessionEntityTypesMethod; + if ((getListSessionEntityTypesMethod = SessionEntityTypesGrpc.getListSessionEntityTypesMethod) + == null) { + synchronized (SessionEntityTypesGrpc.class) { + if ((getListSessionEntityTypesMethod = + SessionEntityTypesGrpc.getListSessionEntityTypesMethod) + == null) { + SessionEntityTypesGrpc.getListSessionEntityTypesMethod = + getListSessionEntityTypesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListSessionEntityTypes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SessionEntityTypesMethodDescriptorSupplier("ListSessionEntityTypes")) + .build(); + } + } + } + return getListSessionEntityTypesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> + getGetSessionEntityTypeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSessionEntityType", + requestType = com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> + getGetSessionEntityTypeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> + getGetSessionEntityTypeMethod; + if ((getGetSessionEntityTypeMethod = SessionEntityTypesGrpc.getGetSessionEntityTypeMethod) + == null) { + synchronized (SessionEntityTypesGrpc.class) { + if ((getGetSessionEntityTypeMethod = SessionEntityTypesGrpc.getGetSessionEntityTypeMethod) + == null) { + SessionEntityTypesGrpc.getGetSessionEntityTypeMethod = + getGetSessionEntityTypeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetSessionEntityType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType + .getDefaultInstance())) + .setSchemaDescriptor( + new SessionEntityTypesMethodDescriptorSupplier("GetSessionEntityType")) + .build(); + } + } + } + return getGetSessionEntityTypeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> + getCreateSessionEntityTypeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSessionEntityType", + requestType = com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> + getCreateSessionEntityTypeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> + getCreateSessionEntityTypeMethod; + if ((getCreateSessionEntityTypeMethod = SessionEntityTypesGrpc.getCreateSessionEntityTypeMethod) + == null) { + synchronized (SessionEntityTypesGrpc.class) { + if ((getCreateSessionEntityTypeMethod = + SessionEntityTypesGrpc.getCreateSessionEntityTypeMethod) + == null) { + SessionEntityTypesGrpc.getCreateSessionEntityTypeMethod = + getCreateSessionEntityTypeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateSessionEntityType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType + .getDefaultInstance())) + .setSchemaDescriptor( + new SessionEntityTypesMethodDescriptorSupplier("CreateSessionEntityType")) + .build(); + } + } + } + return getCreateSessionEntityTypeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> + getUpdateSessionEntityTypeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateSessionEntityType", + requestType = com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> + getUpdateSessionEntityTypeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> + getUpdateSessionEntityTypeMethod; + if ((getUpdateSessionEntityTypeMethod = SessionEntityTypesGrpc.getUpdateSessionEntityTypeMethod) + == null) { + synchronized (SessionEntityTypesGrpc.class) { + if ((getUpdateSessionEntityTypeMethod = + SessionEntityTypesGrpc.getUpdateSessionEntityTypeMethod) + == null) { + SessionEntityTypesGrpc.getUpdateSessionEntityTypeMethod = + getUpdateSessionEntityTypeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateSessionEntityType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType + .getDefaultInstance())) + .setSchemaDescriptor( + new SessionEntityTypesMethodDescriptorSupplier("UpdateSessionEntityType")) + .build(); + } + } + } + return getUpdateSessionEntityTypeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest, + com.google.protobuf.Empty> + getDeleteSessionEntityTypeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSessionEntityType", + requestType = com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest, + com.google.protobuf.Empty> + getDeleteSessionEntityTypeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest, + com.google.protobuf.Empty> + getDeleteSessionEntityTypeMethod; + if ((getDeleteSessionEntityTypeMethod = SessionEntityTypesGrpc.getDeleteSessionEntityTypeMethod) + == null) { + synchronized (SessionEntityTypesGrpc.class) { + if ((getDeleteSessionEntityTypeMethod = + SessionEntityTypesGrpc.getDeleteSessionEntityTypeMethod) + == null) { + SessionEntityTypesGrpc.getDeleteSessionEntityTypeMethod = + getDeleteSessionEntityTypeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteSessionEntityType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new SessionEntityTypesMethodDescriptorSupplier("DeleteSessionEntityType")) + .build(); + } + } + } + return getDeleteSessionEntityTypeMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SessionEntityTypesStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SessionEntityTypesStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionEntityTypesStub(channel, callOptions); + } + }; + return SessionEntityTypesStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SessionEntityTypesBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SessionEntityTypesBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionEntityTypesBlockingStub(channel, callOptions); + } + }; + return SessionEntityTypesBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SessionEntityTypesFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SessionEntityTypesFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionEntityTypesFutureStub(channel, callOptions); + } + }; + return SessionEntityTypesFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
+   * 
+ */ + public abstract static class SessionEntityTypesImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns the list of all session entity types in the specified session.
+     * 
+ */ + public void listSessionEntityTypes( + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListSessionEntityTypesMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified session entity type.
+     * 
+ */ + public void getSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetSessionEntityTypeMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a session entity type.
+     * If the specified session entity type already exists, overrides the
+     * session entity type.
+     * 
+ */ + public void createSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateSessionEntityTypeMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the specified session entity type.
+     * 
+ */ + public void updateSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateSessionEntityTypeMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified session entity type.
+     * 
+ */ + public void deleteSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteSessionEntityTypeMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListSessionEntityTypesMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse>( + this, METHODID_LIST_SESSION_ENTITY_TYPES))) + .addMethod( + getGetSessionEntityTypeMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType>( + this, METHODID_GET_SESSION_ENTITY_TYPE))) + .addMethod( + getCreateSessionEntityTypeMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType>( + this, METHODID_CREATE_SESSION_ENTITY_TYPE))) + .addMethod( + getUpdateSessionEntityTypeMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType>( + this, METHODID_UPDATE_SESSION_ENTITY_TYPE))) + .addMethod( + getDeleteSessionEntityTypeMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_SESSION_ENTITY_TYPE))) + .build(); + } + } + + /** + * + * + *
+   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
+   * 
+ */ + public static final class SessionEntityTypesStub + extends io.grpc.stub.AbstractAsyncStub { + private SessionEntityTypesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SessionEntityTypesStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionEntityTypesStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all session entity types in the specified session.
+     * 
+ */ + public void listSessionEntityTypes( + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListSessionEntityTypesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified session entity type.
+     * 
+ */ + public void getSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetSessionEntityTypeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a session entity type.
+     * If the specified session entity type already exists, overrides the
+     * session entity type.
+     * 
+ */ + public void createSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateSessionEntityTypeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the specified session entity type.
+     * 
+ */ + public void updateSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateSessionEntityTypeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified session entity type.
+     * 
+ */ + public void deleteSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteSessionEntityTypeMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
+   * 
+ */ + public static final class SessionEntityTypesBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SessionEntityTypesBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SessionEntityTypesBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionEntityTypesBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all session entity types in the specified session.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + listSessionEntityTypes( + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest request) { + return blockingUnaryCall( + getChannel(), getListSessionEntityTypesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the specified session entity type.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest request) { + return blockingUnaryCall( + getChannel(), getGetSessionEntityTypeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a session entity type.
+     * If the specified session entity type already exists, overrides the
+     * session entity type.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType createSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest request) { + return blockingUnaryCall( + getChannel(), getCreateSessionEntityTypeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified session entity type.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType updateSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateSessionEntityTypeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified session entity type.
+     * 
+ */ + public com.google.protobuf.Empty deleteSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteSessionEntityTypeMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
+   * 
+ */ + public static final class SessionEntityTypesFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SessionEntityTypesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SessionEntityTypesFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionEntityTypesFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all session entity types in the specified session.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse> + listSessionEntityTypes( + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListSessionEntityTypesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the specified session entity type.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> + getSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetSessionEntityTypeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a session entity type.
+     * If the specified session entity type already exists, overrides the
+     * session entity type.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> + createSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateSessionEntityTypeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the specified session entity type.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> + updateSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateSessionEntityTypeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified session entity type.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteSessionEntityTypeMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_SESSION_ENTITY_TYPES = 0; + private static final int METHODID_GET_SESSION_ENTITY_TYPE = 1; + private static final int METHODID_CREATE_SESSION_ENTITY_TYPE = 2; + private static final int METHODID_UPDATE_SESSION_ENTITY_TYPE = 3; + private static final int METHODID_DELETE_SESSION_ENTITY_TYPE = 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 SessionEntityTypesImplBase serviceImpl; + private final int methodId; + + MethodHandlers(SessionEntityTypesImplBase 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_LIST_SESSION_ENTITY_TYPES: + serviceImpl.listSessionEntityTypes( + (com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse>) + responseObserver); + break; + case METHODID_GET_SESSION_ENTITY_TYPE: + serviceImpl.getSessionEntityType( + (com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType>) + responseObserver); + break; + case METHODID_CREATE_SESSION_ENTITY_TYPE: + serviceImpl.createSessionEntityType( + (com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType>) + responseObserver); + break; + case METHODID_UPDATE_SESSION_ENTITY_TYPE: + serviceImpl.updateSessionEntityType( + (com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType>) + responseObserver); + break; + case METHODID_DELETE_SESSION_ENTITY_TYPE: + serviceImpl.deleteSessionEntityType( + (com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest) 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 SessionEntityTypesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SessionEntityTypesBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SessionEntityTypes"); + } + } + + private static final class SessionEntityTypesFileDescriptorSupplier + extends SessionEntityTypesBaseDescriptorSupplier { + SessionEntityTypesFileDescriptorSupplier() {} + } + + private static final class SessionEntityTypesMethodDescriptorSupplier + extends SessionEntityTypesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + SessionEntityTypesMethodDescriptorSupplier(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 (SessionEntityTypesGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SessionEntityTypesFileDescriptorSupplier()) + .addMethod(getListSessionEntityTypesMethod()) + .addMethod(getGetSessionEntityTypeMethod()) + .addMethod(getCreateSessionEntityTypeMethod()) + .addMethod(getUpdateSessionEntityTypeMethod()) + .addMethod(getDeleteSessionEntityTypeMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java new file mode 100644 index 000000000..ad3ac2aac --- /dev/null +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java @@ -0,0 +1,736 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * A session represents an interaction with a user. You retrieve user input
+ * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
+ * user intent and respond.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/dialogflow/cx/v3beta1/session.proto") +public final class SessionsGrpc { + + private SessionsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.dialogflow.cx.v3beta1.Sessions"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse> + getDetectIntentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DetectIntent", + requestType = com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse> + getDetectIntentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse> + getDetectIntentMethod; + if ((getDetectIntentMethod = SessionsGrpc.getDetectIntentMethod) == null) { + synchronized (SessionsGrpc.class) { + if ((getDetectIntentMethod = SessionsGrpc.getDetectIntentMethod) == null) { + SessionsGrpc.getDetectIntentMethod = + getDetectIntentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DetectIntent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + .getDefaultInstance())) + .setSchemaDescriptor(new SessionsMethodDescriptorSupplier("DetectIntent")) + .build(); + } + } + } + return getDetectIntentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse> + getStreamingDetectIntentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamingDetectIntent", + requestType = com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse> + getStreamingDetectIntentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse> + getStreamingDetectIntentMethod; + if ((getStreamingDetectIntentMethod = SessionsGrpc.getStreamingDetectIntentMethod) == null) { + synchronized (SessionsGrpc.class) { + if ((getStreamingDetectIntentMethod = SessionsGrpc.getStreamingDetectIntentMethod) + == null) { + SessionsGrpc.getStreamingDetectIntentMethod = + getStreamingDetectIntentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "StreamingDetectIntent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SessionsMethodDescriptorSupplier("StreamingDetectIntent")) + .build(); + } + } + } + return getStreamingDetectIntentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse> + getMatchIntentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "MatchIntent", + requestType = com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse> + getMatchIntentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse> + getMatchIntentMethod; + if ((getMatchIntentMethod = SessionsGrpc.getMatchIntentMethod) == null) { + synchronized (SessionsGrpc.class) { + if ((getMatchIntentMethod = SessionsGrpc.getMatchIntentMethod) == null) { + SessionsGrpc.getMatchIntentMethod = + getMatchIntentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "MatchIntent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse + .getDefaultInstance())) + .setSchemaDescriptor(new SessionsMethodDescriptorSupplier("MatchIntent")) + .build(); + } + } + } + return getMatchIntentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse> + getFulfillIntentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FulfillIntent", + requestType = com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse> + getFulfillIntentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse> + getFulfillIntentMethod; + if ((getFulfillIntentMethod = SessionsGrpc.getFulfillIntentMethod) == null) { + synchronized (SessionsGrpc.class) { + if ((getFulfillIntentMethod = SessionsGrpc.getFulfillIntentMethod) == null) { + SessionsGrpc.getFulfillIntentMethod = + getFulfillIntentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FulfillIntent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + .getDefaultInstance())) + .setSchemaDescriptor(new SessionsMethodDescriptorSupplier("FulfillIntent")) + .build(); + } + } + } + return getFulfillIntentMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SessionsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SessionsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionsStub(channel, callOptions); + } + }; + return SessionsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SessionsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SessionsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionsBlockingStub(channel, callOptions); + } + }; + return SessionsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SessionsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SessionsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionsFutureStub(channel, callOptions); + } + }; + return SessionsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * A session represents an interaction with a user. You retrieve user input
+   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
+   * user intent and respond.
+   * 
+ */ + public abstract static class SessionsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Processes a natural language query and returns structured, actionable data
+     * as a result. This method is not idempotent, because it may cause session
+     * entity types to be updated, which in turn might affect results of future
+     * queries.
+     * 
+ */ + public void detectIntent( + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getDetectIntentMethod(), responseObserver); + } + + /** + * + * + *
+     * Processes a natural language query in audio format in a streaming fashion
+     * and returns structured, actionable data as a result. This method is only
+     * available via the gRPC API (not REST).
+     * 
+ */ + public io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest> + streamingDetectIntent( + io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse> + responseObserver) { + return asyncUnimplementedStreamingCall(getStreamingDetectIntentMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns preliminary intent match results, doesn't change the session
+     * status.
+     * 
+ */ + public void matchIntent( + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getMatchIntentMethod(), responseObserver); + } + + /** + * + * + *
+     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent].
+     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from
+     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the behavior is undefined.
+     * 
+ */ + public void fulfillIntent( + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getFulfillIntentMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDetectIntentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse>( + this, METHODID_DETECT_INTENT))) + .addMethod( + getStreamingDetectIntentMethod(), + asyncBidiStreamingCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse>( + this, METHODID_STREAMING_DETECT_INTENT))) + .addMethod( + getMatchIntentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse>( + this, METHODID_MATCH_INTENT))) + .addMethod( + getFulfillIntentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse>( + this, METHODID_FULFILL_INTENT))) + .build(); + } + } + + /** + * + * + *
+   * A session represents an interaction with a user. You retrieve user input
+   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
+   * user intent and respond.
+   * 
+ */ + public static final class SessionsStub extends io.grpc.stub.AbstractAsyncStub { + private SessionsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SessionsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionsStub(channel, callOptions); + } + + /** + * + * + *
+     * Processes a natural language query and returns structured, actionable data
+     * as a result. This method is not idempotent, because it may cause session
+     * entity types to be updated, which in turn might affect results of future
+     * queries.
+     * 
+ */ + public void detectIntent( + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDetectIntentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Processes a natural language query in audio format in a streaming fashion
+     * and returns structured, actionable data as a result. This method is only
+     * available via the gRPC API (not REST).
+     * 
+ */ + public io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest> + streamingDetectIntent( + io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse> + responseObserver) { + return asyncBidiStreamingCall( + getChannel().newCall(getStreamingDetectIntentMethod(), getCallOptions()), + responseObserver); + } + + /** + * + * + *
+     * Returns preliminary intent match results, doesn't change the session
+     * status.
+     * 
+ */ + public void matchIntent( + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getMatchIntentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent].
+     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from
+     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the behavior is undefined.
+     * 
+ */ + public void fulfillIntent( + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getFulfillIntentMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * A session represents an interaction with a user. You retrieve user input
+   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
+   * user intent and respond.
+   * 
+ */ + public static final class SessionsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SessionsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SessionsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Processes a natural language query and returns structured, actionable data
+     * as a result. This method is not idempotent, because it may cause session
+     * entity types to be updated, which in turn might affect results of future
+     * queries.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detectIntent( + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest request) { + return blockingUnaryCall(getChannel(), getDetectIntentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns preliminary intent match results, doesn't change the session
+     * status.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse matchIntent( + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest request) { + return blockingUnaryCall(getChannel(), getMatchIntentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent].
+     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from
+     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the behavior is undefined.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse fulfillIntent( + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest request) { + return blockingUnaryCall(getChannel(), getFulfillIntentMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * A session represents an interaction with a user. You retrieve user input
+   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
+   * user intent and respond.
+   * 
+ */ + public static final class SessionsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SessionsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Processes a natural language query and returns structured, actionable data
+     * as a result. This method is not idempotent, because it may cause session
+     * entity types to be updated, which in turn might affect results of future
+     * queries.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse> + detectIntent(com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest request) { + return futureUnaryCall( + getChannel().newCall(getDetectIntentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns preliminary intent match results, doesn't change the session
+     * status.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse> + matchIntent(com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest request) { + return futureUnaryCall( + getChannel().newCall(getMatchIntentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent].
+     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from
+     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the behavior is undefined.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse> + fulfillIntent(com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest request) { + return futureUnaryCall( + getChannel().newCall(getFulfillIntentMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_DETECT_INTENT = 0; + private static final int METHODID_MATCH_INTENT = 1; + private static final int METHODID_FULFILL_INTENT = 2; + private static final int METHODID_STREAMING_DETECT_INTENT = 3; + + 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 SessionsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(SessionsImplBase 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_DETECT_INTENT: + serviceImpl.detectIntent( + (com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse>) + responseObserver); + break; + case METHODID_MATCH_INTENT: + serviceImpl.matchIntent( + (com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse>) + responseObserver); + break; + case METHODID_FULFILL_INTENT: + serviceImpl.fulfillIntent( + (com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_STREAMING_DETECT_INTENT: + return (io.grpc.stub.StreamObserver) + serviceImpl.streamingDetectIntent( + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse>) + responseObserver); + default: + throw new AssertionError(); + } + } + } + + private abstract static class SessionsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SessionsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Sessions"); + } + } + + private static final class SessionsFileDescriptorSupplier extends SessionsBaseDescriptorSupplier { + SessionsFileDescriptorSupplier() {} + } + + private static final class SessionsMethodDescriptorSupplier extends SessionsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + SessionsMethodDescriptorSupplier(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 (SessionsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SessionsFileDescriptorSupplier()) + .addMethod(getDetectIntentMethod()) + .addMethod(getStreamingDetectIntentMethod()) + .addMethod(getMatchIntentMethod()) + .addMethod(getFulfillIntentMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsGrpc.java new file mode 100644 index 000000000..d78032c42 --- /dev/null +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsGrpc.java @@ -0,0 +1,886 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto") +public final class TransitionRouteGroupsGrpc { + + private TransitionRouteGroupsGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse> + getListTransitionRouteGroupsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListTransitionRouteGroups", + requestType = com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse> + getListTransitionRouteGroupsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse> + getListTransitionRouteGroupsMethod; + if ((getListTransitionRouteGroupsMethod = + TransitionRouteGroupsGrpc.getListTransitionRouteGroupsMethod) + == null) { + synchronized (TransitionRouteGroupsGrpc.class) { + if ((getListTransitionRouteGroupsMethod = + TransitionRouteGroupsGrpc.getListTransitionRouteGroupsMethod) + == null) { + TransitionRouteGroupsGrpc.getListTransitionRouteGroupsMethod = + getListTransitionRouteGroupsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListTransitionRouteGroups")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1 + .ListTransitionRouteGroupsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1 + .ListTransitionRouteGroupsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new TransitionRouteGroupsMethodDescriptorSupplier( + "ListTransitionRouteGroups")) + .build(); + } + } + } + return getListTransitionRouteGroupsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> + getGetTransitionRouteGroupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetTransitionRouteGroup", + requestType = com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> + getGetTransitionRouteGroupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> + getGetTransitionRouteGroupMethod; + if ((getGetTransitionRouteGroupMethod = + TransitionRouteGroupsGrpc.getGetTransitionRouteGroupMethod) + == null) { + synchronized (TransitionRouteGroupsGrpc.class) { + if ((getGetTransitionRouteGroupMethod = + TransitionRouteGroupsGrpc.getGetTransitionRouteGroupMethod) + == null) { + TransitionRouteGroupsGrpc.getGetTransitionRouteGroupMethod = + getGetTransitionRouteGroupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetTransitionRouteGroup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + .getDefaultInstance())) + .setSchemaDescriptor( + new TransitionRouteGroupsMethodDescriptorSupplier( + "GetTransitionRouteGroup")) + .build(); + } + } + } + return getGetTransitionRouteGroupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> + getCreateTransitionRouteGroupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateTransitionRouteGroup", + requestType = com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> + getCreateTransitionRouteGroupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> + getCreateTransitionRouteGroupMethod; + if ((getCreateTransitionRouteGroupMethod = + TransitionRouteGroupsGrpc.getCreateTransitionRouteGroupMethod) + == null) { + synchronized (TransitionRouteGroupsGrpc.class) { + if ((getCreateTransitionRouteGroupMethod = + TransitionRouteGroupsGrpc.getCreateTransitionRouteGroupMethod) + == null) { + TransitionRouteGroupsGrpc.getCreateTransitionRouteGroupMethod = + getCreateTransitionRouteGroupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateTransitionRouteGroup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1 + .CreateTransitionRouteGroupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + .getDefaultInstance())) + .setSchemaDescriptor( + new TransitionRouteGroupsMethodDescriptorSupplier( + "CreateTransitionRouteGroup")) + .build(); + } + } + } + return getCreateTransitionRouteGroupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> + getUpdateTransitionRouteGroupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateTransitionRouteGroup", + requestType = com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> + getUpdateTransitionRouteGroupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> + getUpdateTransitionRouteGroupMethod; + if ((getUpdateTransitionRouteGroupMethod = + TransitionRouteGroupsGrpc.getUpdateTransitionRouteGroupMethod) + == null) { + synchronized (TransitionRouteGroupsGrpc.class) { + if ((getUpdateTransitionRouteGroupMethod = + TransitionRouteGroupsGrpc.getUpdateTransitionRouteGroupMethod) + == null) { + TransitionRouteGroupsGrpc.getUpdateTransitionRouteGroupMethod = + getUpdateTransitionRouteGroupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateTransitionRouteGroup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1 + .UpdateTransitionRouteGroupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup + .getDefaultInstance())) + .setSchemaDescriptor( + new TransitionRouteGroupsMethodDescriptorSupplier( + "UpdateTransitionRouteGroup")) + .build(); + } + } + } + return getUpdateTransitionRouteGroupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest, + com.google.protobuf.Empty> + getDeleteTransitionRouteGroupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteTransitionRouteGroup", + requestType = com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest, + com.google.protobuf.Empty> + getDeleteTransitionRouteGroupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest, + com.google.protobuf.Empty> + getDeleteTransitionRouteGroupMethod; + if ((getDeleteTransitionRouteGroupMethod = + TransitionRouteGroupsGrpc.getDeleteTransitionRouteGroupMethod) + == null) { + synchronized (TransitionRouteGroupsGrpc.class) { + if ((getDeleteTransitionRouteGroupMethod = + TransitionRouteGroupsGrpc.getDeleteTransitionRouteGroupMethod) + == null) { + TransitionRouteGroupsGrpc.getDeleteTransitionRouteGroupMethod = + getDeleteTransitionRouteGroupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteTransitionRouteGroup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1 + .DeleteTransitionRouteGroupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new TransitionRouteGroupsMethodDescriptorSupplier( + "DeleteTransitionRouteGroup")) + .build(); + } + } + } + return getDeleteTransitionRouteGroupMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static TransitionRouteGroupsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TransitionRouteGroupsStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TransitionRouteGroupsStub(channel, callOptions); + } + }; + return TransitionRouteGroupsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static TransitionRouteGroupsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TransitionRouteGroupsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TransitionRouteGroupsBlockingStub(channel, callOptions); + } + }; + return TransitionRouteGroupsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static TransitionRouteGroupsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TransitionRouteGroupsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TransitionRouteGroupsFutureStub(channel, callOptions); + } + }; + return TransitionRouteGroupsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * 
+ */ + public abstract static class TransitionRouteGroupsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns the list of all transition route groups in the specified flow.
+     * 
+ */ + public void listTransitionRouteGroups( + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListTransitionRouteGroupsMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ + public void getTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetTransitionRouteGroupMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in the specified flow.
+     * 
+ */ + public void createTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateTransitionRouteGroupMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ + public void updateTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateTransitionRouteGroupMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ + public void deleteTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteTransitionRouteGroupMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListTransitionRouteGroupsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse>( + this, METHODID_LIST_TRANSITION_ROUTE_GROUPS))) + .addMethod( + getGetTransitionRouteGroupMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup>( + this, METHODID_GET_TRANSITION_ROUTE_GROUP))) + .addMethod( + getCreateTransitionRouteGroupMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup>( + this, METHODID_CREATE_TRANSITION_ROUTE_GROUP))) + .addMethod( + getUpdateTransitionRouteGroupMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup>( + this, METHODID_UPDATE_TRANSITION_ROUTE_GROUP))) + .addMethod( + getDeleteTransitionRouteGroupMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_TRANSITION_ROUTE_GROUP))) + .build(); + } + } + + /** + * + * + *
+   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * 
+ */ + public static final class TransitionRouteGroupsStub + extends io.grpc.stub.AbstractAsyncStub { + private TransitionRouteGroupsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TransitionRouteGroupsStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TransitionRouteGroupsStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all transition route groups in the specified flow.
+     * 
+ */ + public void listTransitionRouteGroups( + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListTransitionRouteGroupsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ + public void getTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetTransitionRouteGroupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in the specified flow.
+     * 
+ */ + public void createTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateTransitionRouteGroupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ + public void updateTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateTransitionRouteGroupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ + public void deleteTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteTransitionRouteGroupMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * 
+ */ + public static final class TransitionRouteGroupsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private TransitionRouteGroupsBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TransitionRouteGroupsBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TransitionRouteGroupsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all transition route groups in the specified flow.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + listTransitionRouteGroups( + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest request) { + return blockingUnaryCall( + getChannel(), getListTransitionRouteGroupsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup getTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest request) { + return blockingUnaryCall( + getChannel(), getGetTransitionRouteGroupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in the specified flow.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup createTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest request) { + return blockingUnaryCall( + getChannel(), getCreateTransitionRouteGroupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup updateTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateTransitionRouteGroupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ + public com.google.protobuf.Empty deleteTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteTransitionRouteGroupMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * 
+ */ + public static final class TransitionRouteGroupsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private TransitionRouteGroupsFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TransitionRouteGroupsFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TransitionRouteGroupsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all transition route groups in the specified flow.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse> + listTransitionRouteGroups( + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListTransitionRouteGroupsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> + getTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetTransitionRouteGroupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in the specified flow.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> + createTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateTransitionRouteGroupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> + updateTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateTransitionRouteGroupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteTransitionRouteGroupMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_TRANSITION_ROUTE_GROUPS = 0; + private static final int METHODID_GET_TRANSITION_ROUTE_GROUP = 1; + private static final int METHODID_CREATE_TRANSITION_ROUTE_GROUP = 2; + private static final int METHODID_UPDATE_TRANSITION_ROUTE_GROUP = 3; + private static final int METHODID_DELETE_TRANSITION_ROUTE_GROUP = 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 TransitionRouteGroupsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(TransitionRouteGroupsImplBase 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_LIST_TRANSITION_ROUTE_GROUPS: + serviceImpl.listTransitionRouteGroups( + (com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse>) + responseObserver); + break; + case METHODID_GET_TRANSITION_ROUTE_GROUP: + serviceImpl.getTransitionRouteGroup( + (com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup>) + responseObserver); + break; + case METHODID_CREATE_TRANSITION_ROUTE_GROUP: + serviceImpl.createTransitionRouteGroup( + (com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup>) + responseObserver); + break; + case METHODID_UPDATE_TRANSITION_ROUTE_GROUP: + serviceImpl.updateTransitionRouteGroup( + (com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup>) + responseObserver); + break; + case METHODID_DELETE_TRANSITION_ROUTE_GROUP: + serviceImpl.deleteTransitionRouteGroup( + (com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest) 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 TransitionRouteGroupsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + TransitionRouteGroupsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("TransitionRouteGroups"); + } + } + + private static final class TransitionRouteGroupsFileDescriptorSupplier + extends TransitionRouteGroupsBaseDescriptorSupplier { + TransitionRouteGroupsFileDescriptorSupplier() {} + } + + private static final class TransitionRouteGroupsMethodDescriptorSupplier + extends TransitionRouteGroupsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + TransitionRouteGroupsMethodDescriptorSupplier(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 (TransitionRouteGroupsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new TransitionRouteGroupsFileDescriptorSupplier()) + .addMethod(getListTransitionRouteGroupsMethod()) + .addMethod(getGetTransitionRouteGroupMethod()) + .addMethod(getCreateTransitionRouteGroupMethod()) + .addMethod(getUpdateTransitionRouteGroupMethod()) + .addMethod(getDeleteTransitionRouteGroupMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsGrpc.java new file mode 100644 index 000000000..66cebc75c --- /dev/null +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsGrpc.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.dialogflow.cx.v3beta1; + +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 managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/dialogflow/cx/v3beta1/version.proto") +public final class VersionsGrpc { + + private VersionsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.dialogflow.cx.v3beta1.Versions"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse> + getListVersionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListVersions", + requestType = com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse> + getListVersionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse> + getListVersionsMethod; + if ((getListVersionsMethod = VersionsGrpc.getListVersionsMethod) == null) { + synchronized (VersionsGrpc.class) { + if ((getListVersionsMethod = VersionsGrpc.getListVersionsMethod) == null) { + VersionsGrpc.getListVersionsMethod = + getListVersionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListVersions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new VersionsMethodDescriptorSupplier("ListVersions")) + .build(); + } + } + } + return getListVersionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest, + com.google.cloud.dialogflow.cx.v3beta1.Version> + getGetVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetVersion", + requestType = com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Version.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest, + com.google.cloud.dialogflow.cx.v3beta1.Version> + getGetVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest, + com.google.cloud.dialogflow.cx.v3beta1.Version> + getGetVersionMethod; + if ((getGetVersionMethod = VersionsGrpc.getGetVersionMethod) == null) { + synchronized (VersionsGrpc.class) { + if ((getGetVersionMethod = VersionsGrpc.getGetVersionMethod) == null) { + VersionsGrpc.getGetVersionMethod = + getGetVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Version.getDefaultInstance())) + .setSchemaDescriptor(new VersionsMethodDescriptorSupplier("GetVersion")) + .build(); + } + } + } + return getGetVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest, + com.google.longrunning.Operation> + getCreateVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateVersion", + requestType = com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest, + com.google.longrunning.Operation> + getCreateVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest, + com.google.longrunning.Operation> + getCreateVersionMethod; + if ((getCreateVersionMethod = VersionsGrpc.getCreateVersionMethod) == null) { + synchronized (VersionsGrpc.class) { + if ((getCreateVersionMethod = VersionsGrpc.getCreateVersionMethod) == null) { + VersionsGrpc.getCreateVersionMethod = + getCreateVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new VersionsMethodDescriptorSupplier("CreateVersion")) + .build(); + } + } + } + return getCreateVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest, + com.google.cloud.dialogflow.cx.v3beta1.Version> + getUpdateVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateVersion", + requestType = com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Version.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest, + com.google.cloud.dialogflow.cx.v3beta1.Version> + getUpdateVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest, + com.google.cloud.dialogflow.cx.v3beta1.Version> + getUpdateVersionMethod; + if ((getUpdateVersionMethod = VersionsGrpc.getUpdateVersionMethod) == null) { + synchronized (VersionsGrpc.class) { + if ((getUpdateVersionMethod = VersionsGrpc.getUpdateVersionMethod) == null) { + VersionsGrpc.getUpdateVersionMethod = + getUpdateVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Version.getDefaultInstance())) + .setSchemaDescriptor(new VersionsMethodDescriptorSupplier("UpdateVersion")) + .build(); + } + } + } + return getUpdateVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest, com.google.protobuf.Empty> + getDeleteVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteVersion", + requestType = com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest, com.google.protobuf.Empty> + getDeleteVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest, com.google.protobuf.Empty> + getDeleteVersionMethod; + if ((getDeleteVersionMethod = VersionsGrpc.getDeleteVersionMethod) == null) { + synchronized (VersionsGrpc.class) { + if ((getDeleteVersionMethod = VersionsGrpc.getDeleteVersionMethod) == null) { + VersionsGrpc.getDeleteVersionMethod = + getDeleteVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new VersionsMethodDescriptorSupplier("DeleteVersion")) + .build(); + } + } + } + return getDeleteVersionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest, + com.google.longrunning.Operation> + getLoadVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "LoadVersion", + requestType = com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest, + com.google.longrunning.Operation> + getLoadVersionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest, + com.google.longrunning.Operation> + getLoadVersionMethod; + if ((getLoadVersionMethod = VersionsGrpc.getLoadVersionMethod) == null) { + synchronized (VersionsGrpc.class) { + if ((getLoadVersionMethod = VersionsGrpc.getLoadVersionMethod) == null) { + VersionsGrpc.getLoadVersionMethod = + getLoadVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "LoadVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new VersionsMethodDescriptorSupplier("LoadVersion")) + .build(); + } + } + } + return getLoadVersionMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static VersionsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public VersionsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new VersionsStub(channel, callOptions); + } + }; + return VersionsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static VersionsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public VersionsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new VersionsBlockingStub(channel, callOptions); + } + }; + return VersionsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static VersionsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public VersionsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new VersionsFutureStub(channel, callOptions); + } + }; + return VersionsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
+   * 
+ */ + public abstract static class VersionsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ + public void listVersions( + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListVersionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ + public void getVersion( + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ + public void createVersion( + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ + public void updateVersion( + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ + public void deleteVersion( + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteVersionMethod(), responseObserver); + } + + /** + * + * + *
+     * Loads a specified version to draft version.
+     * 
+ */ + public void loadVersion( + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getLoadVersionMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListVersionsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse>( + this, METHODID_LIST_VERSIONS))) + .addMethod( + getGetVersionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest, + com.google.cloud.dialogflow.cx.v3beta1.Version>(this, METHODID_GET_VERSION))) + .addMethod( + getCreateVersionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_VERSION))) + .addMethod( + getUpdateVersionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest, + com.google.cloud.dialogflow.cx.v3beta1.Version>( + this, METHODID_UPDATE_VERSION))) + .addMethod( + getDeleteVersionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_VERSION))) + .addMethod( + getLoadVersionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest, + com.google.longrunning.Operation>(this, METHODID_LOAD_VERSION))) + .build(); + } + } + + /** + * + * + *
+   * Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
+   * 
+ */ + public static final class VersionsStub extends io.grpc.stub.AbstractAsyncStub { + private VersionsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected VersionsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new VersionsStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ + public void listVersions( + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListVersionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ + public void getVersion( + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetVersionMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ + public void createVersion( + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ + public void updateVersion( + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ + public void deleteVersion( + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteVersionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Loads a specified version to draft version.
+     * 
+ */ + public void loadVersion( + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getLoadVersionMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
+   * 
+ */ + public static final class VersionsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private VersionsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected VersionsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new VersionsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse listVersions( + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest request) { + return blockingUnaryCall(getChannel(), getListVersionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Version getVersion( + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest request) { + return blockingUnaryCall(getChannel(), getGetVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ + public com.google.longrunning.Operation createVersion( + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest request) { + return blockingUnaryCall(getChannel(), getCreateVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Version updateVersion( + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest request) { + return blockingUnaryCall(getChannel(), getUpdateVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ + public com.google.protobuf.Empty deleteVersion( + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest request) { + return blockingUnaryCall(getChannel(), getDeleteVersionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Loads a specified version to draft version.
+     * 
+ */ + public com.google.longrunning.Operation loadVersion( + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest request) { + return blockingUnaryCall(getChannel(), getLoadVersionMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
+   * 
+ */ + public static final class VersionsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private VersionsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new VersionsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse> + listVersions(com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListVersionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Version> + getVersion(com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createVersion(com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Version> + updateVersion(com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteVersion(com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteVersionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Loads a specified version to draft version.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + loadVersion(com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest request) { + return futureUnaryCall( + getChannel().newCall(getLoadVersionMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_VERSIONS = 0; + private static final int METHODID_GET_VERSION = 1; + private static final int METHODID_CREATE_VERSION = 2; + private static final int METHODID_UPDATE_VERSION = 3; + private static final int METHODID_DELETE_VERSION = 4; + private static final int METHODID_LOAD_VERSION = 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 VersionsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(VersionsImplBase 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_LIST_VERSIONS: + serviceImpl.listVersions( + (com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse>) + responseObserver); + break; + case METHODID_GET_VERSION: + serviceImpl.getVersion( + (com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_VERSION: + serviceImpl.createVersion( + (com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_VERSION: + serviceImpl.updateVersion( + (com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_VERSION: + serviceImpl.deleteVersion( + (com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LOAD_VERSION: + serviceImpl.loadVersion( + (com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest) 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 VersionsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + VersionsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Versions"); + } + } + + private static final class VersionsFileDescriptorSupplier extends VersionsBaseDescriptorSupplier { + VersionsFileDescriptorSupplier() {} + } + + private static final class VersionsMethodDescriptorSupplier extends VersionsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + VersionsMethodDescriptorSupplier(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 (VersionsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new VersionsFileDescriptorSupplier()) + .addMethod(getListVersionsMethod()) + .addMethod(getGetVersionMethod()) + .addMethod(getCreateVersionMethod()) + .addMethod(getUpdateVersionMethod()) + .addMethod(getDeleteVersionMethod()) + .addMethod(getLoadVersionMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksGrpc.java new file mode 100644 index 000000000..7dacfd048 --- /dev/null +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksGrpc.java @@ -0,0 +1,816 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/dialogflow/cx/v3beta1/webhook.proto") +public final class WebhooksGrpc { + + private WebhooksGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.dialogflow.cx.v3beta1.Webhooks"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse> + getListWebhooksMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListWebhooks", + requestType = com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse> + getListWebhooksMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse> + getListWebhooksMethod; + if ((getListWebhooksMethod = WebhooksGrpc.getListWebhooksMethod) == null) { + synchronized (WebhooksGrpc.class) { + if ((getListWebhooksMethod = WebhooksGrpc.getListWebhooksMethod) == null) { + WebhooksGrpc.getListWebhooksMethod = + getListWebhooksMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListWebhooks")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse + .getDefaultInstance())) + .setSchemaDescriptor(new WebhooksMethodDescriptorSupplier("ListWebhooks")) + .build(); + } + } + } + return getListWebhooksMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest, + com.google.cloud.dialogflow.cx.v3beta1.Webhook> + getGetWebhookMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetWebhook", + requestType = com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Webhook.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest, + com.google.cloud.dialogflow.cx.v3beta1.Webhook> + getGetWebhookMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest, + com.google.cloud.dialogflow.cx.v3beta1.Webhook> + getGetWebhookMethod; + if ((getGetWebhookMethod = WebhooksGrpc.getGetWebhookMethod) == null) { + synchronized (WebhooksGrpc.class) { + if ((getGetWebhookMethod = WebhooksGrpc.getGetWebhookMethod) == null) { + WebhooksGrpc.getGetWebhookMethod = + getGetWebhookMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetWebhook")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.getDefaultInstance())) + .setSchemaDescriptor(new WebhooksMethodDescriptorSupplier("GetWebhook")) + .build(); + } + } + } + return getGetWebhookMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest, + com.google.cloud.dialogflow.cx.v3beta1.Webhook> + getCreateWebhookMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateWebhook", + requestType = com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Webhook.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest, + com.google.cloud.dialogflow.cx.v3beta1.Webhook> + getCreateWebhookMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest, + com.google.cloud.dialogflow.cx.v3beta1.Webhook> + getCreateWebhookMethod; + if ((getCreateWebhookMethod = WebhooksGrpc.getCreateWebhookMethod) == null) { + synchronized (WebhooksGrpc.class) { + if ((getCreateWebhookMethod = WebhooksGrpc.getCreateWebhookMethod) == null) { + WebhooksGrpc.getCreateWebhookMethod = + getCreateWebhookMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateWebhook")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.getDefaultInstance())) + .setSchemaDescriptor(new WebhooksMethodDescriptorSupplier("CreateWebhook")) + .build(); + } + } + } + return getCreateWebhookMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest, + com.google.cloud.dialogflow.cx.v3beta1.Webhook> + getUpdateWebhookMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateWebhook", + requestType = com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest.class, + responseType = com.google.cloud.dialogflow.cx.v3beta1.Webhook.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest, + com.google.cloud.dialogflow.cx.v3beta1.Webhook> + getUpdateWebhookMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest, + com.google.cloud.dialogflow.cx.v3beta1.Webhook> + getUpdateWebhookMethod; + if ((getUpdateWebhookMethod = WebhooksGrpc.getUpdateWebhookMethod) == null) { + synchronized (WebhooksGrpc.class) { + if ((getUpdateWebhookMethod = WebhooksGrpc.getUpdateWebhookMethod) == null) { + WebhooksGrpc.getUpdateWebhookMethod = + getUpdateWebhookMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateWebhook")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.getDefaultInstance())) + .setSchemaDescriptor(new WebhooksMethodDescriptorSupplier("UpdateWebhook")) + .build(); + } + } + } + return getUpdateWebhookMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest, com.google.protobuf.Empty> + getDeleteWebhookMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteWebhook", + requestType = com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest, com.google.protobuf.Empty> + getDeleteWebhookMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest, com.google.protobuf.Empty> + getDeleteWebhookMethod; + if ((getDeleteWebhookMethod = WebhooksGrpc.getDeleteWebhookMethod) == null) { + synchronized (WebhooksGrpc.class) { + if ((getDeleteWebhookMethod = WebhooksGrpc.getDeleteWebhookMethod) == null) { + WebhooksGrpc.getDeleteWebhookMethod = + getDeleteWebhookMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteWebhook")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new WebhooksMethodDescriptorSupplier("DeleteWebhook")) + .build(); + } + } + } + return getDeleteWebhookMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static WebhooksStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public WebhooksStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WebhooksStub(channel, callOptions); + } + }; + return WebhooksStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static WebhooksBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public WebhooksBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WebhooksBlockingStub(channel, callOptions); + } + }; + return WebhooksBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static WebhooksFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public WebhooksFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WebhooksFutureStub(channel, callOptions); + } + }; + return WebhooksFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
+   * 
+ */ + public abstract static class WebhooksImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns the list of all webhooks in the specified agent.
+     * 
+ */ + public void listWebhooks( + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListWebhooksMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified webhook.
+     * 
+ */ + public void getWebhook( + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetWebhookMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a webhook in the specified agent.
+     * 
+ */ + public void createWebhook( + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateWebhookMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the specified webhook.
+     * 
+ */ + public void updateWebhook( + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateWebhookMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified webhook.
+     * 
+ */ + public void deleteWebhook( + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteWebhookMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListWebhooksMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest, + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse>( + this, METHODID_LIST_WEBHOOKS))) + .addMethod( + getGetWebhookMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest, + com.google.cloud.dialogflow.cx.v3beta1.Webhook>(this, METHODID_GET_WEBHOOK))) + .addMethod( + getCreateWebhookMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest, + com.google.cloud.dialogflow.cx.v3beta1.Webhook>( + this, METHODID_CREATE_WEBHOOK))) + .addMethod( + getUpdateWebhookMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest, + com.google.cloud.dialogflow.cx.v3beta1.Webhook>( + this, METHODID_UPDATE_WEBHOOK))) + .addMethod( + getDeleteWebhookMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_WEBHOOK))) + .build(); + } + } + + /** + * + * + *
+   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
+   * 
+ */ + public static final class WebhooksStub extends io.grpc.stub.AbstractAsyncStub { + private WebhooksStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected WebhooksStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WebhooksStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all webhooks in the specified agent.
+     * 
+ */ + public void listWebhooks( + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListWebhooksMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves the specified webhook.
+     * 
+ */ + public void getWebhook( + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetWebhookMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a webhook in the specified agent.
+     * 
+ */ + public void createWebhook( + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateWebhookMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the specified webhook.
+     * 
+ */ + public void updateWebhook( + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateWebhookMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified webhook.
+     * 
+ */ + public void deleteWebhook( + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteWebhookMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
+   * 
+ */ + public static final class WebhooksBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private WebhooksBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected WebhooksBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WebhooksBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all webhooks in the specified agent.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse listWebhooks( + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest request) { + return blockingUnaryCall(getChannel(), getListWebhooksMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the specified webhook.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Webhook getWebhook( + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest request) { + return blockingUnaryCall(getChannel(), getGetWebhookMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a webhook in the specified agent.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Webhook createWebhook( + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest request) { + return blockingUnaryCall(getChannel(), getCreateWebhookMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified webhook.
+     * 
+ */ + public com.google.cloud.dialogflow.cx.v3beta1.Webhook updateWebhook( + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest request) { + return blockingUnaryCall(getChannel(), getUpdateWebhookMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified webhook.
+     * 
+ */ + public com.google.protobuf.Empty deleteWebhook( + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest request) { + return blockingUnaryCall(getChannel(), getDeleteWebhookMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
+   * 
+ */ + public static final class WebhooksFutureStub + extends io.grpc.stub.AbstractFutureStub { + private WebhooksFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WebhooksFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the list of all webhooks in the specified agent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse> + listWebhooks(com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest request) { + return futureUnaryCall( + getChannel().newCall(getListWebhooksMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the specified webhook.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Webhook> + getWebhook(com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetWebhookMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a webhook in the specified agent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Webhook> + createWebhook(com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateWebhookMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the specified webhook.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.dialogflow.cx.v3beta1.Webhook> + updateWebhook(com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateWebhookMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified webhook.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteWebhook(com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteWebhookMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_WEBHOOKS = 0; + private static final int METHODID_GET_WEBHOOK = 1; + private static final int METHODID_CREATE_WEBHOOK = 2; + private static final int METHODID_UPDATE_WEBHOOK = 3; + private static final int METHODID_DELETE_WEBHOOK = 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 WebhooksImplBase serviceImpl; + private final int methodId; + + MethodHandlers(WebhooksImplBase 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_LIST_WEBHOOKS: + serviceImpl.listWebhooks( + (com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse>) + responseObserver); + break; + case METHODID_GET_WEBHOOK: + serviceImpl.getWebhook( + (com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_WEBHOOK: + serviceImpl.createWebhook( + (com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_WEBHOOK: + serviceImpl.updateWebhook( + (com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_WEBHOOK: + serviceImpl.deleteWebhook( + (com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest) 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 WebhooksBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + WebhooksBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Webhooks"); + } + } + + private static final class WebhooksFileDescriptorSupplier extends WebhooksBaseDescriptorSupplier { + WebhooksFileDescriptorSupplier() {} + } + + private static final class WebhooksMethodDescriptorSupplier extends WebhooksBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + WebhooksMethodDescriptorSupplier(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 (WebhooksGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new WebhooksFileDescriptorSupplier()) + .addMethod(getListWebhooksMethod()) + .addMethod(getGetWebhookMethod()) + .addMethod(getCreateWebhookMethod()) + .addMethod(getUpdateWebhookMethod()) + .addMethod(getDeleteWebhookMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java.header b/java.header new file mode 100644 index 000000000..3a9b503aa --- /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 000000000..6597fced8 --- /dev/null +++ b/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 000000000..d393326eb --- /dev/null +++ b/pom.xml @@ -0,0 +1,189 @@ + + + 4.0.0 + com.google.cloud + google-cloud-dialogflow-cx-parent + pom + 0.0.1-SNAPSHOT + Google Dialogflow CX Parent + https://github.com/googleapis/java-dialogflow-cx + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.9.2 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-dialogflow-cx.git + scm:git:git@github.com:googleapis/java-dialogflow-cx.git + https://github.com/googleapis/java-dialogflow-cx + HEAD + + + https://github.com/googleapis/java-dialogflow-cx/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-dialogflow-cx-parent + + + + + + com.google.cloud + google-cloud-dialogflow-cx + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-dialogflow-cx-v3beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-dialogflow-cx-v3beta1 + 0.0.1-SNAPSHOT + + + + com.google.cloud + google-cloud-shared-dependencies + 0.8.3 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.objenesis:objenesis + javax.annotation:javax.annotation-api + + + + + + + + + google-cloud-dialogflow-cx + proto-google-cloud-dialogflow-cx-v3beta1 + grpc-google-cloud-dialogflow-cx-v3beta1 + google-cloud-dialogflow-cx-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.1.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-dialogflow-cx-v3beta1/pom.xml b/proto-google-cloud-dialogflow-cx-v3beta1/pom.xml new file mode 100644 index 000000000..8ec090b8e --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-dialogflow-cx-v3beta1 + 0.0.1-SNAPSHOT + proto-google-cloud-dialogflow-cx-v3beta1 + PROTO library for proto-google-cloud-dialogflow-cx-v3beta1 + + com.google.cloud + google-cloud-dialogflow-cx-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 + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Agent.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Agent.java new file mode 100644 index 000000000..99ed32dc1 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Agent.java @@ -0,0 +1,2335 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Agents are best described as Natural Language Understanding (NLU) modules
+ * that transform user requests into actionable data. You can include agents
+ * in your app, product, or service to determine user intent and respond to the
+ * user in a natural way.
+ * After you create an agent, you can add [Intents][google.cloud.dialogflow.cx.v3beta1.Intent],
+ * [Entity Types][google.cloud.dialogflow.cx.v3beta1.EntityType], [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment],
+ * [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], and so on to manage the conversation flows..
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Agent} + */ +public final class Agent extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Agent) + AgentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Agent.newBuilder() to construct. + private Agent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Agent() { + name_ = ""; + displayName_ = ""; + defaultLanguageCode_ = ""; + timeZone_ = ""; + description_ = ""; + avatarUri_ = ""; + startFlow_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Agent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Agent( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + defaultLanguageCode_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + timeZone_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + avatarUri_ = s; + break; + } + case 106: + { + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.Builder subBuilder = null; + if (speechToTextSettings_ != null) { + subBuilder = speechToTextSettings_.toBuilder(); + } + speechToTextSettings_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(speechToTextSettings_); + speechToTextSettings_ = subBuilder.buildPartial(); + } + + break; + } + case 130: + { + java.lang.String s = input.readStringRequireUtf8(); + + startFlow_ = s; + break; + } + case 144: + { + enableStackdriverLogging_ = input.readBool(); + break; + } + case 160: + { + enableSpellCorrection_ = 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.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Agent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Agent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Agent.class, + com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The unique identifier of the agent.
+   * Required for the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method. [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent]
+   * populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The unique identifier of the agent.
+   * Required for the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method. [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent]
+   * populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required. The human-readable name of the agent, unique within the location.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The human-readable name of the agent, unique within the location.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEFAULT_LANGUAGE_CODE_FIELD_NUMBER = 3; + private volatile java.lang.Object defaultLanguageCode_; + /** + * + * + *
+   * Immutable. The default language of the agent as a language tag.
+   * See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+   * for a list of the currently supported language codes.
+   * This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method.
+   * 
+ * + * string default_language_code = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The defaultLanguageCode. + */ + @java.lang.Override + public java.lang.String getDefaultLanguageCode() { + java.lang.Object ref = defaultLanguageCode_; + 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(); + defaultLanguageCode_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The default language of the agent as a language tag.
+   * See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+   * for a list of the currently supported language codes.
+   * This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method.
+   * 
+ * + * string default_language_code = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for defaultLanguageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDefaultLanguageCodeBytes() { + java.lang.Object ref = defaultLanguageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + defaultLanguageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIME_ZONE_FIELD_NUMBER = 5; + private volatile java.lang.Object timeZone_; + /** + * + * + *
+   * Required. The time zone of the agent from the [time zone
+   * database](https://www.iana.org/time-zones), e.g., America/New_York,
+   * Europe/Paris.
+   * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The timeZone. + */ + @java.lang.Override + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + 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(); + timeZone_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The time zone of the agent from the [time zone
+   * database](https://www.iana.org/time-zones), e.g., America/New_York,
+   * Europe/Paris.
+   * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for timeZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 6; + private volatile java.lang.Object description_; + /** + * + * + *
+   * The description of the agent. The maximum length is 500 characters. If
+   * exceeded, the request is rejected.
+   * 
+ * + * string description = 6; + * + * @return The description. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The description of the agent. The maximum length is 500 characters. If
+   * exceeded, the request is rejected.
+   * 
+ * + * string description = 6; + * + * @return The bytes for description. + */ + @java.lang.Override + 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 AVATAR_URI_FIELD_NUMBER = 7; + private volatile java.lang.Object avatarUri_; + /** + * + * + *
+   * The URI of the agent's avatar. Avatars are used throughout the Dialogflow
+   * console and in the self-hosted [Web
+   * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo)
+   * integration.
+   * 
+ * + * string avatar_uri = 7; + * + * @return The avatarUri. + */ + @java.lang.Override + public java.lang.String getAvatarUri() { + java.lang.Object ref = avatarUri_; + 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(); + avatarUri_ = s; + return s; + } + } + /** + * + * + *
+   * The URI of the agent's avatar. Avatars are used throughout the Dialogflow
+   * console and in the self-hosted [Web
+   * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo)
+   * integration.
+   * 
+ * + * string avatar_uri = 7; + * + * @return The bytes for avatarUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAvatarUriBytes() { + java.lang.Object ref = avatarUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + avatarUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SPEECH_TO_TEXT_SETTINGS_FIELD_NUMBER = 13; + private com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speechToTextSettings_; + /** + * + * + *
+   * Speech recognition related settings.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + * + * @return Whether the speechToTextSettings field is set. + */ + @java.lang.Override + public boolean hasSpeechToTextSettings() { + return speechToTextSettings_ != null; + } + /** + * + * + *
+   * Speech recognition related settings.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + * + * @return The speechToTextSettings. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings getSpeechToTextSettings() { + return speechToTextSettings_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.getDefaultInstance() + : speechToTextSettings_; + } + /** + * + * + *
+   * Speech recognition related settings.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettingsOrBuilder + getSpeechToTextSettingsOrBuilder() { + return getSpeechToTextSettings(); + } + + public static final int START_FLOW_FIELD_NUMBER = 16; + private volatile java.lang.Object startFlow_; + /** + * + * + *
+   * Immutable. Name of the start flow in this agent. A start flow will be automatically
+   * created when the agent is created, and can only be deleted by deleting the
+   * agent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string start_flow = 16 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The startFlow. + */ + @java.lang.Override + public java.lang.String getStartFlow() { + java.lang.Object ref = startFlow_; + 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(); + startFlow_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. Name of the start flow in this agent. A start flow will be automatically
+   * created when the agent is created, and can only be deleted by deleting the
+   * agent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string start_flow = 16 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for startFlow. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStartFlowBytes() { + java.lang.Object ref = startFlow_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + startFlow_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLE_STACKDRIVER_LOGGING_FIELD_NUMBER = 18; + private boolean enableStackdriverLogging_; + /** + * + * + *
+   * Indicates if stackdriver logging is enabled for the agent.
+   * 
+ * + * bool enable_stackdriver_logging = 18; + * + * @return The enableStackdriverLogging. + */ + @java.lang.Override + public boolean getEnableStackdriverLogging() { + return enableStackdriverLogging_; + } + + public static final int ENABLE_SPELL_CORRECTION_FIELD_NUMBER = 20; + private boolean enableSpellCorrection_; + /** + * + * + *
+   * Indicates if automatic spell correction is enabled in detect intent
+   * requests.
+   * 
+ * + * bool enable_spell_correction = 20; + * + * @return The enableSpellCorrection. + */ + @java.lang.Override + public boolean getEnableSpellCorrection() { + return enableSpellCorrection_; + } + + 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 (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!getDefaultLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, defaultLanguageCode_); + } + if (!getTimeZoneBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, timeZone_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_); + } + if (!getAvatarUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, avatarUri_); + } + if (speechToTextSettings_ != null) { + output.writeMessage(13, getSpeechToTextSettings()); + } + if (!getStartFlowBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, startFlow_); + } + if (enableStackdriverLogging_ != false) { + output.writeBool(18, enableStackdriverLogging_); + } + if (enableSpellCorrection_ != false) { + output.writeBool(20, enableSpellCorrection_); + } + 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 (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!getDefaultLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, defaultLanguageCode_); + } + if (!getTimeZoneBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, timeZone_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_); + } + if (!getAvatarUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, avatarUri_); + } + if (speechToTextSettings_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(13, getSpeechToTextSettings()); + } + if (!getStartFlowBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, startFlow_); + } + if (enableStackdriverLogging_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(18, enableStackdriverLogging_); + } + if (enableSpellCorrection_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(20, enableSpellCorrection_); + } + 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.dialogflow.cx.v3beta1.Agent)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Agent other = + (com.google.cloud.dialogflow.cx.v3beta1.Agent) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDefaultLanguageCode().equals(other.getDefaultLanguageCode())) return false; + if (!getTimeZone().equals(other.getTimeZone())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getAvatarUri().equals(other.getAvatarUri())) return false; + if (hasSpeechToTextSettings() != other.hasSpeechToTextSettings()) return false; + if (hasSpeechToTextSettings()) { + if (!getSpeechToTextSettings().equals(other.getSpeechToTextSettings())) return false; + } + if (!getStartFlow().equals(other.getStartFlow())) return false; + if (getEnableStackdriverLogging() != other.getEnableStackdriverLogging()) return false; + if (getEnableSpellCorrection() != other.getEnableSpellCorrection()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DEFAULT_LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getDefaultLanguageCode().hashCode(); + hash = (37 * hash) + TIME_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getTimeZone().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + AVATAR_URI_FIELD_NUMBER; + hash = (53 * hash) + getAvatarUri().hashCode(); + if (hasSpeechToTextSettings()) { + hash = (37 * hash) + SPEECH_TO_TEXT_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getSpeechToTextSettings().hashCode(); + } + hash = (37 * hash) + START_FLOW_FIELD_NUMBER; + hash = (53 * hash) + getStartFlow().hashCode(); + hash = (37 * hash) + ENABLE_STACKDRIVER_LOGGING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableStackdriverLogging()); + hash = (37 * hash) + ENABLE_SPELL_CORRECTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableSpellCorrection()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Agent parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Agent 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.dialogflow.cx.v3beta1.Agent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Agent 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.dialogflow.cx.v3beta1.Agent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Agent parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Agent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Agent 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.dialogflow.cx.v3beta1.Agent parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Agent 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.dialogflow.cx.v3beta1.Agent parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Agent 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.dialogflow.cx.v3beta1.Agent 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; + } + /** + * + * + *
+   * Agents are best described as Natural Language Understanding (NLU) modules
+   * that transform user requests into actionable data. You can include agents
+   * in your app, product, or service to determine user intent and respond to the
+   * user in a natural way.
+   * After you create an agent, you can add [Intents][google.cloud.dialogflow.cx.v3beta1.Intent],
+   * [Entity Types][google.cloud.dialogflow.cx.v3beta1.EntityType], [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment],
+   * [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], and so on to manage the conversation flows..
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Agent} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Agent) + com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Agent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Agent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Agent.class, + com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.Agent.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_ = ""; + + displayName_ = ""; + + defaultLanguageCode_ = ""; + + timeZone_ = ""; + + description_ = ""; + + avatarUri_ = ""; + + if (speechToTextSettingsBuilder_ == null) { + speechToTextSettings_ = null; + } else { + speechToTextSettings_ = null; + speechToTextSettingsBuilder_ = null; + } + startFlow_ = ""; + + enableStackdriverLogging_ = false; + + enableSpellCorrection_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Agent_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Agent getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Agent.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Agent build() { + com.google.cloud.dialogflow.cx.v3beta1.Agent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Agent buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Agent result = + new com.google.cloud.dialogflow.cx.v3beta1.Agent(this); + result.name_ = name_; + result.displayName_ = displayName_; + result.defaultLanguageCode_ = defaultLanguageCode_; + result.timeZone_ = timeZone_; + result.description_ = description_; + result.avatarUri_ = avatarUri_; + if (speechToTextSettingsBuilder_ == null) { + result.speechToTextSettings_ = speechToTextSettings_; + } else { + result.speechToTextSettings_ = speechToTextSettingsBuilder_.build(); + } + result.startFlow_ = startFlow_; + result.enableStackdriverLogging_ = enableStackdriverLogging_; + result.enableSpellCorrection_ = enableSpellCorrection_; + 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.dialogflow.cx.v3beta1.Agent) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.Agent) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Agent other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.Agent.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getDefaultLanguageCode().isEmpty()) { + defaultLanguageCode_ = other.defaultLanguageCode_; + onChanged(); + } + if (!other.getTimeZone().isEmpty()) { + timeZone_ = other.timeZone_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getAvatarUri().isEmpty()) { + avatarUri_ = other.avatarUri_; + onChanged(); + } + if (other.hasSpeechToTextSettings()) { + mergeSpeechToTextSettings(other.getSpeechToTextSettings()); + } + if (!other.getStartFlow().isEmpty()) { + startFlow_ = other.startFlow_; + onChanged(); + } + if (other.getEnableStackdriverLogging() != false) { + setEnableStackdriverLogging(other.getEnableStackdriverLogging()); + } + if (other.getEnableSpellCorrection() != false) { + setEnableSpellCorrection(other.getEnableSpellCorrection()); + } + 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.dialogflow.cx.v3beta1.Agent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.dialogflow.cx.v3beta1.Agent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The unique identifier of the agent.
+     * Required for the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method. [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unique identifier of the agent.
+     * Required for the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method. [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unique identifier of the agent.
+     * Required for the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method. [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the agent.
+     * Required for the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method. [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the agent.
+     * Required for the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method. [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The human-readable name of the agent, unique within the location.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the agent, unique within the location.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the agent, unique within the location.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the agent, unique within the location.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the agent, unique within the location.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object defaultLanguageCode_ = ""; + /** + * + * + *
+     * Immutable. The default language of the agent as a language tag.
+     * See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method.
+     * 
+ * + * string default_language_code = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The defaultLanguageCode. + */ + public java.lang.String getDefaultLanguageCode() { + java.lang.Object ref = defaultLanguageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + defaultLanguageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The default language of the agent as a language tag.
+     * See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method.
+     * 
+ * + * string default_language_code = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for defaultLanguageCode. + */ + public com.google.protobuf.ByteString getDefaultLanguageCodeBytes() { + java.lang.Object ref = defaultLanguageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + defaultLanguageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The default language of the agent as a language tag.
+     * See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method.
+     * 
+ * + * string default_language_code = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The defaultLanguageCode to set. + * @return This builder for chaining. + */ + public Builder setDefaultLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + defaultLanguageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The default language of the agent as a language tag.
+     * See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method.
+     * 
+ * + * string default_language_code = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearDefaultLanguageCode() { + + defaultLanguageCode_ = getDefaultInstance().getDefaultLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The default language of the agent as a language tag.
+     * See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method.
+     * 
+ * + * string default_language_code = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for defaultLanguageCode to set. + * @return This builder for chaining. + */ + public Builder setDefaultLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + defaultLanguageCode_ = value; + onChanged(); + return this; + } + + private java.lang.Object timeZone_ = ""; + /** + * + * + *
+     * Required. The time zone of the agent from the [time zone
+     * database](https://www.iana.org/time-zones), e.g., America/New_York,
+     * Europe/Paris.
+     * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The timeZone. + */ + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The time zone of the agent from the [time zone
+     * database](https://www.iana.org/time-zones), e.g., America/New_York,
+     * Europe/Paris.
+     * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for timeZone. + */ + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The time zone of the agent from the [time zone
+     * database](https://www.iana.org/time-zones), e.g., America/New_York,
+     * Europe/Paris.
+     * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + timeZone_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The time zone of the agent from the [time zone
+     * database](https://www.iana.org/time-zones), e.g., America/New_York,
+     * Europe/Paris.
+     * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTimeZone() { + + timeZone_ = getDefaultInstance().getTimeZone(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The time zone of the agent from the [time zone
+     * database](https://www.iana.org/time-zones), e.g., America/New_York,
+     * Europe/Paris.
+     * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + timeZone_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * The description of the agent. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 6; + * + * @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; + } + } + /** + * + * + *
+     * The description of the agent. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 6; + * + * @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; + } + } + /** + * + * + *
+     * The description of the agent. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 6; + * + * @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; + } + /** + * + * + *
+     * The description of the agent. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 6; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the agent. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 6; + * + * @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 java.lang.Object avatarUri_ = ""; + /** + * + * + *
+     * The URI of the agent's avatar. Avatars are used throughout the Dialogflow
+     * console and in the self-hosted [Web
+     * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo)
+     * integration.
+     * 
+ * + * string avatar_uri = 7; + * + * @return The avatarUri. + */ + public java.lang.String getAvatarUri() { + java.lang.Object ref = avatarUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + avatarUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URI of the agent's avatar. Avatars are used throughout the Dialogflow
+     * console and in the self-hosted [Web
+     * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo)
+     * integration.
+     * 
+ * + * string avatar_uri = 7; + * + * @return The bytes for avatarUri. + */ + public com.google.protobuf.ByteString getAvatarUriBytes() { + java.lang.Object ref = avatarUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + avatarUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URI of the agent's avatar. Avatars are used throughout the Dialogflow
+     * console and in the self-hosted [Web
+     * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo)
+     * integration.
+     * 
+ * + * string avatar_uri = 7; + * + * @param value The avatarUri to set. + * @return This builder for chaining. + */ + public Builder setAvatarUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + avatarUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of the agent's avatar. Avatars are used throughout the Dialogflow
+     * console and in the self-hosted [Web
+     * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo)
+     * integration.
+     * 
+ * + * string avatar_uri = 7; + * + * @return This builder for chaining. + */ + public Builder clearAvatarUri() { + + avatarUri_ = getDefaultInstance().getAvatarUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of the agent's avatar. Avatars are used throughout the Dialogflow
+     * console and in the self-hosted [Web
+     * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo)
+     * integration.
+     * 
+ * + * string avatar_uri = 7; + * + * @param value The bytes for avatarUri to set. + * @return This builder for chaining. + */ + public Builder setAvatarUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + avatarUri_ = value; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speechToTextSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings, + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettingsOrBuilder> + speechToTextSettingsBuilder_; + /** + * + * + *
+     * Speech recognition related settings.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + * + * @return Whether the speechToTextSettings field is set. + */ + public boolean hasSpeechToTextSettings() { + return speechToTextSettingsBuilder_ != null || speechToTextSettings_ != null; + } + /** + * + * + *
+     * Speech recognition related settings.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + * + * @return The speechToTextSettings. + */ + public com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings getSpeechToTextSettings() { + if (speechToTextSettingsBuilder_ == null) { + return speechToTextSettings_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.getDefaultInstance() + : speechToTextSettings_; + } else { + return speechToTextSettingsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Speech recognition related settings.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + */ + public Builder setSpeechToTextSettings( + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings value) { + if (speechToTextSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + speechToTextSettings_ = value; + onChanged(); + } else { + speechToTextSettingsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Speech recognition related settings.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + */ + public Builder setSpeechToTextSettings( + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.Builder builderForValue) { + if (speechToTextSettingsBuilder_ == null) { + speechToTextSettings_ = builderForValue.build(); + onChanged(); + } else { + speechToTextSettingsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Speech recognition related settings.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + */ + public Builder mergeSpeechToTextSettings( + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings value) { + if (speechToTextSettingsBuilder_ == null) { + if (speechToTextSettings_ != null) { + speechToTextSettings_ = + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.newBuilder( + speechToTextSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + speechToTextSettings_ = value; + } + onChanged(); + } else { + speechToTextSettingsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Speech recognition related settings.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + */ + public Builder clearSpeechToTextSettings() { + if (speechToTextSettingsBuilder_ == null) { + speechToTextSettings_ = null; + onChanged(); + } else { + speechToTextSettings_ = null; + speechToTextSettingsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Speech recognition related settings.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.Builder + getSpeechToTextSettingsBuilder() { + + onChanged(); + return getSpeechToTextSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Speech recognition related settings.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettingsOrBuilder + getSpeechToTextSettingsOrBuilder() { + if (speechToTextSettingsBuilder_ != null) { + return speechToTextSettingsBuilder_.getMessageOrBuilder(); + } else { + return speechToTextSettings_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.getDefaultInstance() + : speechToTextSettings_; + } + } + /** + * + * + *
+     * Speech recognition related settings.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings, + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettingsOrBuilder> + getSpeechToTextSettingsFieldBuilder() { + if (speechToTextSettingsBuilder_ == null) { + speechToTextSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings, + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettingsOrBuilder>( + getSpeechToTextSettings(), getParentForChildren(), isClean()); + speechToTextSettings_ = null; + } + return speechToTextSettingsBuilder_; + } + + private java.lang.Object startFlow_ = ""; + /** + * + * + *
+     * Immutable. Name of the start flow in this agent. A start flow will be automatically
+     * created when the agent is created, and can only be deleted by deleting the
+     * agent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string start_flow = 16 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The startFlow. + */ + public java.lang.String getStartFlow() { + java.lang.Object ref = startFlow_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startFlow_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. Name of the start flow in this agent. A start flow will be automatically
+     * created when the agent is created, and can only be deleted by deleting the
+     * agent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string start_flow = 16 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for startFlow. + */ + public com.google.protobuf.ByteString getStartFlowBytes() { + java.lang.Object ref = startFlow_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + startFlow_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. Name of the start flow in this agent. A start flow will be automatically
+     * created when the agent is created, and can only be deleted by deleting the
+     * agent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string start_flow = 16 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The startFlow to set. + * @return This builder for chaining. + */ + public Builder setStartFlow(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + startFlow_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Name of the start flow in this agent. A start flow will be automatically
+     * created when the agent is created, and can only be deleted by deleting the
+     * agent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string start_flow = 16 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearStartFlow() { + + startFlow_ = getDefaultInstance().getStartFlow(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Name of the start flow in this agent. A start flow will be automatically
+     * created when the agent is created, and can only be deleted by deleting the
+     * agent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string start_flow = 16 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for startFlow to set. + * @return This builder for chaining. + */ + public Builder setStartFlowBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + startFlow_ = value; + onChanged(); + return this; + } + + private boolean enableStackdriverLogging_; + /** + * + * + *
+     * Indicates if stackdriver logging is enabled for the agent.
+     * 
+ * + * bool enable_stackdriver_logging = 18; + * + * @return The enableStackdriverLogging. + */ + @java.lang.Override + public boolean getEnableStackdriverLogging() { + return enableStackdriverLogging_; + } + /** + * + * + *
+     * Indicates if stackdriver logging is enabled for the agent.
+     * 
+ * + * bool enable_stackdriver_logging = 18; + * + * @param value The enableStackdriverLogging to set. + * @return This builder for chaining. + */ + public Builder setEnableStackdriverLogging(boolean value) { + + enableStackdriverLogging_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates if stackdriver logging is enabled for the agent.
+     * 
+ * + * bool enable_stackdriver_logging = 18; + * + * @return This builder for chaining. + */ + public Builder clearEnableStackdriverLogging() { + + enableStackdriverLogging_ = false; + onChanged(); + return this; + } + + private boolean enableSpellCorrection_; + /** + * + * + *
+     * Indicates if automatic spell correction is enabled in detect intent
+     * requests.
+     * 
+ * + * bool enable_spell_correction = 20; + * + * @return The enableSpellCorrection. + */ + @java.lang.Override + public boolean getEnableSpellCorrection() { + return enableSpellCorrection_; + } + /** + * + * + *
+     * Indicates if automatic spell correction is enabled in detect intent
+     * requests.
+     * 
+ * + * bool enable_spell_correction = 20; + * + * @param value The enableSpellCorrection to set. + * @return This builder for chaining. + */ + public Builder setEnableSpellCorrection(boolean value) { + + enableSpellCorrection_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates if automatic spell correction is enabled in detect intent
+     * requests.
+     * 
+ * + * bool enable_spell_correction = 20; + * + * @return This builder for chaining. + */ + public Builder clearEnableSpellCorrection() { + + enableSpellCorrection_ = 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.dialogflow.cx.v3beta1.Agent) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Agent) + private static final com.google.cloud.dialogflow.cx.v3beta1.Agent DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Agent(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Agent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Agent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Agent(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.dialogflow.cx.v3beta1.Agent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentName.java new file mode 100644 index 000000000..679030d83 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentName.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.dialogflow.cx.v3beta1; + +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 AgentName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String agent; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private AgentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + } + + public static AgentName of(String project, String location, String agent) { + return newBuilder().setProject(project).setLocation(location).setAgent(agent).build(); + } + + public static String format(String project, String location, String agent) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .build() + .toString(); + } + + public static AgentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "AgentName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("agent")); + } + + 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 (AgentName 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("agent", agent); + 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, "agent", agent); + } + + /** Builder for AgentName. */ + public static class Builder { + + private String project; + private String location; + private String agent; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAgent(String agent) { + this.agent = agent; + return this; + } + + private Builder() {} + + private Builder(AgentName agentName) { + project = agentName.project; + location = agentName.location; + agent = agentName.agent; + } + + public AgentName build() { + return new AgentName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AgentName) { + AgentName that = (AgentName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.agent.equals(that.agent)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= agent.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentOrBuilder.java new file mode 100644 index 000000000..10b3e8539 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentOrBuilder.java @@ -0,0 +1,304 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface AgentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Agent) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique identifier of the agent.
+   * Required for the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method. [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent]
+   * populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The unique identifier of the agent.
+   * Required for the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method. [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent]
+   * populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The human-readable name of the agent, unique within the location.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The human-readable name of the agent, unique within the location.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Immutable. The default language of the agent as a language tag.
+   * See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+   * for a list of the currently supported language codes.
+   * This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method.
+   * 
+ * + * string default_language_code = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The defaultLanguageCode. + */ + java.lang.String getDefaultLanguageCode(); + /** + * + * + *
+   * Immutable. The default language of the agent as a language tag.
+   * See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+   * for a list of the currently supported language codes.
+   * This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method.
+   * 
+ * + * string default_language_code = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for defaultLanguageCode. + */ + com.google.protobuf.ByteString getDefaultLanguageCodeBytes(); + + /** + * + * + *
+   * Required. The time zone of the agent from the [time zone
+   * database](https://www.iana.org/time-zones), e.g., America/New_York,
+   * Europe/Paris.
+   * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The timeZone. + */ + java.lang.String getTimeZone(); + /** + * + * + *
+   * Required. The time zone of the agent from the [time zone
+   * database](https://www.iana.org/time-zones), e.g., America/New_York,
+   * Europe/Paris.
+   * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for timeZone. + */ + com.google.protobuf.ByteString getTimeZoneBytes(); + + /** + * + * + *
+   * The description of the agent. The maximum length is 500 characters. If
+   * exceeded, the request is rejected.
+   * 
+ * + * string description = 6; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * The description of the agent. The maximum length is 500 characters. If
+   * exceeded, the request is rejected.
+   * 
+ * + * string description = 6; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * The URI of the agent's avatar. Avatars are used throughout the Dialogflow
+   * console and in the self-hosted [Web
+   * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo)
+   * integration.
+   * 
+ * + * string avatar_uri = 7; + * + * @return The avatarUri. + */ + java.lang.String getAvatarUri(); + /** + * + * + *
+   * The URI of the agent's avatar. Avatars are used throughout the Dialogflow
+   * console and in the self-hosted [Web
+   * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo)
+   * integration.
+   * 
+ * + * string avatar_uri = 7; + * + * @return The bytes for avatarUri. + */ + com.google.protobuf.ByteString getAvatarUriBytes(); + + /** + * + * + *
+   * Speech recognition related settings.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + * + * @return Whether the speechToTextSettings field is set. + */ + boolean hasSpeechToTextSettings(); + /** + * + * + *
+   * Speech recognition related settings.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + * + * @return The speechToTextSettings. + */ + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings getSpeechToTextSettings(); + /** + * + * + *
+   * Speech recognition related settings.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings speech_to_text_settings = 13; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettingsOrBuilder + getSpeechToTextSettingsOrBuilder(); + + /** + * + * + *
+   * Immutable. Name of the start flow in this agent. A start flow will be automatically
+   * created when the agent is created, and can only be deleted by deleting the
+   * agent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string start_flow = 16 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The startFlow. + */ + java.lang.String getStartFlow(); + /** + * + * + *
+   * Immutable. Name of the start flow in this agent. A start flow will be automatically
+   * created when the agent is created, and can only be deleted by deleting the
+   * agent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string start_flow = 16 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for startFlow. + */ + com.google.protobuf.ByteString getStartFlowBytes(); + + /** + * + * + *
+   * Indicates if stackdriver logging is enabled for the agent.
+   * 
+ * + * bool enable_stackdriver_logging = 18; + * + * @return The enableStackdriverLogging. + */ + boolean getEnableStackdriverLogging(); + + /** + * + * + *
+   * Indicates if automatic spell correction is enabled in detect intent
+   * requests.
+   * 
+ * + * bool enable_spell_correction = 20; + * + * @return The enableSpellCorrection. + */ + boolean getEnableSpellCorrection(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentProto.java new file mode 100644 index 000000000..ee7514b79 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentProto.java @@ -0,0 +1,305 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class AgentProto { + private AgentProto() {} + + 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_dialogflow_cx_v3beta1_SpeechToTextSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechToTextSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Agent_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Agent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_GetAgentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_GetAgentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateAgentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateAgentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateAgentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateAgentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteAgentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteAgentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_RestoreAgentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_RestoreAgentRequest_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/dialogflow/cx/v3beta1/age" + + "nt.proto\022\"google.cloud.dialogflow.cx.v3b" + + "eta1\032\034google/api/annotations.proto\032\027goog" + + "le/api/client.proto\032\037google/api/field_be" + + "havior.proto\032\031google/api/resource.proto\032" + + "-google/cloud/dialogflow/cx/v3beta1/flow" + + ".proto\032#google/longrunning/operations.pr" + + "oto\032\033google/protobuf/empty.proto\032 google" + + "/protobuf/field_mask.proto\"8\n\024SpeechToTe" + + "xtSettings\022 \n\030enable_speech_adaptation\030\001" + + " \001(\010\"\317\003\n\005Agent\022\014\n\004name\030\001 \001(\t\022\031\n\014display_" + + "name\030\002 \001(\tB\003\340A\002\022\"\n\025default_language_code" + + "\030\003 \001(\tB\003\340A\005\022\026\n\ttime_zone\030\005 \001(\tB\003\340A\002\022\023\n\013d" + + "escription\030\006 \001(\t\022\022\n\navatar_uri\030\007 \001(\t\022Y\n\027" + + "speech_to_text_settings\030\r \001(\01328.google.c" + + "loud.dialogflow.cx.v3beta1.SpeechToTextS" + + "ettings\022:\n\nstart_flow\030\020 \001(\tB&\340A\005\372A \n\036dia" + + "logflow.googleapis.com/Flow\022\"\n\032enable_st" + + "ackdriver_logging\030\022 \001(\010\022\037\n\027enable_spell_" + + "correction\030\024 \001(\010:\\\352AY\n\037dialogflow.google" + + "apis.com/Agent\0226projects/{project}/locat" + + "ions/{location}/agents/{agent}\"s\n\021ListAg" + + "entsRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037dia" + + "logflow.googleapis.com/Agent\022\021\n\tpage_siz" + + "e\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"h\n\022ListAgent" + + "sResponse\0229\n\006agents\030\001 \003(\0132).google.cloud" + + ".dialogflow.cx.v3beta1.Agent\022\027\n\017next_pag" + + "e_token\030\002 \001(\t\"H\n\017GetAgentRequest\0225\n\004name" + + "\030\001 \001(\tB\'\340A\002\372A!\n\037dialogflow.googleapis.co" + + "m/Agent\"\214\001\n\022CreateAgentRequest\0227\n\006parent" + + "\030\001 \001(\tB\'\340A\002\372A!\022\037dialogflow.googleapis.co" + + "m/Agent\022=\n\005agent\030\002 \001(\0132).google.cloud.di" + + "alogflow.cx.v3beta1.AgentB\003\340A\002\"\204\001\n\022Updat" + + "eAgentRequest\022=\n\005agent\030\001 \001(\0132).google.cl" + + "oud.dialogflow.cx.v3beta1.AgentB\003\340A\002\022/\n\013" + + "update_mask\030\002 \001(\0132\032.google.protobuf.Fiel" + + "dMask\"K\n\022DeleteAgentRequest\0225\n\004name\030\001 \001(" + + "\tB\'\340A\002\372A!\n\037dialogflow.googleapis.com/Age" + + "nt\"c\n\022ExportAgentRequest\0225\n\004name\030\001 \001(\tB\'" + + "\340A\002\372A!\n\037dialogflow.googleapis.com/Agent\022" + + "\026\n\tagent_uri\030\002 \001(\tB\003\340A\001\"L\n\023ExportAgentRe" + + "sponse\022\023\n\tagent_uri\030\001 \001(\tH\000\022\027\n\ragent_con" + + "tent\030\002 \001(\014H\000B\007\n\005agent\"\203\001\n\023RestoreAgentRe" + + "quest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037dialogflow." + + "googleapis.com/Agent\022\023\n\tagent_uri\030\002 \001(\tH" + + "\000\022\027\n\ragent_content\030\003 \001(\014H\000B\007\n\005agent2\327\013\n\006" + + "Agents\022\275\001\n\nListAgents\0225.google.cloud.dia" + + "logflow.cx.v3beta1.ListAgentsRequest\0326.g" + + "oogle.cloud.dialogflow.cx.v3beta1.ListAg" + + "entsResponse\"@\202\323\344\223\0021\022//v3beta1/{parent=p" + + "rojects/*/locations/*}/agents\332A\006parent\022\252" + + "\001\n\010GetAgent\0223.google.cloud.dialogflow.cx" + + ".v3beta1.GetAgentRequest\032).google.cloud." + + "dialogflow.cx.v3beta1.Agent\">\202\323\344\223\0021\022//v3" + + "beta1/{name=projects/*/locations/*/agent" + + "s/*}\332A\004name\022\277\001\n\013CreateAgent\0226.google.clo" + + "ud.dialogflow.cx.v3beta1.CreateAgentRequ" + + "est\032).google.cloud.dialogflow.cx.v3beta1" + + ".Agent\"M\202\323\344\223\0028\"//v3beta1/{parent=project" + + "s/*/locations/*}/agents:\005agent\332A\014parent," + + "agent\022\312\001\n\013UpdateAgent\0226.google.cloud.dia" + + "logflow.cx.v3beta1.UpdateAgentRequest\032)." + + "google.cloud.dialogflow.cx.v3beta1.Agent" + + "\"X\202\323\344\223\002>25/v3beta1/{agent.name=projects/" + + "*/locations/*/agents/*}:\005agent\332A\021agent,u" + + "pdate_mask\022\235\001\n\013DeleteAgent\0226.google.clou" + + "d.dialogflow.cx.v3beta1.DeleteAgentReque" + + "st\032\026.google.protobuf.Empty\">\202\323\344\223\0021*//v3b" + + "eta1/{name=projects/*/locations/*/agents" + + "/*}\332A\004name\022\327\001\n\013ExportAgent\0226.google.clou" + + "d.dialogflow.cx.v3beta1.ExportAgentReque" + + "st\032\035.google.longrunning.Operation\"q\202\323\344\223\002" + + ";\"6/v3beta1/{name=projects/*/locations/*" + + "/agents/*}:export:\001*\312A-\n\023ExportAgentResp" + + "onse\022\026google.protobuf.Struct\022\334\001\n\014Restore" + + "Agent\0227.google.cloud.dialogflow.cx.v3bet" + + "a1.RestoreAgentRequest\032\035.google.longrunn" + + "ing.Operation\"t\202\323\344\223\002<\"7/v3beta1/{name=pr" + + "ojects/*/locations/*/agents/*}:restore:\001" + + "*\312A/\n\025google.protobuf.Empty\022\026google.prot" + + "obuf.Struct\032x\312A\031dialogflow.googleapis.co" + + "m\322AYhttps://www.googleapis.com/auth/clou" + + "d-platform,https://www.googleapis.com/au" + + "th/dialogflowB\251\001\n&com.google.cloud.dialo" + + "gflow.cx.v3beta1B\nAgentProtoP\001ZDgoogle.g" + + "olang.org/genproto/googleapis/cloud/dial" + + "ogflow/cx/v3beta1;cx\370\001\001\242\002\002DF\252\002\"Google.Cl" + + "oud.Dialogflow.Cx.V3Beta1b\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.api.ResourceProto.getDescriptor(), + com.google.cloud.dialogflow.cx.v3beta1.FlowProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechToTextSettings_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechToTextSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechToTextSettings_descriptor, + new java.lang.String[] { + "EnableSpeechAdaptation", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Agent_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_Agent_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Agent_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "DefaultLanguageCode", + "TimeZone", + "Description", + "AvatarUri", + "SpeechToTextSettings", + "StartFlow", + "EnableStackdriverLogging", + "EnableSpellCorrection", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsResponse_descriptor, + new java.lang.String[] { + "Agents", "NextPageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetAgentRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetAgentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_GetAgentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateAgentRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateAgentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateAgentRequest_descriptor, + new java.lang.String[] { + "Parent", "Agent", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateAgentRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateAgentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateAgentRequest_descriptor, + new java.lang.String[] { + "Agent", "UpdateMask", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteAgentRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteAgentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteAgentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentRequest_descriptor, + new java.lang.String[] { + "Name", "AgentUri", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentResponse_descriptor, + new java.lang.String[] { + "AgentUri", "AgentContent", "Agent", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_RestoreAgentRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_dialogflow_cx_v3beta1_RestoreAgentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_RestoreAgentRequest_descriptor, + new java.lang.String[] { + "Name", "AgentUri", "AgentContent", "Agent", + }); + 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.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.dialogflow.cx.v3beta1.FlowProto.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-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AudioConfigProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AudioConfigProto.java new file mode 100644 index 000000000..b24b909f6 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AudioConfigProto.java @@ -0,0 +1,181 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class AudioConfigProto { + private AudioConfigProto() {} + + 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_dialogflow_cx_v3beta1_SpeechWordInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechWordInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_InputAudioConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_InputAudioConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_VoiceSelectionParams_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_VoiceSelectionParams_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_SynthesizeSpeechConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_SynthesizeSpeechConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_OutputAudioConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_OutputAudioConfig_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n5google/cloud/dialogflow/cx/v3beta1/aud" + + "io_config.proto\022\"google.cloud.dialogflow" + + ".cx.v3beta1\032\037google/api/field_behavior.p" + + "roto\032\031google/api/resource.proto\032\036google/" + + "protobuf/duration.proto\032\034google/api/anno" + + "tations.proto\"\222\001\n\016SpeechWordInfo\022\014\n\004word" + + "\030\003 \001(\t\022/\n\014start_offset\030\001 \001(\0132\031.google.pr" + + "otobuf.Duration\022-\n\nend_offset\030\002 \001(\0132\031.go" + + "ogle.protobuf.Duration\022\022\n\nconfidence\030\004 \001" + + "(\002\"\245\002\n\020InputAudioConfig\022N\n\016audio_encodin" + + "g\030\001 \001(\01621.google.cloud.dialogflow.cx.v3b" + + "eta1.AudioEncodingB\003\340A\002\022\031\n\021sample_rate_h" + + "ertz\030\002 \001(\005\022\030\n\020enable_word_info\030\r \001(\010\022\024\n\014" + + "phrase_hints\030\004 \003(\t\022\r\n\005model\030\007 \001(\t\022M\n\rmod" + + "el_variant\030\n \001(\01626.google.cloud.dialogfl" + + "ow.cx.v3beta1.SpeechModelVariant\022\030\n\020sing" + + "le_utterance\030\010 \001(\010\"n\n\024VoiceSelectionPara" + + "ms\022\014\n\004name\030\001 \001(\t\022H\n\013ssml_gender\030\002 \001(\01623." + + "google.cloud.dialogflow.cx.v3beta1.SsmlV" + + "oiceGender\"\273\001\n\026SynthesizeSpeechConfig\022\025\n" + + "\rspeaking_rate\030\001 \001(\001\022\r\n\005pitch\030\002 \001(\001\022\026\n\016v" + + "olume_gain_db\030\003 \001(\001\022\032\n\022effects_profile_i" + + "d\030\005 \003(\t\022G\n\005voice\030\004 \001(\01328.google.cloud.di" + + "alogflow.cx.v3beta1.VoiceSelectionParams" + + "\"\342\001\n\021OutputAudioConfig\022T\n\016audio_encoding" + + "\030\001 \001(\01627.google.cloud.dialogflow.cx.v3be" + + "ta1.OutputAudioEncodingB\003\340A\002\022\031\n\021sample_r" + + "ate_hertz\030\002 \001(\005\022\\\n\030synthesize_speech_con" + + "fig\030\003 \001(\0132:.google.cloud.dialogflow.cx.v" + + "3beta1.SynthesizeSpeechConfig*\373\001\n\rAudioE" + + "ncoding\022\036\n\032AUDIO_ENCODING_UNSPECIFIED\020\000\022" + + "\034\n\030AUDIO_ENCODING_LINEAR_16\020\001\022\027\n\023AUDIO_E" + + "NCODING_FLAC\020\002\022\030\n\024AUDIO_ENCODING_MULAW\020\003" + + "\022\026\n\022AUDIO_ENCODING_AMR\020\004\022\031\n\025AUDIO_ENCODI" + + "NG_AMR_WB\020\005\022\033\n\027AUDIO_ENCODING_OGG_OPUS\020\006" + + "\022)\n%AUDIO_ENCODING_SPEEX_WITH_HEADER_BYT" + + "E\020\007*v\n\022SpeechModelVariant\022$\n SPEECH_MODE" + + "L_VARIANT_UNSPECIFIED\020\000\022\026\n\022USE_BEST_AVAI" + + "LABLE\020\001\022\020\n\014USE_STANDARD\020\002\022\020\n\014USE_ENHANCE" + + "D\020\003*\215\001\n\017SsmlVoiceGender\022!\n\035SSML_VOICE_GE" + + "NDER_UNSPECIFIED\020\000\022\032\n\026SSML_VOICE_GENDER_" + + "MALE\020\001\022\034\n\030SSML_VOICE_GENDER_FEMALE\020\002\022\035\n\031" + + "SSML_VOICE_GENDER_NEUTRAL\020\003*\354\001\n\023OutputAu" + + "dioEncoding\022%\n!OUTPUT_AUDIO_ENCODING_UNS" + + "PECIFIED\020\000\022#\n\037OUTPUT_AUDIO_ENCODING_LINE" + + "AR_16\020\001\022\035\n\031OUTPUT_AUDIO_ENCODING_MP3\020\002\022%" + + "\n!OUTPUT_AUDIO_ENCODING_MP3_64_KBPS\020\004\022\"\n" + + "\036OUTPUT_AUDIO_ENCODING_OGG_OPUS\020\003\022\037\n\033OUT" + + "PUT_AUDIO_ENCODING_MULAW\020\005B\257\001\n&com.googl" + + "e.cloud.dialogflow.cx.v3beta1B\020AudioConf" + + "igProtoP\001ZDgoogle.golang.org/genproto/go" + + "ogleapis/cloud/dialogflow/cx/v3beta1;cx\370" + + "\001\001\242\002\002DF\252\002\"Google.Cloud.Dialogflow.Cx.V3B" + + "eta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechWordInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechWordInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechWordInfo_descriptor, + new java.lang.String[] { + "Word", "StartOffset", "EndOffset", "Confidence", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_InputAudioConfig_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_InputAudioConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_InputAudioConfig_descriptor, + new java.lang.String[] { + "AudioEncoding", + "SampleRateHertz", + "EnableWordInfo", + "PhraseHints", + "Model", + "ModelVariant", + "SingleUtterance", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_VoiceSelectionParams_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_dialogflow_cx_v3beta1_VoiceSelectionParams_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_VoiceSelectionParams_descriptor, + new java.lang.String[] { + "Name", "SsmlGender", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_SynthesizeSpeechConfig_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_dialogflow_cx_v3beta1_SynthesizeSpeechConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_SynthesizeSpeechConfig_descriptor, + new java.lang.String[] { + "SpeakingRate", "Pitch", "VolumeGainDb", "EffectsProfileId", "Voice", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_OutputAudioConfig_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_dialogflow_cx_v3beta1_OutputAudioConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_OutputAudioConfig_descriptor, + new java.lang.String[] { + "AudioEncoding", "SampleRateHertz", "SynthesizeSpeechConfig", + }); + 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.api.ResourceProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AudioEncoding.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AudioEncoding.java new file mode 100644 index 000000000..50f471eac --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AudioEncoding.java @@ -0,0 +1,328 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Audio encoding of the audio content sent in the conversational query request.
+ * Refer to the
+ * [Cloud Speech API
+ * documentation](https://cloud.google.com/speech-to-text/docs/basics) for more
+ * details.
+ * 
+ * + * Protobuf enum {@code google.cloud.dialogflow.cx.v3beta1.AudioEncoding} + */ +public enum AudioEncoding implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Not specified.
+   * 
+ * + * AUDIO_ENCODING_UNSPECIFIED = 0; + */ + AUDIO_ENCODING_UNSPECIFIED(0), + /** + * + * + *
+   * Uncompressed 16-bit signed little-endian samples (Linear PCM).
+   * 
+ * + * AUDIO_ENCODING_LINEAR_16 = 1; + */ + AUDIO_ENCODING_LINEAR_16(1), + /** + * + * + *
+   * [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio
+   * Codec) is the recommended encoding because it is lossless (therefore
+   * recognition is not compromised) and requires only about half the
+   * bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and
+   * 24-bit samples, however, not all fields in `STREAMINFO` are supported.
+   * 
+ * + * AUDIO_ENCODING_FLAC = 2; + */ + AUDIO_ENCODING_FLAC(2), + /** + * + * + *
+   * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
+   * 
+ * + * AUDIO_ENCODING_MULAW = 3; + */ + AUDIO_ENCODING_MULAW(3), + /** + * + * + *
+   * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
+   * 
+ * + * AUDIO_ENCODING_AMR = 4; + */ + AUDIO_ENCODING_AMR(4), + /** + * + * + *
+   * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
+   * 
+ * + * AUDIO_ENCODING_AMR_WB = 5; + */ + AUDIO_ENCODING_AMR_WB(5), + /** + * + * + *
+   * Opus encoded audio frames in Ogg container
+   * ([OggOpus](https://wiki.xiph.org/OggOpus)).
+   * `sample_rate_hertz` must be 16000.
+   * 
+ * + * AUDIO_ENCODING_OGG_OPUS = 6; + */ + AUDIO_ENCODING_OGG_OPUS(6), + /** + * + * + *
+   * Although the use of lossy encodings is not recommended, if a very low
+   * bitrate encoding is required, `OGG_OPUS` is highly preferred over
+   * Speex encoding. The [Speex](https://speex.org/) encoding supported by
+   * Dialogflow API has a header byte in each block, as in MIME type
+   * `audio/x-speex-with-header-byte`.
+   * It is a variant of the RTP Speex encoding defined in
+   * [RFC 5574](https://tools.ietf.org/html/rfc5574).
+   * The stream is a sequence of blocks, one block per RTP packet. Each block
+   * starts with a byte containing the length of the block, in bytes, followed
+   * by one or more frames of Speex data, padded to an integral number of
+   * bytes (octets) as specified in RFC 5574. In other words, each RTP header
+   * is replaced with a single byte containing the block length. Only Speex
+   * wideband is supported. `sample_rate_hertz` must be 16000.
+   * 
+ * + * AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; + */ + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE(7), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Not specified.
+   * 
+ * + * AUDIO_ENCODING_UNSPECIFIED = 0; + */ + public static final int AUDIO_ENCODING_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Uncompressed 16-bit signed little-endian samples (Linear PCM).
+   * 
+ * + * AUDIO_ENCODING_LINEAR_16 = 1; + */ + public static final int AUDIO_ENCODING_LINEAR_16_VALUE = 1; + /** + * + * + *
+   * [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio
+   * Codec) is the recommended encoding because it is lossless (therefore
+   * recognition is not compromised) and requires only about half the
+   * bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and
+   * 24-bit samples, however, not all fields in `STREAMINFO` are supported.
+   * 
+ * + * AUDIO_ENCODING_FLAC = 2; + */ + public static final int AUDIO_ENCODING_FLAC_VALUE = 2; + /** + * + * + *
+   * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
+   * 
+ * + * AUDIO_ENCODING_MULAW = 3; + */ + public static final int AUDIO_ENCODING_MULAW_VALUE = 3; + /** + * + * + *
+   * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
+   * 
+ * + * AUDIO_ENCODING_AMR = 4; + */ + public static final int AUDIO_ENCODING_AMR_VALUE = 4; + /** + * + * + *
+   * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
+   * 
+ * + * AUDIO_ENCODING_AMR_WB = 5; + */ + public static final int AUDIO_ENCODING_AMR_WB_VALUE = 5; + /** + * + * + *
+   * Opus encoded audio frames in Ogg container
+   * ([OggOpus](https://wiki.xiph.org/OggOpus)).
+   * `sample_rate_hertz` must be 16000.
+   * 
+ * + * AUDIO_ENCODING_OGG_OPUS = 6; + */ + public static final int AUDIO_ENCODING_OGG_OPUS_VALUE = 6; + /** + * + * + *
+   * Although the use of lossy encodings is not recommended, if a very low
+   * bitrate encoding is required, `OGG_OPUS` is highly preferred over
+   * Speex encoding. The [Speex](https://speex.org/) encoding supported by
+   * Dialogflow API has a header byte in each block, as in MIME type
+   * `audio/x-speex-with-header-byte`.
+   * It is a variant of the RTP Speex encoding defined in
+   * [RFC 5574](https://tools.ietf.org/html/rfc5574).
+   * The stream is a sequence of blocks, one block per RTP packet. Each block
+   * starts with a byte containing the length of the block, in bytes, followed
+   * by one or more frames of Speex data, padded to an integral number of
+   * bytes (octets) as specified in RFC 5574. In other words, each RTP header
+   * is replaced with a single byte containing the block length. Only Speex
+   * wideband is supported. `sample_rate_hertz` must be 16000.
+   * 
+ * + * AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; + */ + public static final int AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE_VALUE = 7; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AudioEncoding valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static AudioEncoding forNumber(int value) { + switch (value) { + case 0: + return AUDIO_ENCODING_UNSPECIFIED; + case 1: + return AUDIO_ENCODING_LINEAR_16; + case 2: + return AUDIO_ENCODING_FLAC; + case 3: + return AUDIO_ENCODING_MULAW; + case 4: + return AUDIO_ENCODING_AMR; + case 5: + return AUDIO_ENCODING_AMR_WB; + case 6: + return AUDIO_ENCODING_OGG_OPUS; + case 7: + return AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AudioEncoding findValueByNumber(int number) { + return AudioEncoding.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final AudioEncoding[] VALUES = values(); + + public static AudioEncoding valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private AudioEncoding(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.AudioEncoding) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AudioInput.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AudioInput.java new file mode 100644 index 000000000..8a6b70203 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AudioInput.java @@ -0,0 +1,882 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Represents the natural speech audio to be processed.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.AudioInput} + */ +public final class AudioInput extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.AudioInput) + AudioInputOrBuilder { + private static final long serialVersionUID = 0L; + // Use AudioInput.newBuilder() to construct. + private AudioInput(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AudioInput() { + audio_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AudioInput(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AudioInput( + 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.dialogflow.cx.v3beta1.InputAudioConfig.Builder subBuilder = null; + if (config_ != null) { + subBuilder = config_.toBuilder(); + } + config_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(config_); + config_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + audio_ = input.readBytes(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_AudioInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_AudioInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.AudioInput.class, + com.google.cloud.dialogflow.cx.v3beta1.AudioInput.Builder.class); + } + + public static final int CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config_; + /** + * + * + *
+   * Required. Instructs the speech recognizer how to process the speech audio.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return config_ != null; + } + /** + * + * + *
+   * Required. Instructs the speech recognizer how to process the speech audio.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The config. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig getConfig() { + return config_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.getDefaultInstance() + : config_; + } + /** + * + * + *
+   * Required. Instructs the speech recognizer how to process the speech audio.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfigOrBuilder getConfigOrBuilder() { + return getConfig(); + } + + public static final int AUDIO_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString audio_; + /** + * + * + *
+   * The natural language speech audio to be processed.
+   * A single request can contain up to 1 minute of speech audio data.
+   * The [transcribed text][google.cloud.dialogflow.cx.v3beta1.QueryResult.transcript] cannot contain more than 256
+   * bytes.
+   * For non-streaming audio detect intent, both `config` and `audio` must be
+   * provided.
+   * For streaming audio detect intent, `config` must be provided in
+   * the first request and `audio` must be provided in all following requests.
+   * 
+ * + * bytes audio = 2; + * + * @return The audio. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAudio() { + return audio_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (config_ != null) { + output.writeMessage(1, getConfig()); + } + if (!audio_.isEmpty()) { + output.writeBytes(2, audio_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (config_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getConfig()); + } + if (!audio_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, audio_); + } + 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.dialogflow.cx.v3beta1.AudioInput)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.AudioInput other = + (com.google.cloud.dialogflow.cx.v3beta1.AudioInput) obj; + + if (hasConfig() != other.hasConfig()) return false; + if (hasConfig()) { + if (!getConfig().equals(other.getConfig())) return false; + } + if (!getAudio().equals(other.getAudio())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasConfig()) { + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + } + hash = (37 * hash) + AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getAudio().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.AudioInput parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.AudioInput 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.dialogflow.cx.v3beta1.AudioInput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.AudioInput 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.dialogflow.cx.v3beta1.AudioInput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.AudioInput parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.AudioInput parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.AudioInput 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.dialogflow.cx.v3beta1.AudioInput parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.AudioInput 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.dialogflow.cx.v3beta1.AudioInput parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.AudioInput 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.dialogflow.cx.v3beta1.AudioInput prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the natural speech audio to be processed.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.AudioInput} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.AudioInput) + com.google.cloud.dialogflow.cx.v3beta1.AudioInputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_AudioInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_AudioInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.AudioInput.class, + com.google.cloud.dialogflow.cx.v3beta1.AudioInput.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.AudioInput.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (configBuilder_ == null) { + config_ = null; + } else { + config_ = null; + configBuilder_ = null; + } + audio_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_AudioInput_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.AudioInput getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioInput.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.AudioInput build() { + com.google.cloud.dialogflow.cx.v3beta1.AudioInput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.AudioInput buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.AudioInput result = + new com.google.cloud.dialogflow.cx.v3beta1.AudioInput(this); + if (configBuilder_ == null) { + result.config_ = config_; + } else { + result.config_ = configBuilder_.build(); + } + result.audio_ = audio_; + 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.dialogflow.cx.v3beta1.AudioInput) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.AudioInput) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.AudioInput other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.AudioInput.getDefaultInstance()) + return this; + if (other.hasConfig()) { + mergeConfig(other.getConfig()); + } + if (other.getAudio() != com.google.protobuf.ByteString.EMPTY) { + setAudio(other.getAudio()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.AudioInput parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.AudioInput) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfigOrBuilder> + configBuilder_; + /** + * + * + *
+     * Required. Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the config field is set. + */ + public boolean hasConfig() { + return configBuilder_ != null || config_ != null; + } + /** + * + * + *
+     * Required. Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The config. + */ + public com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig getConfig() { + if (configBuilder_ == null) { + return config_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.getDefaultInstance() + : config_; + } else { + return configBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConfig(com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + configBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConfig( + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.Builder builderForValue) { + if (configBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConfig(com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig value) { + if (configBuilder_ == null) { + if (config_ != null) { + config_ = + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.newBuilder(config_) + .mergeFrom(value) + .buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + configBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConfig() { + if (configBuilder_ == null) { + config_ = null; + onChanged(); + } else { + config_ = null; + configBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.Builder getConfigBuilder() { + + onChanged(); + return getConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfigOrBuilder getConfigOrBuilder() { + if (configBuilder_ != null) { + return configBuilder_.getMessageOrBuilder(); + } else { + return config_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.getDefaultInstance() + : config_; + } + } + /** + * + * + *
+     * Required. Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + configBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfigOrBuilder>( + getConfig(), getParentForChildren(), isClean()); + config_ = null; + } + return configBuilder_; + } + + private com.google.protobuf.ByteString audio_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The natural language speech audio to be processed.
+     * A single request can contain up to 1 minute of speech audio data.
+     * The [transcribed text][google.cloud.dialogflow.cx.v3beta1.QueryResult.transcript] cannot contain more than 256
+     * bytes.
+     * For non-streaming audio detect intent, both `config` and `audio` must be
+     * provided.
+     * For streaming audio detect intent, `config` must be provided in
+     * the first request and `audio` must be provided in all following requests.
+     * 
+ * + * bytes audio = 2; + * + * @return The audio. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAudio() { + return audio_; + } + /** + * + * + *
+     * The natural language speech audio to be processed.
+     * A single request can contain up to 1 minute of speech audio data.
+     * The [transcribed text][google.cloud.dialogflow.cx.v3beta1.QueryResult.transcript] cannot contain more than 256
+     * bytes.
+     * For non-streaming audio detect intent, both `config` and `audio` must be
+     * provided.
+     * For streaming audio detect intent, `config` must be provided in
+     * the first request and `audio` must be provided in all following requests.
+     * 
+ * + * bytes audio = 2; + * + * @param value The audio to set. + * @return This builder for chaining. + */ + public Builder setAudio(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + audio_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The natural language speech audio to be processed.
+     * A single request can contain up to 1 minute of speech audio data.
+     * The [transcribed text][google.cloud.dialogflow.cx.v3beta1.QueryResult.transcript] cannot contain more than 256
+     * bytes.
+     * For non-streaming audio detect intent, both `config` and `audio` must be
+     * provided.
+     * For streaming audio detect intent, `config` must be provided in
+     * the first request and `audio` must be provided in all following requests.
+     * 
+ * + * bytes audio = 2; + * + * @return This builder for chaining. + */ + public Builder clearAudio() { + + audio_ = getDefaultInstance().getAudio(); + 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.dialogflow.cx.v3beta1.AudioInput) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.AudioInput) + private static final com.google.cloud.dialogflow.cx.v3beta1.AudioInput DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.AudioInput(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.AudioInput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AudioInput parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AudioInput(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.dialogflow.cx.v3beta1.AudioInput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AudioInputOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AudioInputOrBuilder.java new file mode 100644 index 000000000..d5ee628a0 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AudioInputOrBuilder.java @@ -0,0 +1,86 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface AudioInputOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.AudioInput) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Instructs the speech recognizer how to process the speech audio.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the config field is set. + */ + boolean hasConfig(); + /** + * + * + *
+   * Required. Instructs the speech recognizer how to process the speech audio.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The config. + */ + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig getConfig(); + /** + * + * + *
+   * Required. Instructs the speech recognizer how to process the speech audio.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfigOrBuilder getConfigOrBuilder(); + + /** + * + * + *
+   * The natural language speech audio to be processed.
+   * A single request can contain up to 1 minute of speech audio data.
+   * The [transcribed text][google.cloud.dialogflow.cx.v3beta1.QueryResult.transcript] cannot contain more than 256
+   * bytes.
+   * For non-streaming audio detect intent, both `config` and `audio` must be
+   * provided.
+   * For streaming audio detect intent, `config` must be provided in
+   * the first request and `audio` must be provided in all following requests.
+   * 
+ * + * bytes audio = 2; + * + * @return The audio. + */ + com.google.protobuf.ByteString getAudio(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateAgentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateAgentRequest.java new file mode 100644 index 000000000..49e2bf107 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateAgentRequest.java @@ -0,0 +1,959 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest} + */ +public final class CreateAgentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest) + CreateAgentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateAgentRequest.newBuilder() to construct. + private CreateAgentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateAgentRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateAgentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateAgentRequest( + 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.dialogflow.cx.v3beta1.Agent.Builder subBuilder = null; + if (agent_ != null) { + subBuilder = agent_.toBuilder(); + } + agent_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Agent.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(agent_); + agent_ = 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.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateAgentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateAgentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The location to create a agent for.
+   * Format: `projects/<Project ID>/locations/<Location ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 location to create a agent for.
+   * Format: `projects/<Project ID>/locations/<Location ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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 AGENT_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.Agent agent_; + /** + * + * + *
+   * Required. The agent to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the agent field is set. + */ + @java.lang.Override + public boolean hasAgent() { + return agent_ != null; + } + /** + * + * + *
+   * Required. The agent to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The agent. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Agent getAgent() { + return agent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Agent.getDefaultInstance() + : agent_; + } + /** + * + * + *
+   * Required. The agent to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder getAgentOrBuilder() { + return getAgent(); + } + + 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 (agent_ != null) { + output.writeMessage(2, getAgent()); + } + 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 (agent_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAgent()); + } + 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.dialogflow.cx.v3beta1.CreateAgentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasAgent() != other.hasAgent()) return false; + if (hasAgent()) { + if (!getAgent().equals(other.getAgent())) 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 (hasAgent()) { + hash = (37 * hash) + AGENT_FIELD_NUMBER; + hash = (53 * hash) + getAgent().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest 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.dialogflow.cx.v3beta1.CreateAgentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest 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.dialogflow.cx.v3beta1.CreateAgentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest 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.dialogflow.cx.v3beta1.CreateAgentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest 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.dialogflow.cx.v3beta1.CreateAgentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest 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.dialogflow.cx.v3beta1.CreateAgentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest) + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateAgentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateAgentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest.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 (agentBuilder_ == null) { + agent_ = null; + } else { + agent_ = null; + agentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateAgentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest(this); + result.parent_ = parent_; + if (agentBuilder_ == null) { + result.agent_ = agent_; + } else { + result.agent_ = agentBuilder_.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.dialogflow.cx.v3beta1.CreateAgentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasAgent()) { + mergeAgent(other.getAgent()); + } + 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.dialogflow.cx.v3beta1.CreateAgentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The location to create a agent for.
+     * Format: `projects/<Project ID>/locations/<Location ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 location to create a agent for.
+     * Format: `projects/<Project ID>/locations/<Location ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 location to create a agent for.
+     * Format: `projects/<Project ID>/locations/<Location ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 location to create a agent for.
+     * Format: `projects/<Project ID>/locations/<Location ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The location to create a agent for.
+     * Format: `projects/<Project ID>/locations/<Location ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.Agent agent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Agent, + com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder> + agentBuilder_; + /** + * + * + *
+     * Required. The agent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the agent field is set. + */ + public boolean hasAgent() { + return agentBuilder_ != null || agent_ != null; + } + /** + * + * + *
+     * Required. The agent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The agent. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Agent getAgent() { + if (agentBuilder_ == null) { + return agent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Agent.getDefaultInstance() + : agent_; + } else { + return agentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The agent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAgent(com.google.cloud.dialogflow.cx.v3beta1.Agent value) { + if (agentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + agent_ = value; + onChanged(); + } else { + agentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The agent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAgent(com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder builderForValue) { + if (agentBuilder_ == null) { + agent_ = builderForValue.build(); + onChanged(); + } else { + agentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The agent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAgent(com.google.cloud.dialogflow.cx.v3beta1.Agent value) { + if (agentBuilder_ == null) { + if (agent_ != null) { + agent_ = + com.google.cloud.dialogflow.cx.v3beta1.Agent.newBuilder(agent_) + .mergeFrom(value) + .buildPartial(); + } else { + agent_ = value; + } + onChanged(); + } else { + agentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The agent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAgent() { + if (agentBuilder_ == null) { + agent_ = null; + onChanged(); + } else { + agent_ = null; + agentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The agent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder getAgentBuilder() { + + onChanged(); + return getAgentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The agent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder getAgentOrBuilder() { + if (agentBuilder_ != null) { + return agentBuilder_.getMessageOrBuilder(); + } else { + return agent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Agent.getDefaultInstance() + : agent_; + } + } + /** + * + * + *
+     * Required. The agent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Agent, + com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder> + getAgentFieldBuilder() { + if (agentBuilder_ == null) { + agentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Agent, + com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder>( + getAgent(), getParentForChildren(), isClean()); + agent_ = null; + } + return agentBuilder_; + } + + @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.dialogflow.cx.v3beta1.CreateAgentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateAgentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateAgentRequest(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.dialogflow.cx.v3beta1.CreateAgentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateAgentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateAgentRequestOrBuilder.java new file mode 100644 index 000000000..c9eaf7fbf --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateAgentRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface CreateAgentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The location to create a agent for.
+   * Format: `projects/<Project ID>/locations/<Location ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The location to create a agent for.
+   * Format: `projects/<Project ID>/locations/<Location ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The agent to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the agent field is set. + */ + boolean hasAgent(); + /** + * + * + *
+   * Required. The agent to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The agent. + */ + com.google.cloud.dialogflow.cx.v3beta1.Agent getAgent(); + /** + * + * + *
+   * Required. The agent to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder getAgentOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateEntityTypeRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateEntityTypeRequest.java new file mode 100644 index 000000000..ef03e8132 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateEntityTypeRequest.java @@ -0,0 +1,1202 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.CreateEntityType].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest} + */ +public final class CreateEntityTypeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest) + CreateEntityTypeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateEntityTypeRequest.newBuilder() to construct. + private CreateEntityTypeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateEntityTypeRequest() { + parent_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateEntityTypeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateEntityTypeRequest( + 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.dialogflow.cx.v3beta1.EntityType.Builder subBuilder = null; + if (entityType_ != null) { + subBuilder = entityType_.toBuilder(); + } + entityType_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(entityType_); + entityType_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The agent to create a entity type for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 agent to create a entity type for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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 ENTITY_TYPE_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.EntityType entityType_; + /** + * + * + *
+   * Required. The entity type to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the entityType field is set. + */ + @java.lang.Override + public boolean hasEntityType() { + return entityType_ != null; + } + /** + * + * + *
+   * Required. The entity type to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The entityType. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType getEntityType() { + return entityType_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.EntityType.getDefaultInstance() + : entityType_; + } + /** + * + * + *
+   * Required. The entity type to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder getEntityTypeOrBuilder() { + return getEntityType(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language of the following fields in `entity_type`:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language of the following fields in `entity_type`:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (entityType_ != null) { + output.writeMessage(2, getEntityType()); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); + } + 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 (entityType_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEntityType()); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasEntityType() != other.hasEntityType()) return false; + if (hasEntityType()) { + if (!getEntityType().equals(other.getEntityType())) return false; + } + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasEntityType()) { + hash = (37 * hash) + ENTITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEntityType().hashCode(); + } + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest 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.dialogflow.cx.v3beta1.CreateEntityTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest 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.dialogflow.cx.v3beta1.CreateEntityTypeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest 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.dialogflow.cx.v3beta1.CreateEntityTypeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest 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.dialogflow.cx.v3beta1.CreateEntityTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest 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.dialogflow.cx.v3beta1.CreateEntityTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.CreateEntityType].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest) + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest.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 (entityTypeBuilder_ == null) { + entityType_ = null; + } else { + entityType_ = null; + entityTypeBuilder_ = null; + } + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEntityTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest(this); + result.parent_ = parent_; + if (entityTypeBuilder_ == null) { + result.entityType_ = entityType_; + } else { + result.entityType_ = entityTypeBuilder_.build(); + } + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasEntityType()) { + mergeEntityType(other.getEntityType()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The agent to create a entity type for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to create a entity type for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to create a entity type for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to create a entity type for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The agent to create a entity type for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.EntityType entityType_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder> + entityTypeBuilder_; + /** + * + * + *
+     * Required. The entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the entityType field is set. + */ + public boolean hasEntityType() { + return entityTypeBuilder_ != null || entityType_ != null; + } + /** + * + * + *
+     * Required. The entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The entityType. + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType getEntityType() { + if (entityTypeBuilder_ == null) { + return entityType_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.EntityType.getDefaultInstance() + : entityType_; + } else { + return entityTypeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEntityType(com.google.cloud.dialogflow.cx.v3beta1.EntityType value) { + if (entityTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + entityType_ = value; + onChanged(); + } else { + entityTypeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEntityType( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder builderForValue) { + if (entityTypeBuilder_ == null) { + entityType_ = builderForValue.build(); + onChanged(); + } else { + entityTypeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeEntityType(com.google.cloud.dialogflow.cx.v3beta1.EntityType value) { + if (entityTypeBuilder_ == null) { + if (entityType_ != null) { + entityType_ = + com.google.cloud.dialogflow.cx.v3beta1.EntityType.newBuilder(entityType_) + .mergeFrom(value) + .buildPartial(); + } else { + entityType_ = value; + } + onChanged(); + } else { + entityTypeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearEntityType() { + if (entityTypeBuilder_ == null) { + entityType_ = null; + onChanged(); + } else { + entityType_ = null; + entityTypeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder getEntityTypeBuilder() { + + onChanged(); + return getEntityTypeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder getEntityTypeOrBuilder() { + if (entityTypeBuilder_ != null) { + return entityTypeBuilder_.getMessageOrBuilder(); + } else { + return entityType_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.EntityType.getDefaultInstance() + : entityType_; + } + } + /** + * + * + *
+     * Required. The entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder> + getEntityTypeFieldBuilder() { + if (entityTypeBuilder_ == null) { + entityTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder>( + getEntityType(), getParentForChildren(), isClean()); + entityType_ = null; + } + return entityTypeBuilder_; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language of the following fields in `entity_type`:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `entity_type`:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `entity_type`:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `entity_type`:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `entity_type`:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateEntityTypeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateEntityTypeRequest(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.dialogflow.cx.v3beta1.CreateEntityTypeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateEntityTypeRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateEntityTypeRequestOrBuilder.java new file mode 100644 index 000000000..807a308d1 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateEntityTypeRequestOrBuilder.java @@ -0,0 +1,138 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface CreateEntityTypeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The agent to create a entity type for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The agent to create a entity type for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The entity type to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the entityType field is set. + */ + boolean hasEntityType(); + /** + * + * + *
+   * Required. The entity type to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The entityType. + */ + com.google.cloud.dialogflow.cx.v3beta1.EntityType getEntityType(); + /** + * + * + *
+   * Required. The entity type to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder getEntityTypeOrBuilder(); + + /** + * + * + *
+   * The language of the following fields in `entity_type`:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language of the following fields in `entity_type`:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateEnvironmentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateEnvironmentRequest.java new file mode 100644 index 000000000..369455755 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateEnvironmentRequest.java @@ -0,0 +1,968 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Environments.CreateEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.CreateEnvironment].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest} + */ +public final class CreateEnvironmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest) + CreateEnvironmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateEnvironmentRequest.newBuilder() to construct. + private CreateEnvironmentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateEnvironmentRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateEnvironmentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateEnvironmentRequest( + 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.dialogflow.cx.v3beta1.Environment.Builder subBuilder = null; + if (environment_ != null) { + subBuilder = environment_.toBuilder(); + } + environment_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Environment.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(environment_); + environment_ = 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.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEnvironmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEnvironmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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 ENVIRONMENT_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.Environment environment_; + /** + * + * + *
+   * Required. The environment to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the environment field is set. + */ + @java.lang.Override + public boolean hasEnvironment() { + return environment_ != null; + } + /** + * + * + *
+   * Required. The environment to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironment() { + return environment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Environment.getDefaultInstance() + : environment_; + } + /** + * + * + *
+   * Required. The environment to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder getEnvironmentOrBuilder() { + return getEnvironment(); + } + + 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 (environment_ != null) { + output.writeMessage(2, getEnvironment()); + } + 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 (environment_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEnvironment()); + } + 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.dialogflow.cx.v3beta1.CreateEnvironmentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasEnvironment() != other.hasEnvironment()) return false; + if (hasEnvironment()) { + if (!getEnvironment().equals(other.getEnvironment())) 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 (hasEnvironment()) { + hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + getEnvironment().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest 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.dialogflow.cx.v3beta1.CreateEnvironmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest 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.dialogflow.cx.v3beta1.CreateEnvironmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest 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.dialogflow.cx.v3beta1.CreateEnvironmentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest 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.dialogflow.cx.v3beta1.CreateEnvironmentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest 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.dialogflow.cx.v3beta1.CreateEnvironmentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Environments.CreateEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.CreateEnvironment].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest) + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEnvironmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEnvironmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest.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 (environmentBuilder_ == null) { + environment_ = null; + } else { + environment_ = null; + environmentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEnvironmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest(this); + result.parent_ = parent_; + if (environmentBuilder_ == null) { + result.environment_ = environment_; + } else { + result.environment_ = environmentBuilder_.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.dialogflow.cx.v3beta1.CreateEnvironmentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasEnvironment()) { + mergeEnvironment(other.getEnvironment()); + } + 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.dialogflow.cx.v3beta1.CreateEnvironmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.Environment environment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment, + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder> + environmentBuilder_; + /** + * + * + *
+     * Required. The environment to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the environment field is set. + */ + public boolean hasEnvironment() { + return environmentBuilder_ != null || environment_ != null; + } + /** + * + * + *
+     * Required. The environment to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The environment. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironment() { + if (environmentBuilder_ == null) { + return environment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Environment.getDefaultInstance() + : environment_; + } else { + return environmentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The environment to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEnvironment(com.google.cloud.dialogflow.cx.v3beta1.Environment value) { + if (environmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + environment_ = value; + onChanged(); + } else { + environmentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The environment to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEnvironment( + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder builderForValue) { + if (environmentBuilder_ == null) { + environment_ = builderForValue.build(); + onChanged(); + } else { + environmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The environment to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeEnvironment(com.google.cloud.dialogflow.cx.v3beta1.Environment value) { + if (environmentBuilder_ == null) { + if (environment_ != null) { + environment_ = + com.google.cloud.dialogflow.cx.v3beta1.Environment.newBuilder(environment_) + .mergeFrom(value) + .buildPartial(); + } else { + environment_ = value; + } + onChanged(); + } else { + environmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The environment to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearEnvironment() { + if (environmentBuilder_ == null) { + environment_ = null; + onChanged(); + } else { + environment_ = null; + environmentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The environment to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder getEnvironmentBuilder() { + + onChanged(); + return getEnvironmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The environment to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder getEnvironmentOrBuilder() { + if (environmentBuilder_ != null) { + return environmentBuilder_.getMessageOrBuilder(); + } else { + return environment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Environment.getDefaultInstance() + : environment_; + } + } + /** + * + * + *
+     * Required. The environment to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment, + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder> + getEnvironmentFieldBuilder() { + if (environmentBuilder_ == null) { + environmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment, + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder>( + getEnvironment(), getParentForChildren(), isClean()); + environment_ = null; + } + return environmentBuilder_; + } + + @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.dialogflow.cx.v3beta1.CreateEnvironmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateEnvironmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateEnvironmentRequest(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.dialogflow.cx.v3beta1.CreateEnvironmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateEnvironmentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateEnvironmentRequestOrBuilder.java new file mode 100644 index 000000000..837a3a267 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateEnvironmentRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface CreateEnvironmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The environment to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the environment field is set. + */ + boolean hasEnvironment(); + /** + * + * + *
+   * Required. The environment to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The environment. + */ + com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironment(); + /** + * + * + *
+   * Required. The environment to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder getEnvironmentOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateFlowRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateFlowRequest.java new file mode 100644 index 000000000..ca560291e --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateFlowRequest.java @@ -0,0 +1,1185 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Flows.CreateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.CreateFlow].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest} + */ +public final class CreateFlowRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest) + CreateFlowRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateFlowRequest.newBuilder() to construct. + private CreateFlowRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateFlowRequest() { + parent_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateFlowRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateFlowRequest( + 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.dialogflow.cx.v3beta1.Flow.Builder subBuilder = null; + if (flow_ != null) { + subBuilder = flow_.toBuilder(); + } + flow_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Flow.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(flow_); + flow_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateFlowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateFlowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The agent to create a flow for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 agent to create a flow for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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 FLOW_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.Flow flow_; + /** + * + * + *
+   * Required. The flow to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the flow field is set. + */ + @java.lang.Override + public boolean hasFlow() { + return flow_ != null; + } + /** + * + * + *
+   * Required. The flow to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The flow. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Flow getFlow() { + return flow_ == null ? com.google.cloud.dialogflow.cx.v3beta1.Flow.getDefaultInstance() : flow_; + } + /** + * + * + *
+   * Required. The flow to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder getFlowOrBuilder() { + return getFlow(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language of the following fields in `flow`:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language of the following fields in `flow`:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (flow_ != null) { + output.writeMessage(2, getFlow()); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); + } + 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 (flow_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFlow()); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasFlow() != other.hasFlow()) return false; + if (hasFlow()) { + if (!getFlow().equals(other.getFlow())) return false; + } + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasFlow()) { + hash = (37 * hash) + FLOW_FIELD_NUMBER; + hash = (53 * hash) + getFlow().hashCode(); + } + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest 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.dialogflow.cx.v3beta1.CreateFlowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest 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.dialogflow.cx.v3beta1.CreateFlowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest 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.dialogflow.cx.v3beta1.CreateFlowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest 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.dialogflow.cx.v3beta1.CreateFlowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest 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.dialogflow.cx.v3beta1.CreateFlowRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Flows.CreateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.CreateFlow].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest) + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateFlowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateFlowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest.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 (flowBuilder_ == null) { + flow_ = null; + } else { + flow_ = null; + flowBuilder_ = null; + } + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateFlowRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest(this); + result.parent_ = parent_; + if (flowBuilder_ == null) { + result.flow_ = flow_; + } else { + result.flow_ = flowBuilder_.build(); + } + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasFlow()) { + mergeFlow(other.getFlow()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The agent to create a flow for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to create a flow for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to create a flow for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to create a flow for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The agent to create a flow for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.Flow flow_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Flow, + com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder> + flowBuilder_; + /** + * + * + *
+     * Required. The flow to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the flow field is set. + */ + public boolean hasFlow() { + return flowBuilder_ != null || flow_ != null; + } + /** + * + * + *
+     * Required. The flow to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The flow. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Flow getFlow() { + if (flowBuilder_ == null) { + return flow_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Flow.getDefaultInstance() + : flow_; + } else { + return flowBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The flow to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFlow(com.google.cloud.dialogflow.cx.v3beta1.Flow value) { + if (flowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + flow_ = value; + onChanged(); + } else { + flowBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The flow to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFlow(com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder builderForValue) { + if (flowBuilder_ == null) { + flow_ = builderForValue.build(); + onChanged(); + } else { + flowBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The flow to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFlow(com.google.cloud.dialogflow.cx.v3beta1.Flow value) { + if (flowBuilder_ == null) { + if (flow_ != null) { + flow_ = + com.google.cloud.dialogflow.cx.v3beta1.Flow.newBuilder(flow_) + .mergeFrom(value) + .buildPartial(); + } else { + flow_ = value; + } + onChanged(); + } else { + flowBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The flow to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFlow() { + if (flowBuilder_ == null) { + flow_ = null; + onChanged(); + } else { + flow_ = null; + flowBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The flow to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder getFlowBuilder() { + + onChanged(); + return getFlowFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The flow to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder getFlowOrBuilder() { + if (flowBuilder_ != null) { + return flowBuilder_.getMessageOrBuilder(); + } else { + return flow_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Flow.getDefaultInstance() + : flow_; + } + } + /** + * + * + *
+     * Required. The flow to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Flow, + com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder> + getFlowFieldBuilder() { + if (flowBuilder_ == null) { + flowBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Flow, + com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder>( + getFlow(), getParentForChildren(), isClean()); + flow_ = null; + } + return flowBuilder_; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language of the following fields in `flow`:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `flow`:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `flow`:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `flow`:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `flow`:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateFlowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateFlowRequest(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.dialogflow.cx.v3beta1.CreateFlowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateFlowRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateFlowRequestOrBuilder.java new file mode 100644 index 000000000..46a2b3017 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateFlowRequestOrBuilder.java @@ -0,0 +1,136 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface CreateFlowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The agent to create a flow for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The agent to create a flow for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The flow to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the flow field is set. + */ + boolean hasFlow(); + /** + * + * + *
+   * Required. The flow to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The flow. + */ + com.google.cloud.dialogflow.cx.v3beta1.Flow getFlow(); + /** + * + * + *
+   * Required. The flow to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder getFlowOrBuilder(); + + /** + * + * + *
+   * The language of the following fields in `flow`:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language of the following fields in `flow`:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateIntentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateIntentRequest.java new file mode 100644 index 000000000..bd703e6c9 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateIntentRequest.java @@ -0,0 +1,1181 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest} + */ +public final class CreateIntentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest) + CreateIntentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateIntentRequest.newBuilder() to construct. + private CreateIntentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateIntentRequest() { + parent_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateIntentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateIntentRequest( + 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.dialogflow.cx.v3beta1.Intent.Builder subBuilder = null; + if (intent_ != null) { + subBuilder = intent_.toBuilder(); + } + intent_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Intent.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(intent_); + intent_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The agent to create an intent for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 agent to create an intent for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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 INTENT_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.Intent intent_; + /** + * + * + *
+   * Required. The intent to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the intent field is set. + */ + @java.lang.Override + public boolean hasIntent() { + return intent_ != null; + } + /** + * + * + *
+   * Required. The intent to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The intent. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent() { + return intent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance() + : intent_; + } + /** + * + * + *
+   * Required. The intent to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder() { + return getIntent(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language of the following fields in `intent`:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language of the following fields in `intent`:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (intent_ != null) { + output.writeMessage(2, getIntent()); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); + } + 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 (intent_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getIntent()); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasIntent() != other.hasIntent()) return false; + if (hasIntent()) { + if (!getIntent().equals(other.getIntent())) return false; + } + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasIntent()) { + hash = (37 * hash) + INTENT_FIELD_NUMBER; + hash = (53 * hash) + getIntent().hashCode(); + } + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest 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.dialogflow.cx.v3beta1.CreateIntentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest 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.dialogflow.cx.v3beta1.CreateIntentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest 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.dialogflow.cx.v3beta1.CreateIntentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest 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.dialogflow.cx.v3beta1.CreateIntentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest 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.dialogflow.cx.v3beta1.CreateIntentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest) + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest.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 (intentBuilder_ == null) { + intent_ = null; + } else { + intent_ = null; + intentBuilder_ = null; + } + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateIntentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest(this); + result.parent_ = parent_; + if (intentBuilder_ == null) { + result.intent_ = intent_; + } else { + result.intent_ = intentBuilder_.build(); + } + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasIntent()) { + mergeIntent(other.getIntent()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The agent to create an intent for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to create an intent for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to create an intent for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to create an intent for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The agent to create an intent for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.Intent intent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder> + intentBuilder_; + /** + * + * + *
+     * Required. The intent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the intent field is set. + */ + public boolean hasIntent() { + return intentBuilder_ != null || intent_ != null; + } + /** + * + * + *
+     * Required. The intent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The intent. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent() { + if (intentBuilder_ == null) { + return intent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance() + : intent_; + } else { + return intentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The intent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setIntent(com.google.cloud.dialogflow.cx.v3beta1.Intent value) { + if (intentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + intent_ = value; + onChanged(); + } else { + intentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The intent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setIntent( + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder builderForValue) { + if (intentBuilder_ == null) { + intent_ = builderForValue.build(); + onChanged(); + } else { + intentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The intent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeIntent(com.google.cloud.dialogflow.cx.v3beta1.Intent value) { + if (intentBuilder_ == null) { + if (intent_ != null) { + intent_ = + com.google.cloud.dialogflow.cx.v3beta1.Intent.newBuilder(intent_) + .mergeFrom(value) + .buildPartial(); + } else { + intent_ = value; + } + onChanged(); + } else { + intentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The intent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearIntent() { + if (intentBuilder_ == null) { + intent_ = null; + onChanged(); + } else { + intent_ = null; + intentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The intent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder getIntentBuilder() { + + onChanged(); + return getIntentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The intent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder() { + if (intentBuilder_ != null) { + return intentBuilder_.getMessageOrBuilder(); + } else { + return intent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance() + : intent_; + } + } + /** + * + * + *
+     * Required. The intent to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder> + getIntentFieldBuilder() { + if (intentBuilder_ == null) { + intentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder>( + getIntent(), getParentForChildren(), isClean()); + intent_ = null; + } + return intentBuilder_; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language of the following fields in `intent`:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `intent`:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `intent`:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `intent`:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `intent`:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateIntentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateIntentRequest(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.dialogflow.cx.v3beta1.CreateIntentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateIntentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateIntentRequestOrBuilder.java new file mode 100644 index 000000000..aafaf2995 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateIntentRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface CreateIntentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The agent to create an intent for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The agent to create an intent for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The intent to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the intent field is set. + */ + boolean hasIntent(); + /** + * + * + *
+   * Required. The intent to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The intent. + */ + com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent(); + /** + * + * + *
+   * Required. The intent to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder(); + + /** + * + * + *
+   * The language of the following fields in `intent`:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language of the following fields in `intent`:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreatePageRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreatePageRequest.java new file mode 100644 index 000000000..fd39ad488 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreatePageRequest.java @@ -0,0 +1,1220 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreatePageRequest} + */ +public final class CreatePageRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.CreatePageRequest) + CreatePageRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreatePageRequest.newBuilder() to construct. + private CreatePageRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreatePageRequest() { + parent_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreatePageRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreatePageRequest( + 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.dialogflow.cx.v3beta1.Page.Builder subBuilder = null; + if (page_ != null) { + subBuilder = page_.toBuilder(); + } + page_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Page.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(page_); + page_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreatePageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreatePageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The flow to create a page for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 flow to create a page for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.Page page_; + /** + * + * + *
+   * Required. The page to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the page field is set. + */ + @java.lang.Override + public boolean hasPage() { + return page_ != null; + } + /** + * + * + *
+   * Required. The page to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The page. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Page getPage() { + return page_ == null ? com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance() : page_; + } + /** + * + * + *
+   * Required. The page to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getPageOrBuilder() { + return getPage(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language of the following fields in `page`:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language of the following fields in `page`:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (page_ != null) { + output.writeMessage(2, getPage()); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); + } + 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 (page_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPage()); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasPage() != other.hasPage()) return false; + if (hasPage()) { + if (!getPage().equals(other.getPage())) return false; + } + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasPage()) { + hash = (37 * hash) + PAGE_FIELD_NUMBER; + hash = (53 * hash) + getPage().hashCode(); + } + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest 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.dialogflow.cx.v3beta1.CreatePageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest 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.dialogflow.cx.v3beta1.CreatePageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest 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.dialogflow.cx.v3beta1.CreatePageRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest 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.dialogflow.cx.v3beta1.CreatePageRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest 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.dialogflow.cx.v3beta1.CreatePageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreatePageRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.CreatePageRequest) + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreatePageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreatePageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest.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 (pageBuilder_ == null) { + page_ = null; + } else { + page_ = null; + pageBuilder_ = null; + } + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreatePageRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest(this); + result.parent_ = parent_; + if (pageBuilder_ == null) { + result.page_ = page_; + } else { + result.page_ = pageBuilder_.build(); + } + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasPage()) { + mergePage(other.getPage()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The flow to create a page for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to create a page for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to create a page for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to create a page for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The flow to create a page for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.Page page_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder> + pageBuilder_; + /** + * + * + *
+     * Required. The page to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the page field is set. + */ + public boolean hasPage() { + return pageBuilder_ != null || page_ != null; + } + /** + * + * + *
+     * Required. The page to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The page. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Page getPage() { + if (pageBuilder_ == null) { + return page_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance() + : page_; + } else { + return pageBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The page to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPage(com.google.cloud.dialogflow.cx.v3beta1.Page value) { + if (pageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + page_ = value; + onChanged(); + } else { + pageBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The page to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPage(com.google.cloud.dialogflow.cx.v3beta1.Page.Builder builderForValue) { + if (pageBuilder_ == null) { + page_ = builderForValue.build(); + onChanged(); + } else { + pageBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The page to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePage(com.google.cloud.dialogflow.cx.v3beta1.Page value) { + if (pageBuilder_ == null) { + if (page_ != null) { + page_ = + com.google.cloud.dialogflow.cx.v3beta1.Page.newBuilder(page_) + .mergeFrom(value) + .buildPartial(); + } else { + page_ = value; + } + onChanged(); + } else { + pageBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The page to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPage() { + if (pageBuilder_ == null) { + page_ = null; + onChanged(); + } else { + page_ = null; + pageBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The page to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Page.Builder getPageBuilder() { + + onChanged(); + return getPageFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The page to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getPageOrBuilder() { + if (pageBuilder_ != null) { + return pageBuilder_.getMessageOrBuilder(); + } else { + return page_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance() + : page_; + } + } + /** + * + * + *
+     * Required. The page to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder> + getPageFieldBuilder() { + if (pageBuilder_ == null) { + pageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder>( + getPage(), getParentForChildren(), isClean()); + page_ = null; + } + return pageBuilder_; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language of the following fields in `page`:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `page`:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `page`:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `page`:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `page`:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.CreatePageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.CreatePageRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreatePageRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreatePageRequest(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.dialogflow.cx.v3beta1.CreatePageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreatePageRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreatePageRequestOrBuilder.java new file mode 100644 index 000000000..f6d3b3f67 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreatePageRequestOrBuilder.java @@ -0,0 +1,146 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface CreatePageRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.CreatePageRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The flow to create a page for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The flow to create a page for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The page to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the page field is set. + */ + boolean hasPage(); + /** + * + * + *
+   * Required. The page to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The page. + */ + com.google.cloud.dialogflow.cx.v3beta1.Page getPage(); + /** + * + * + *
+   * Required. The page to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getPageOrBuilder(); + + /** + * + * + *
+   * The language of the following fields in `page`:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language of the following fields in `page`:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateSessionEntityTypeRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateSessionEntityTypeRequest.java new file mode 100644 index 000000000..8abc93795 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateSessionEntityTypeRequest.java @@ -0,0 +1,986 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.CreateSessionEntityType].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest} + */ +public final class CreateSessionEntityTypeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest) + CreateSessionEntityTypeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSessionEntityTypeRequest.newBuilder() to construct. + private CreateSessionEntityTypeRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSessionEntityTypeRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSessionEntityTypeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateSessionEntityTypeRequest( + 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.dialogflow.cx.v3beta1.SessionEntityType.Builder subBuilder = null; + if (sessionEntityType_ != null) { + subBuilder = sessionEntityType_.toBuilder(); + } + sessionEntityType_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sessionEntityType_); + sessionEntityType_ = 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.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateSessionEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateSessionEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The session to create a session entity type for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 session to create a session entity type for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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 SESSION_ENTITY_TYPE_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType sessionEntityType_; + /** + * + * + *
+   * Required. The session entity type to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sessionEntityType field is set. + */ + @java.lang.Override + public boolean hasSessionEntityType() { + return sessionEntityType_ != null; + } + /** + * + * + *
+   * Required. The session entity type to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sessionEntityType. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityType() { + return sessionEntityType_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.getDefaultInstance() + : sessionEntityType_; + } + /** + * + * + *
+   * Required. The session entity type to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder + getSessionEntityTypeOrBuilder() { + return getSessionEntityType(); + } + + 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 (sessionEntityType_ != null) { + output.writeMessage(2, getSessionEntityType()); + } + 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 (sessionEntityType_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSessionEntityType()); + } + 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.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasSessionEntityType() != other.hasSessionEntityType()) return false; + if (hasSessionEntityType()) { + if (!getSessionEntityType().equals(other.getSessionEntityType())) 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 (hasSessionEntityType()) { + hash = (37 * hash) + SESSION_ENTITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getSessionEntityType().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + 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.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.CreateSessionEntityType].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest) + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateSessionEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateSessionEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest.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 (sessionEntityTypeBuilder_ == null) { + sessionEntityType_ = null; + } else { + sessionEntityType_ = null; + sessionEntityTypeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateSessionEntityTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest(this); + result.parent_ = parent_; + if (sessionEntityTypeBuilder_ == null) { + result.sessionEntityType_ = sessionEntityType_; + } else { + result.sessionEntityType_ = sessionEntityTypeBuilder_.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.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasSessionEntityType()) { + mergeSessionEntityType(other.getSessionEntityType()); + } + 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.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The session to create a session entity type for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 session to create a session entity type for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 session to create a session entity type for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 session to create a session entity type for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The session to create a session entity type for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.SessionEntityType sessionEntityType_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder> + sessionEntityTypeBuilder_; + /** + * + * + *
+     * Required. The session entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sessionEntityType field is set. + */ + public boolean hasSessionEntityType() { + return sessionEntityTypeBuilder_ != null || sessionEntityType_ != null; + } + /** + * + * + *
+     * Required. The session entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sessionEntityType. + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityType() { + if (sessionEntityTypeBuilder_ == null) { + return sessionEntityType_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.getDefaultInstance() + : sessionEntityType_; + } else { + return sessionEntityTypeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The session entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType value) { + if (sessionEntityTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sessionEntityType_ = value; + onChanged(); + } else { + sessionEntityTypeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The session entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder builderForValue) { + if (sessionEntityTypeBuilder_ == null) { + sessionEntityType_ = builderForValue.build(); + onChanged(); + } else { + sessionEntityTypeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The session entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType value) { + if (sessionEntityTypeBuilder_ == null) { + if (sessionEntityType_ != null) { + sessionEntityType_ = + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.newBuilder( + sessionEntityType_) + .mergeFrom(value) + .buildPartial(); + } else { + sessionEntityType_ = value; + } + onChanged(); + } else { + sessionEntityTypeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The session entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSessionEntityType() { + if (sessionEntityTypeBuilder_ == null) { + sessionEntityType_ = null; + onChanged(); + } else { + sessionEntityType_ = null; + sessionEntityTypeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The session entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder + getSessionEntityTypeBuilder() { + + onChanged(); + return getSessionEntityTypeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The session entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder + getSessionEntityTypeOrBuilder() { + if (sessionEntityTypeBuilder_ != null) { + return sessionEntityTypeBuilder_.getMessageOrBuilder(); + } else { + return sessionEntityType_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.getDefaultInstance() + : sessionEntityType_; + } + } + /** + * + * + *
+     * Required. The session entity type to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder> + getSessionEntityTypeFieldBuilder() { + if (sessionEntityTypeBuilder_ == null) { + sessionEntityTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder>( + getSessionEntityType(), getParentForChildren(), isClean()); + sessionEntityType_ = null; + } + return sessionEntityTypeBuilder_; + } + + @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.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSessionEntityTypeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateSessionEntityTypeRequest(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.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateSessionEntityTypeRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateSessionEntityTypeRequestOrBuilder.java new file mode 100644 index 000000000..89883e2a9 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateSessionEntityTypeRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface CreateSessionEntityTypeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The session to create a session entity type for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The session to create a session entity type for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The session entity type to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sessionEntityType field is set. + */ + boolean hasSessionEntityType(); + /** + * + * + *
+   * Required. The session entity type to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sessionEntityType. + */ + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityType(); + /** + * + * + *
+   * Required. The session entity type to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder getSessionEntityTypeOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateTransitionRouteGroupRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateTransitionRouteGroupRequest.java new file mode 100644 index 000000000..289f09e39 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateTransitionRouteGroupRequest.java @@ -0,0 +1,1220 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest} + */ +public final class CreateTransitionRouteGroupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest) + CreateTransitionRouteGroupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateTransitionRouteGroupRequest.newBuilder() to construct. + private CreateTransitionRouteGroupRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateTransitionRouteGroupRequest() { + parent_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateTransitionRouteGroupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateTransitionRouteGroupRequest( + 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.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder subBuilder = null; + if (transitionRouteGroup_ != null) { + subBuilder = transitionRouteGroup_.toBuilder(); + } + transitionRouteGroup_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(transitionRouteGroup_); + transitionRouteGroup_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateTransitionRouteGroupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateTransitionRouteGroupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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 TRANSITION_ROUTE_GROUP_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transitionRouteGroup_; + /** + * + * + *
+   * Required. The transition route group to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the transitionRouteGroup field is set. + */ + @java.lang.Override + public boolean hasTransitionRouteGroup() { + return transitionRouteGroup_ != null; + } + /** + * + * + *
+   * Required. The transition route group to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The transitionRouteGroup. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup getTransitionRouteGroup() { + return transitionRouteGroup_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.getDefaultInstance() + : transitionRouteGroup_; + } + /** + * + * + *
+   * Required. The transition route group to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder + getTransitionRouteGroupOrBuilder() { + return getTransitionRouteGroup(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (transitionRouteGroup_ != null) { + output.writeMessage(2, getTransitionRouteGroup()); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); + } + 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 (transitionRouteGroup_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getTransitionRouteGroup()); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasTransitionRouteGroup() != other.hasTransitionRouteGroup()) return false; + if (hasTransitionRouteGroup()) { + if (!getTransitionRouteGroup().equals(other.getTransitionRouteGroup())) return false; + } + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasTransitionRouteGroup()) { + hash = (37 * hash) + TRANSITION_ROUTE_GROUP_FIELD_NUMBER; + hash = (53 * hash) + getTransitionRouteGroup().hashCode(); + } + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + 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.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest) + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateTransitionRouteGroupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateTransitionRouteGroupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest.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 (transitionRouteGroupBuilder_ == null) { + transitionRouteGroup_ = null; + } else { + transitionRouteGroup_ = null; + transitionRouteGroupBuilder_ = null; + } + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateTransitionRouteGroupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest(this); + result.parent_ = parent_; + if (transitionRouteGroupBuilder_ == null) { + result.transitionRouteGroup_ = transitionRouteGroup_; + } else { + result.transitionRouteGroup_ = transitionRouteGroupBuilder_.build(); + } + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasTransitionRouteGroup()) { + mergeTransitionRouteGroup(other.getTransitionRouteGroup()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.TransitionRouteGroup transitionRouteGroup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder> + transitionRouteGroupBuilder_; + /** + * + * + *
+     * Required. The transition route group to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the transitionRouteGroup field is set. + */ + public boolean hasTransitionRouteGroup() { + return transitionRouteGroupBuilder_ != null || transitionRouteGroup_ != null; + } + /** + * + * + *
+     * Required. The transition route group to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The transitionRouteGroup. + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup getTransitionRouteGroup() { + if (transitionRouteGroupBuilder_ == null) { + return transitionRouteGroup_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.getDefaultInstance() + : transitionRouteGroup_; + } else { + return transitionRouteGroupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The transition route group to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup value) { + if (transitionRouteGroupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transitionRouteGroup_ = value; + onChanged(); + } else { + transitionRouteGroupBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The transition route group to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder builderForValue) { + if (transitionRouteGroupBuilder_ == null) { + transitionRouteGroup_ = builderForValue.build(); + onChanged(); + } else { + transitionRouteGroupBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The transition route group to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup value) { + if (transitionRouteGroupBuilder_ == null) { + if (transitionRouteGroup_ != null) { + transitionRouteGroup_ = + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.newBuilder( + transitionRouteGroup_) + .mergeFrom(value) + .buildPartial(); + } else { + transitionRouteGroup_ = value; + } + onChanged(); + } else { + transitionRouteGroupBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The transition route group to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearTransitionRouteGroup() { + if (transitionRouteGroupBuilder_ == null) { + transitionRouteGroup_ = null; + onChanged(); + } else { + transitionRouteGroup_ = null; + transitionRouteGroupBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The transition route group to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder + getTransitionRouteGroupBuilder() { + + onChanged(); + return getTransitionRouteGroupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The transition route group to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder + getTransitionRouteGroupOrBuilder() { + if (transitionRouteGroupBuilder_ != null) { + return transitionRouteGroupBuilder_.getMessageOrBuilder(); + } else { + return transitionRouteGroup_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.getDefaultInstance() + : transitionRouteGroup_; + } + } + /** + * + * + *
+     * Required. The transition route group to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder> + getTransitionRouteGroupFieldBuilder() { + if (transitionRouteGroupBuilder_ == null) { + transitionRouteGroupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder>( + getTransitionRouteGroup(), getParentForChildren(), isClean()); + transitionRouteGroup_ = null; + } + return transitionRouteGroupBuilder_; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateTransitionRouteGroupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateTransitionRouteGroupRequest(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.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateTransitionRouteGroupRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateTransitionRouteGroupRequestOrBuilder.java new file mode 100644 index 000000000..e9fa12e86 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateTransitionRouteGroupRequestOrBuilder.java @@ -0,0 +1,139 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface CreateTransitionRouteGroupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The transition route group to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the transitionRouteGroup field is set. + */ + boolean hasTransitionRouteGroup(); + /** + * + * + *
+   * Required. The transition route group to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The transitionRouteGroup. + */ + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup getTransitionRouteGroup(); + /** + * + * + *
+   * Required. The transition route group to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder + getTransitionRouteGroupOrBuilder(); + + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateVersionOperationMetadata.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateVersionOperationMetadata.java new file mode 100644 index 000000000..0afce8f84 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateVersionOperationMetadata.java @@ -0,0 +1,665 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Metadata associated with the long running operation for
+ * [Versions.CreateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersion].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata} + */ +public final class CreateVersionOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata) + CreateVersionOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateVersionOperationMetadata.newBuilder() to construct. + private CreateVersionOperationMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateVersionOperationMetadata() { + version_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateVersionOperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateVersionOperationMetadata( + 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(); + + version_ = 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.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata.Builder.class); + } + + public static final int VERSION_FIELD_NUMBER = 1; + private volatile java.lang.Object version_; + /** + * + * + *
+   * Name of the created version.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * string version = 1 [(.google.api.resource_reference) = { ... } + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + 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(); + version_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the created version.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * string version = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = 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 (!getVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, version_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, version_); + } + 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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata other = + (com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata) obj; + + if (!getVersion().equals(other.getVersion())) 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) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata 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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata 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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata 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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + 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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata 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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata 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 associated with the long running operation for
+   * [Versions.CreateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersion].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata) + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata.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(); + version_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata build() { + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata result = + new com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata(this); + result.version_ = version_; + 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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + .getDefaultInstance()) return this; + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + 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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+     * Name of the created version.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * string version = 1 [(.google.api.resource_reference) = { ... } + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the created version.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * string version = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the created version.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * string version = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the created version.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * string version = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the created version.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * string version = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = 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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata) + private static final com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateVersionOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateVersionOperationMetadata(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.dialogflow.cx.v3beta1.CreateVersionOperationMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateVersionOperationMetadataOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateVersionOperationMetadataOrBuilder.java new file mode 100644 index 000000000..e383c9ae0 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateVersionOperationMetadataOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface CreateVersionOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the created version.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * string version = 1 [(.google.api.resource_reference) = { ... } + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+   * Name of the created version.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * string version = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateVersionRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateVersionRequest.java new file mode 100644 index 000000000..605761c74 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateVersionRequest.java @@ -0,0 +1,967 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Versions.CreateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersion].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest} + */ +public final class CreateVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest) + CreateVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateVersionRequest.newBuilder() to construct. + private CreateVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateVersionRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateVersionRequest( + 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.dialogflow.cx.v3beta1.Version.Builder subBuilder = null; + if (version_ != null) { + subBuilder = version_.toBuilder(); + } + version_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Version.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(version_); + version_ = 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.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an [Version][google.cloud.dialogflow.cx.v3beta1.Version] for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an [Version][google.cloud.dialogflow.cx.v3beta1.Version] for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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 VERSION_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.Version version_; + /** + * + * + *
+   * Required. The version to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the version field is set. + */ + @java.lang.Override + public boolean hasVersion() { + return version_ != null; + } + /** + * + * + *
+   * Required. The version to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The version. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Version getVersion() { + return version_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Version.getDefaultInstance() + : version_; + } + /** + * + * + *
+   * Required. The version to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder getVersionOrBuilder() { + return getVersion(); + } + + 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 (version_ != null) { + output.writeMessage(2, getVersion()); + } + 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 (version_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getVersion()); + } + 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.dialogflow.cx.v3beta1.CreateVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasVersion() != other.hasVersion()) return false; + if (hasVersion()) { + if (!getVersion().equals(other.getVersion())) 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 (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest 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.dialogflow.cx.v3beta1.CreateVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest 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.dialogflow.cx.v3beta1.CreateVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest 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.dialogflow.cx.v3beta1.CreateVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest 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.dialogflow.cx.v3beta1.CreateVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest 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.dialogflow.cx.v3beta1.CreateVersionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Versions.CreateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersion].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest) + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest.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 (versionBuilder_ == null) { + version_ = null; + } else { + version_ = null; + versionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest(this); + result.parent_ = parent_; + if (versionBuilder_ == null) { + result.version_ = version_; + } else { + result.version_ = versionBuilder_.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.dialogflow.cx.v3beta1.CreateVersionRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasVersion()) { + mergeVersion(other.getVersion()); + } + 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.dialogflow.cx.v3beta1.CreateVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an [Version][google.cloud.dialogflow.cx.v3beta1.Version] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an [Version][google.cloud.dialogflow.cx.v3beta1.Version] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an [Version][google.cloud.dialogflow.cx.v3beta1.Version] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an [Version][google.cloud.dialogflow.cx.v3beta1.Version] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an [Version][google.cloud.dialogflow.cx.v3beta1.Version] for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.Version version_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Version, + com.google.cloud.dialogflow.cx.v3beta1.Version.Builder, + com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder> + versionBuilder_; + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the version field is set. + */ + public boolean hasVersion() { + return versionBuilder_ != null || version_ != null; + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The version. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Version getVersion() { + if (versionBuilder_ == null) { + return version_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Version.getDefaultInstance() + : version_; + } else { + return versionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setVersion(com.google.cloud.dialogflow.cx.v3beta1.Version value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + onChanged(); + } else { + versionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setVersion( + com.google.cloud.dialogflow.cx.v3beta1.Version.Builder builderForValue) { + if (versionBuilder_ == null) { + version_ = builderForValue.build(); + onChanged(); + } else { + versionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeVersion(com.google.cloud.dialogflow.cx.v3beta1.Version value) { + if (versionBuilder_ == null) { + if (version_ != null) { + version_ = + com.google.cloud.dialogflow.cx.v3beta1.Version.newBuilder(version_) + .mergeFrom(value) + .buildPartial(); + } else { + version_ = value; + } + onChanged(); + } else { + versionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearVersion() { + if (versionBuilder_ == null) { + version_ = null; + onChanged(); + } else { + version_ = null; + versionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Version.Builder getVersionBuilder() { + + onChanged(); + return getVersionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder getVersionOrBuilder() { + if (versionBuilder_ != null) { + return versionBuilder_.getMessageOrBuilder(); + } else { + return version_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Version.getDefaultInstance() + : version_; + } + } + /** + * + * + *
+     * Required. The version to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Version, + com.google.cloud.dialogflow.cx.v3beta1.Version.Builder, + com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder> + getVersionFieldBuilder() { + if (versionBuilder_ == null) { + versionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Version, + com.google.cloud.dialogflow.cx.v3beta1.Version.Builder, + com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder>( + getVersion(), getParentForChildren(), isClean()); + version_ = null; + } + return versionBuilder_; + } + + @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.dialogflow.cx.v3beta1.CreateVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateVersionRequest(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.dialogflow.cx.v3beta1.CreateVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateVersionRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateVersionRequestOrBuilder.java new file mode 100644 index 000000000..a25028505 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateVersionRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface CreateVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an [Version][google.cloud.dialogflow.cx.v3beta1.Version] for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an [Version][google.cloud.dialogflow.cx.v3beta1.Version] for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The version to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the version field is set. + */ + boolean hasVersion(); + /** + * + * + *
+   * Required. The version to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The version. + */ + com.google.cloud.dialogflow.cx.v3beta1.Version getVersion(); + /** + * + * + *
+   * Required. The version to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder getVersionOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateWebhookRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateWebhookRequest.java new file mode 100644 index 000000000..052aca789 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateWebhookRequest.java @@ -0,0 +1,960 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest} + */ +public final class CreateWebhookRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest) + CreateWebhookRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateWebhookRequest.newBuilder() to construct. + private CreateWebhookRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateWebhookRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateWebhookRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateWebhookRequest( + 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.dialogflow.cx.v3beta1.Webhook.Builder subBuilder = null; + if (webhook_ != null) { + subBuilder = webhook_.toBuilder(); + } + webhook_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(webhook_); + webhook_ = 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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateWebhookRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateWebhookRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The agent to create a webhook for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 agent to create a webhook for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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 WEBHOOK_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.Webhook webhook_; + /** + * + * + *
+   * Required. The webhook to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the webhook field is set. + */ + @java.lang.Override + public boolean hasWebhook() { + return webhook_ != null; + } + /** + * + * + *
+   * Required. The webhook to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The webhook. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Webhook getWebhook() { + return webhook_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Webhook.getDefaultInstance() + : webhook_; + } + /** + * + * + *
+   * Required. The webhook to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder getWebhookOrBuilder() { + return getWebhook(); + } + + 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 (webhook_ != null) { + output.writeMessage(2, getWebhook()); + } + 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 (webhook_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getWebhook()); + } + 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.dialogflow.cx.v3beta1.CreateWebhookRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasWebhook() != other.hasWebhook()) return false; + if (hasWebhook()) { + if (!getWebhook().equals(other.getWebhook())) 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 (hasWebhook()) { + hash = (37 * hash) + WEBHOOK_FIELD_NUMBER; + hash = (53 * hash) + getWebhook().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest 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.dialogflow.cx.v3beta1.CreateWebhookRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest 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.dialogflow.cx.v3beta1.CreateWebhookRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest 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.dialogflow.cx.v3beta1.CreateWebhookRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest 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.dialogflow.cx.v3beta1.CreateWebhookRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest 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.dialogflow.cx.v3beta1.CreateWebhookRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest) + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateWebhookRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateWebhookRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest.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 (webhookBuilder_ == null) { + webhook_ = null; + } else { + webhook_ = null; + webhookBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_CreateWebhookRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest(this); + result.parent_ = parent_; + if (webhookBuilder_ == null) { + result.webhook_ = webhook_; + } else { + result.webhook_ = webhookBuilder_.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.dialogflow.cx.v3beta1.CreateWebhookRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasWebhook()) { + mergeWebhook(other.getWebhook()); + } + 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.dialogflow.cx.v3beta1.CreateWebhookRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The agent to create a webhook for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to create a webhook for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to create a webhook for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to create a webhook for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The agent to create a webhook for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.Webhook webhook_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Webhook, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder> + webhookBuilder_; + /** + * + * + *
+     * Required. The webhook to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the webhook field is set. + */ + public boolean hasWebhook() { + return webhookBuilder_ != null || webhook_ != null; + } + /** + * + * + *
+     * Required. The webhook to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The webhook. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Webhook getWebhook() { + if (webhookBuilder_ == null) { + return webhook_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Webhook.getDefaultInstance() + : webhook_; + } else { + return webhookBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The webhook to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWebhook(com.google.cloud.dialogflow.cx.v3beta1.Webhook value) { + if (webhookBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + webhook_ = value; + onChanged(); + } else { + webhookBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The webhook to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWebhook( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder builderForValue) { + if (webhookBuilder_ == null) { + webhook_ = builderForValue.build(); + onChanged(); + } else { + webhookBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The webhook to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWebhook(com.google.cloud.dialogflow.cx.v3beta1.Webhook value) { + if (webhookBuilder_ == null) { + if (webhook_ != null) { + webhook_ = + com.google.cloud.dialogflow.cx.v3beta1.Webhook.newBuilder(webhook_) + .mergeFrom(value) + .buildPartial(); + } else { + webhook_ = value; + } + onChanged(); + } else { + webhookBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The webhook to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearWebhook() { + if (webhookBuilder_ == null) { + webhook_ = null; + onChanged(); + } else { + webhook_ = null; + webhookBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The webhook to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder getWebhookBuilder() { + + onChanged(); + return getWebhookFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The webhook to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder getWebhookOrBuilder() { + if (webhookBuilder_ != null) { + return webhookBuilder_.getMessageOrBuilder(); + } else { + return webhook_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Webhook.getDefaultInstance() + : webhook_; + } + } + /** + * + * + *
+     * Required. The webhook to create.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Webhook, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder> + getWebhookFieldBuilder() { + if (webhookBuilder_ == null) { + webhookBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Webhook, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder>( + getWebhook(), getParentForChildren(), isClean()); + webhook_ = null; + } + return webhookBuilder_; + } + + @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.dialogflow.cx.v3beta1.CreateWebhookRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateWebhookRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateWebhookRequest(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.dialogflow.cx.v3beta1.CreateWebhookRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateWebhookRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateWebhookRequestOrBuilder.java new file mode 100644 index 000000000..163f54758 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/CreateWebhookRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface CreateWebhookRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The agent to create a webhook for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The agent to create a webhook for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The webhook to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the webhook field is set. + */ + boolean hasWebhook(); + /** + * + * + *
+   * Required. The webhook to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The webhook. + */ + com.google.cloud.dialogflow.cx.v3beta1.Webhook getWebhook(); + /** + * + * + *
+   * Required. The webhook to create.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder getWebhookOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteAgentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteAgentRequest.java new file mode 100644 index 000000000..24112eae0 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteAgentRequest.java @@ -0,0 +1,658 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Agents.DeleteAgent][google.cloud.dialogflow.cx.v3beta1.Agents.DeleteAgent].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest} + */ +public final class DeleteAgentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest) + DeleteAgentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteAgentRequest.newBuilder() to construct. + private DeleteAgentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteAgentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteAgentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteAgentRequest( + 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.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteAgentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteAgentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the agent to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the agent to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.dialogflow.cx.v3beta1.DeleteAgentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest) 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.dialogflow.cx.v3beta1.DeleteAgentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest 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.dialogflow.cx.v3beta1.DeleteAgentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest 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.dialogflow.cx.v3beta1.DeleteAgentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest 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.dialogflow.cx.v3beta1.DeleteAgentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest 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.dialogflow.cx.v3beta1.DeleteAgentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest 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.dialogflow.cx.v3beta1.DeleteAgentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Agents.DeleteAgent][google.cloud.dialogflow.cx.v3beta1.Agents.DeleteAgent].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest) + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteAgentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteAgentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest.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.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteAgentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest(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.dialogflow.cx.v3beta1.DeleteAgentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest.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.dialogflow.cx.v3beta1.DeleteAgentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the agent to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the agent to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the agent to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the agent to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the agent to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.DeleteAgentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteAgentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteAgentRequest(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.dialogflow.cx.v3beta1.DeleteAgentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteAgentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteAgentRequestOrBuilder.java new file mode 100644 index 000000000..350e2ed90 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteAgentRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface DeleteAgentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the agent to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the agent to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteEntityTypeRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteEntityTypeRequest.java new file mode 100644 index 000000000..3c3d0bfba --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteEntityTypeRequest.java @@ -0,0 +1,671 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.DeleteEntityType].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest} + */ +public final class DeleteEntityTypeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest) + DeleteEntityTypeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteEntityTypeRequest.newBuilder() to construct. + private DeleteEntityTypeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteEntityTypeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteEntityTypeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteEntityTypeRequest( + 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.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the entity type to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the entity type to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.dialogflow.cx.v3beta1.DeleteEntityTypeRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest) 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.dialogflow.cx.v3beta1.DeleteEntityTypeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest 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.dialogflow.cx.v3beta1.DeleteEntityTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest 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.dialogflow.cx.v3beta1.DeleteEntityTypeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest 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.dialogflow.cx.v3beta1.DeleteEntityTypeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest 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.dialogflow.cx.v3beta1.DeleteEntityTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest 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.dialogflow.cx.v3beta1.DeleteEntityTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.DeleteEntityType].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest) + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest.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.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEntityTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest(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.dialogflow.cx.v3beta1.DeleteEntityTypeRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest.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.dialogflow.cx.v3beta1.DeleteEntityTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the entity type to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the entity type to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the entity type to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the entity type to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the entity type to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.DeleteEntityTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteEntityTypeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteEntityTypeRequest(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.dialogflow.cx.v3beta1.DeleteEntityTypeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteEntityTypeRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteEntityTypeRequestOrBuilder.java new file mode 100644 index 000000000..f6ffcf650 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteEntityTypeRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface DeleteEntityTypeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the entity type to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the entity type to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteEnvironmentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteEnvironmentRequest.java new file mode 100644 index 000000000..e936a786b --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteEnvironmentRequest.java @@ -0,0 +1,672 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Environments.DeleteEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.DeleteEnvironment].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest} + */ +public final class DeleteEnvironmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest) + DeleteEnvironmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteEnvironmentRequest.newBuilder() to construct. + private DeleteEnvironmentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteEnvironmentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteEnvironmentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteEnvironmentRequest( + 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.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEnvironmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEnvironmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.dialogflow.cx.v3beta1.DeleteEnvironmentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest) 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.dialogflow.cx.v3beta1.DeleteEnvironmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest 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.dialogflow.cx.v3beta1.DeleteEnvironmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest 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.dialogflow.cx.v3beta1.DeleteEnvironmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest 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.dialogflow.cx.v3beta1.DeleteEnvironmentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest 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.dialogflow.cx.v3beta1.DeleteEnvironmentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest 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.dialogflow.cx.v3beta1.DeleteEnvironmentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Environments.DeleteEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.DeleteEnvironment].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest) + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEnvironmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEnvironmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest.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.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEnvironmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest(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.dialogflow.cx.v3beta1.DeleteEnvironmentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest.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.dialogflow.cx.v3beta1.DeleteEnvironmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.DeleteEnvironmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteEnvironmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteEnvironmentRequest(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.dialogflow.cx.v3beta1.DeleteEnvironmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteEnvironmentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteEnvironmentRequestOrBuilder.java new file mode 100644 index 000000000..10a04b57b --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteEnvironmentRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface DeleteEnvironmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteFlowRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteFlowRequest.java new file mode 100644 index 000000000..094f6020c --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteFlowRequest.java @@ -0,0 +1,775 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Flows.DeleteFlow][google.cloud.dialogflow.cx.v3beta1.Flows.DeleteFlow].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest} + */ +public final class DeleteFlowRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest) + DeleteFlowRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteFlowRequest.newBuilder() to construct. + private DeleteFlowRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteFlowRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteFlowRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteFlowRequest( + 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 16: + { + 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.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteFlowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteFlowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the flow to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the flow to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORCE_FIELD_NUMBER = 2; + private boolean force_; + /** + * + * + *
+   * This field has no effect for flows with no incoming transitions.
+   * For flows with incoming transitions:
+   * *  If `force` is set to false, an error will be returned with message
+   *    indicating the incoming transitions.
+   * *  If `force` is set to true, Dialogflow will remove the flow, as well as
+   *    any transitions to the flow.
+   * 
+ * + * bool force = 2; + * + * @return The force. + */ + @java.lang.Override + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (force_ != false) { + output.writeBool(2, force_); + } + 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 (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, 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.dialogflow.cx.v3beta1.DeleteFlowRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().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.dialogflow.cx.v3beta1.DeleteFlowRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest 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.dialogflow.cx.v3beta1.DeleteFlowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest 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.dialogflow.cx.v3beta1.DeleteFlowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest 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.dialogflow.cx.v3beta1.DeleteFlowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest 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.dialogflow.cx.v3beta1.DeleteFlowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest 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.dialogflow.cx.v3beta1.DeleteFlowRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Flows.DeleteFlow][google.cloud.dialogflow.cx.v3beta1.Flows.DeleteFlow].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest) + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteFlowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteFlowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest.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_ = ""; + + force_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteFlowRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest(this); + result.name_ = name_; + 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.dialogflow.cx.v3beta1.DeleteFlowRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.dialogflow.cx.v3beta1.DeleteFlowRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the flow to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the flow to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the flow to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the flow to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the flow to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 boolean force_; + /** + * + * + *
+     * This field has no effect for flows with no incoming transitions.
+     * For flows with incoming transitions:
+     * *  If `force` is set to false, an error will be returned with message
+     *    indicating the incoming transitions.
+     * *  If `force` is set to true, Dialogflow will remove the flow, as well as
+     *    any transitions to the flow.
+     * 
+ * + * bool force = 2; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * This field has no effect for flows with no incoming transitions.
+     * For flows with incoming transitions:
+     * *  If `force` is set to false, an error will be returned with message
+     *    indicating the incoming transitions.
+     * *  If `force` is set to true, Dialogflow will remove the flow, as well as
+     *    any transitions to the flow.
+     * 
+ * + * bool force = 2; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This field has no effect for flows with no incoming transitions.
+     * For flows with incoming transitions:
+     * *  If `force` is set to false, an error will be returned with message
+     *    indicating the incoming transitions.
+     * *  If `force` is set to true, Dialogflow will remove the flow, as well as
+     *    any transitions to the flow.
+     * 
+ * + * bool force = 2; + * + * @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.dialogflow.cx.v3beta1.DeleteFlowRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteFlowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteFlowRequest(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.dialogflow.cx.v3beta1.DeleteFlowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteFlowRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteFlowRequestOrBuilder.java new file mode 100644 index 000000000..5fc906c52 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteFlowRequestOrBuilder.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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface DeleteFlowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the flow to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the flow to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * This field has no effect for flows with no incoming transitions.
+   * For flows with incoming transitions:
+   * *  If `force` is set to false, an error will be returned with message
+   *    indicating the incoming transitions.
+   * *  If `force` is set to true, Dialogflow will remove the flow, as well as
+   *    any transitions to the flow.
+   * 
+ * + * bool force = 2; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteIntentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteIntentRequest.java new file mode 100644 index 000000000..4038935b2 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteIntentRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Intents.DeleteIntent][google.cloud.dialogflow.cx.v3beta1.Intents.DeleteIntent].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest} + */ +public final class DeleteIntentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest) + DeleteIntentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteIntentRequest.newBuilder() to construct. + private DeleteIntentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteIntentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteIntentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteIntentRequest( + 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.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the intent to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the intent to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.dialogflow.cx.v3beta1.DeleteIntentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest) 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.dialogflow.cx.v3beta1.DeleteIntentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest 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.dialogflow.cx.v3beta1.DeleteIntentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest 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.dialogflow.cx.v3beta1.DeleteIntentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest 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.dialogflow.cx.v3beta1.DeleteIntentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest 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.dialogflow.cx.v3beta1.DeleteIntentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest 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.dialogflow.cx.v3beta1.DeleteIntentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Intents.DeleteIntent][google.cloud.dialogflow.cx.v3beta1.Intents.DeleteIntent].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest) + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest.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.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteIntentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest(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.dialogflow.cx.v3beta1.DeleteIntentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest.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.dialogflow.cx.v3beta1.DeleteIntentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the intent to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the intent to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the intent to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the intent to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the intent to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.DeleteIntentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteIntentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteIntentRequest(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.dialogflow.cx.v3beta1.DeleteIntentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteIntentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteIntentRequestOrBuilder.java new file mode 100644 index 000000000..949b36218 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteIntentRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface DeleteIntentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the intent to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the intent to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeletePageRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeletePageRequest.java new file mode 100644 index 000000000..5c32d8b2e --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeletePageRequest.java @@ -0,0 +1,775 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Pages.DeletePage][google.cloud.dialogflow.cx.v3beta1.Pages.DeletePage].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeletePageRequest} + */ +public final class DeletePageRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.DeletePageRequest) + DeletePageRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeletePageRequest.newBuilder() to construct. + private DeletePageRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeletePageRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeletePageRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeletePageRequest( + 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 16: + { + 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.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeletePageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeletePageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the page to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/Flows/<flow ID>/pages/<Page ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the page to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/Flows/<flow ID>/pages/<Page ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORCE_FIELD_NUMBER = 2; + private boolean force_; + /** + * + * + *
+   * This field has no effect for pages with no incoming transitions.
+   * For pages with incoming transitions:
+   * *  If `force` is set to false, an error will be returned with message
+   *    indicating the incoming transitions.
+   * *  If `force` is set to true, Dialogflow will remove the page, as well as
+   *    any transitions to the page.
+   * 
+ * + * bool force = 2; + * + * @return The force. + */ + @java.lang.Override + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (force_ != false) { + output.writeBool(2, force_); + } + 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 (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, 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.dialogflow.cx.v3beta1.DeletePageRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().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.dialogflow.cx.v3beta1.DeletePageRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest 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.dialogflow.cx.v3beta1.DeletePageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest 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.dialogflow.cx.v3beta1.DeletePageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest 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.dialogflow.cx.v3beta1.DeletePageRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest 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.dialogflow.cx.v3beta1.DeletePageRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest 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.dialogflow.cx.v3beta1.DeletePageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Pages.DeletePage][google.cloud.dialogflow.cx.v3beta1.Pages.DeletePage].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeletePageRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.DeletePageRequest) + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeletePageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeletePageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest.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_ = ""; + + force_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeletePageRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest(this); + result.name_ = name_; + 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.dialogflow.cx.v3beta1.DeletePageRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.dialogflow.cx.v3beta1.DeletePageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the page to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/Flows/<flow ID>/pages/<Page ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the page to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/Flows/<flow ID>/pages/<Page ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the page to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/Flows/<flow ID>/pages/<Page ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the page to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/Flows/<flow ID>/pages/<Page ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the page to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/Flows/<flow ID>/pages/<Page ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 boolean force_; + /** + * + * + *
+     * This field has no effect for pages with no incoming transitions.
+     * For pages with incoming transitions:
+     * *  If `force` is set to false, an error will be returned with message
+     *    indicating the incoming transitions.
+     * *  If `force` is set to true, Dialogflow will remove the page, as well as
+     *    any transitions to the page.
+     * 
+ * + * bool force = 2; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * This field has no effect for pages with no incoming transitions.
+     * For pages with incoming transitions:
+     * *  If `force` is set to false, an error will be returned with message
+     *    indicating the incoming transitions.
+     * *  If `force` is set to true, Dialogflow will remove the page, as well as
+     *    any transitions to the page.
+     * 
+ * + * bool force = 2; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This field has no effect for pages with no incoming transitions.
+     * For pages with incoming transitions:
+     * *  If `force` is set to false, an error will be returned with message
+     *    indicating the incoming transitions.
+     * *  If `force` is set to true, Dialogflow will remove the page, as well as
+     *    any transitions to the page.
+     * 
+ * + * bool force = 2; + * + * @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.dialogflow.cx.v3beta1.DeletePageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.DeletePageRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeletePageRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeletePageRequest(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.dialogflow.cx.v3beta1.DeletePageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeletePageRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeletePageRequestOrBuilder.java new file mode 100644 index 000000000..70e780e4f --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeletePageRequestOrBuilder.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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface DeletePageRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.DeletePageRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the page to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/Flows/<flow ID>/pages/<Page ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the page to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/Flows/<flow ID>/pages/<Page ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * This field has no effect for pages with no incoming transitions.
+   * For pages with incoming transitions:
+   * *  If `force` is set to false, an error will be returned with message
+   *    indicating the incoming transitions.
+   * *  If `force` is set to true, Dialogflow will remove the page, as well as
+   *    any transitions to the page.
+   * 
+ * + * bool force = 2; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteSessionEntityTypeRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteSessionEntityTypeRequest.java new file mode 100644 index 000000000..33b837da8 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteSessionEntityTypeRequest.java @@ -0,0 +1,677 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.DeleteSessionEntityType].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest} + */ +public final class DeleteSessionEntityTypeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest) + DeleteSessionEntityTypeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteSessionEntityTypeRequest.newBuilder() to construct. + private DeleteSessionEntityTypeRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteSessionEntityTypeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteSessionEntityTypeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteSessionEntityTypeRequest( + 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.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteSessionEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteSessionEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the session entity type to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the session entity type to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest) 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.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + 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.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.DeleteSessionEntityType].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest) + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteSessionEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteSessionEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest.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.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteSessionEntityTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest(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.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + .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.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the session entity type to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the session entity type to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the session entity type to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the session entity type to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the session entity type to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSessionEntityTypeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteSessionEntityTypeRequest(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.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteSessionEntityTypeRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteSessionEntityTypeRequestOrBuilder.java new file mode 100644 index 000000000..b28377c80 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteSessionEntityTypeRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface DeleteSessionEntityTypeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the session entity type to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the session entity type to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteTransitionRouteGroupRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteTransitionRouteGroupRequest.java new file mode 100644 index 000000000..1b988eff3 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteTransitionRouteGroupRequest.java @@ -0,0 +1,792 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [TransitionRouteGroups.DeleteTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.DeleteTransitionRouteGroup].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest} + */ +public final class DeleteTransitionRouteGroupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest) + DeleteTransitionRouteGroupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteTransitionRouteGroupRequest.newBuilder() to construct. + private DeleteTransitionRouteGroupRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteTransitionRouteGroupRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteTransitionRouteGroupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteTransitionRouteGroupRequest( + 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 16: + { + 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.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteTransitionRouteGroupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteTransitionRouteGroupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORCE_FIELD_NUMBER = 2; + private boolean force_; + /** + * + * + *
+   * This field has no effect for transition route group that no page is using.
+   * If the transition route group is referenced by any page:
+   * *  If `force` is set to false, an error will be returned with message
+   *    indicating pages that reference the transition route group.
+   * *  If `force` is set to true, Dialogflow will remove the transition route
+   *    group, as well as any reference to it.
+   * 
+ * + * bool force = 2; + * + * @return The force. + */ + @java.lang.Override + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (force_ != false) { + output.writeBool(2, force_); + } + 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 (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, 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.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().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.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + 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.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [TransitionRouteGroups.DeleteTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.DeleteTransitionRouteGroup].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest) + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteTransitionRouteGroupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteTransitionRouteGroupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest.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_ = ""; + + force_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteTransitionRouteGroupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest(this); + result.name_ = name_; + 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.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 boolean force_; + /** + * + * + *
+     * This field has no effect for transition route group that no page is using.
+     * If the transition route group is referenced by any page:
+     * *  If `force` is set to false, an error will be returned with message
+     *    indicating pages that reference the transition route group.
+     * *  If `force` is set to true, Dialogflow will remove the transition route
+     *    group, as well as any reference to it.
+     * 
+ * + * bool force = 2; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * This field has no effect for transition route group that no page is using.
+     * If the transition route group is referenced by any page:
+     * *  If `force` is set to false, an error will be returned with message
+     *    indicating pages that reference the transition route group.
+     * *  If `force` is set to true, Dialogflow will remove the transition route
+     *    group, as well as any reference to it.
+     * 
+ * + * bool force = 2; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This field has no effect for transition route group that no page is using.
+     * If the transition route group is referenced by any page:
+     * *  If `force` is set to false, an error will be returned with message
+     *    indicating pages that reference the transition route group.
+     * *  If `force` is set to true, Dialogflow will remove the transition route
+     *    group, as well as any reference to it.
+     * 
+ * + * bool force = 2; + * + * @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.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteTransitionRouteGroupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteTransitionRouteGroupRequest(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.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteTransitionRouteGroupRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteTransitionRouteGroupRequestOrBuilder.java new file mode 100644 index 000000000..e60524762 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteTransitionRouteGroupRequestOrBuilder.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/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface DeleteTransitionRouteGroupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * This field has no effect for transition route group that no page is using.
+   * If the transition route group is referenced by any page:
+   * *  If `force` is set to false, an error will be returned with message
+   *    indicating pages that reference the transition route group.
+   * *  If `force` is set to true, Dialogflow will remove the transition route
+   *    group, as well as any reference to it.
+   * 
+ * + * bool force = 2; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteVersionRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteVersionRequest.java new file mode 100644 index 000000000..aad9b50ff --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteVersionRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Versions.DeleteVersion][google.cloud.dialogflow.cx.v3beta1.Versions.DeleteVersion].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest} + */ +public final class DeleteVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest) + DeleteVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteVersionRequest.newBuilder() to construct. + private DeleteVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteVersionRequest( + 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.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.dialogflow.cx.v3beta1.DeleteVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest) 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.dialogflow.cx.v3beta1.DeleteVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest 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.dialogflow.cx.v3beta1.DeleteVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest 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.dialogflow.cx.v3beta1.DeleteVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest 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.dialogflow.cx.v3beta1.DeleteVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest 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.dialogflow.cx.v3beta1.DeleteVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest 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.dialogflow.cx.v3beta1.DeleteVersionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Versions.DeleteVersion][google.cloud.dialogflow.cx.v3beta1.Versions.DeleteVersion].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest) + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest.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.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest(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.dialogflow.cx.v3beta1.DeleteVersionRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest.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.dialogflow.cx.v3beta1.DeleteVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.DeleteVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteVersionRequest(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.dialogflow.cx.v3beta1.DeleteVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteVersionRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteVersionRequestOrBuilder.java new file mode 100644 index 000000000..80a21429e --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteVersionRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface DeleteVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteWebhookRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteWebhookRequest.java new file mode 100644 index 000000000..4a16f933e --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteWebhookRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Webhooks.DeleteWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.DeleteWebhook].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest} + */ +public final class DeleteWebhookRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest) + DeleteWebhookRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteWebhookRequest.newBuilder() to construct. + private DeleteWebhookRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteWebhookRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteWebhookRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteWebhookRequest( + 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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteWebhookRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteWebhookRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the webhook to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the webhook to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.dialogflow.cx.v3beta1.DeleteWebhookRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest) 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.dialogflow.cx.v3beta1.DeleteWebhookRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest 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.dialogflow.cx.v3beta1.DeleteWebhookRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest 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.dialogflow.cx.v3beta1.DeleteWebhookRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest 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.dialogflow.cx.v3beta1.DeleteWebhookRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest 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.dialogflow.cx.v3beta1.DeleteWebhookRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest 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.dialogflow.cx.v3beta1.DeleteWebhookRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Webhooks.DeleteWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.DeleteWebhook].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest) + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteWebhookRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteWebhookRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest.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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteWebhookRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest(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.dialogflow.cx.v3beta1.DeleteWebhookRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest.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.dialogflow.cx.v3beta1.DeleteWebhookRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the webhook to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the webhook to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the webhook to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the webhook to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the webhook to delete.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.DeleteWebhookRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteWebhookRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteWebhookRequest(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.dialogflow.cx.v3beta1.DeleteWebhookRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteWebhookRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteWebhookRequestOrBuilder.java new file mode 100644 index 000000000..a73a51099 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DeleteWebhookRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface DeleteWebhookRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the webhook to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the webhook to delete.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentRequest.java new file mode 100644 index 000000000..913ee2a95 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentRequest.java @@ -0,0 +1,1554 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request to detect user's intent.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest} + */ +public final class DetectIntentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest) + DetectIntentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DetectIntentRequest.newBuilder() to construct. + private DetectIntentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DetectIntentRequest() { + session_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DetectIntentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DetectIntentRequest( + 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(); + + session_ = s; + break; + } + case 18: + { + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder subBuilder = null; + if (queryParams_ != null) { + subBuilder = queryParams_.toBuilder(); + } + queryParams_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryParams_); + queryParams_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder subBuilder = null; + if (queryInput_ != null) { + subBuilder = queryInput_.toBuilder(); + } + queryInput_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryInput_); + queryInput_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder subBuilder = null; + if (outputAudioConfig_ != null) { + subBuilder = outputAudioConfig_.toBuilder(); + } + outputAudioConfig_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputAudioConfig_); + outputAudioConfig_ = 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.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.Builder.class); + } + + public static final int SESSION_FIELD_NUMBER = 1; + private volatile java.lang.Object session_; + /** + * + * + *
+   * Required. The name of the session this query is sent to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * It's up to the API caller to choose an appropriate `Session ID`. It can be
+   * a random number or some type of session identifiers (preferably hashed).
+   * The length of the `Session ID` must not exceed 36 characters.
+   * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The session. + */ + @java.lang.Override + public java.lang.String getSession() { + java.lang.Object ref = session_; + 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(); + session_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the session this query is sent to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * It's up to the API caller to choose an appropriate `Session ID`. It can be
+   * a random number or some type of session identifiers (preferably hashed).
+   * The length of the `Session ID` must not exceed 36 characters.
+   * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for session. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSessionBytes() { + java.lang.Object ref = session_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + session_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_PARAMS_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.QueryParameters queryParams_; + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return Whether the queryParams field is set. + */ + @java.lang.Override + public boolean hasQueryParams() { + return queryParams_ != null; + } + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return The queryParams. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryParameters getQueryParams() { + return queryParams_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.getDefaultInstance() + : queryParams_; + } + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder getQueryParamsOrBuilder() { + return getQueryParams(); + } + + public static final int QUERY_INPUT_FIELD_NUMBER = 3; + private com.google.cloud.dialogflow.cx.v3beta1.QueryInput queryInput_; + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the queryInput field is set. + */ + @java.lang.Override + public boolean hasQueryInput() { + return queryInput_ != null; + } + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The queryInput. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryInput getQueryInput() { + return queryInput_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryInput.getDefaultInstance() + : queryInput_; + } + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputOrBuilder() { + return getQueryInput(); + } + + public static final int OUTPUT_AUDIO_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig outputAudioConfig_; + /** + * + * + *
+   * Instructs the speech synthesizer how to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return Whether the outputAudioConfig field is set. + */ + @java.lang.Override + public boolean hasOutputAudioConfig() { + return outputAudioConfig_ != null; + } + /** + * + * + *
+   * Instructs the speech synthesizer how to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return The outputAudioConfig. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig() { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } + /** + * + * + *
+   * Instructs the speech synthesizer how to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder + getOutputAudioConfigOrBuilder() { + return getOutputAudioConfig(); + } + + 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 (!getSessionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, session_); + } + if (queryParams_ != null) { + output.writeMessage(2, getQueryParams()); + } + if (queryInput_ != null) { + output.writeMessage(3, getQueryInput()); + } + if (outputAudioConfig_ != null) { + output.writeMessage(4, getOutputAudioConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSessionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, session_); + } + if (queryParams_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQueryParams()); + } + if (queryInput_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getQueryInput()); + } + if (outputAudioConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getOutputAudioConfig()); + } + 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.dialogflow.cx.v3beta1.DetectIntentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest) obj; + + if (!getSession().equals(other.getSession())) return false; + if (hasQueryParams() != other.hasQueryParams()) return false; + if (hasQueryParams()) { + if (!getQueryParams().equals(other.getQueryParams())) return false; + } + if (hasQueryInput() != other.hasQueryInput()) return false; + if (hasQueryInput()) { + if (!getQueryInput().equals(other.getQueryInput())) return false; + } + if (hasOutputAudioConfig() != other.hasOutputAudioConfig()) return false; + if (hasOutputAudioConfig()) { + if (!getOutputAudioConfig().equals(other.getOutputAudioConfig())) 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) + SESSION_FIELD_NUMBER; + hash = (53 * hash) + getSession().hashCode(); + if (hasQueryParams()) { + hash = (37 * hash) + QUERY_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getQueryParams().hashCode(); + } + if (hasQueryInput()) { + hash = (37 * hash) + QUERY_INPUT_FIELD_NUMBER; + hash = (53 * hash) + getQueryInput().hashCode(); + } + if (hasOutputAudioConfig()) { + hash = (37 * hash) + OUTPUT_AUDIO_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputAudioConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest 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.dialogflow.cx.v3beta1.DetectIntentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest 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.dialogflow.cx.v3beta1.DetectIntentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest 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.dialogflow.cx.v3beta1.DetectIntentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest 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.dialogflow.cx.v3beta1.DetectIntentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest 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.dialogflow.cx.v3beta1.DetectIntentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request to detect user's intent.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest) + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.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(); + session_ = ""; + + if (queryParamsBuilder_ == null) { + queryParams_ = null; + } else { + queryParams_ = null; + queryParamsBuilder_ = null; + } + if (queryInputBuilder_ == null) { + queryInput_ = null; + } else { + queryInput_ = null; + queryInputBuilder_ = null; + } + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = null; + } else { + outputAudioConfig_ = null; + outputAudioConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest(this); + result.session_ = session_; + if (queryParamsBuilder_ == null) { + result.queryParams_ = queryParams_; + } else { + result.queryParams_ = queryParamsBuilder_.build(); + } + if (queryInputBuilder_ == null) { + result.queryInput_ = queryInput_; + } else { + result.queryInput_ = queryInputBuilder_.build(); + } + if (outputAudioConfigBuilder_ == null) { + result.outputAudioConfig_ = outputAudioConfig_; + } else { + result.outputAudioConfig_ = outputAudioConfigBuilder_.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.dialogflow.cx.v3beta1.DetectIntentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.getDefaultInstance()) + return this; + if (!other.getSession().isEmpty()) { + session_ = other.session_; + onChanged(); + } + if (other.hasQueryParams()) { + mergeQueryParams(other.getQueryParams()); + } + if (other.hasQueryInput()) { + mergeQueryInput(other.getQueryInput()); + } + if (other.hasOutputAudioConfig()) { + mergeOutputAudioConfig(other.getOutputAudioConfig()); + } + 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.dialogflow.cx.v3beta1.DetectIntentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object session_ = ""; + /** + * + * + *
+     * Required. The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The session. + */ + public java.lang.String getSession() { + java.lang.Object ref = session_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + session_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for session. + */ + public com.google.protobuf.ByteString getSessionBytes() { + java.lang.Object ref = session_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + session_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The session to set. + * @return This builder for chaining. + */ + public Builder setSession(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + session_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSession() { + + session_ = getDefaultInstance().getSession(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for session to set. + * @return This builder for chaining. + */ + public Builder setSessionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + session_ = value; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.QueryParameters queryParams_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters, + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder> + queryParamsBuilder_; + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return Whether the queryParams field is set. + */ + public boolean hasQueryParams() { + return queryParamsBuilder_ != null || queryParams_ != null; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return The queryParams. + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryParameters getQueryParams() { + if (queryParamsBuilder_ == null) { + return queryParams_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.getDefaultInstance() + : queryParams_; + } else { + return queryParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public Builder setQueryParams(com.google.cloud.dialogflow.cx.v3beta1.QueryParameters value) { + if (queryParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryParams_ = value; + onChanged(); + } else { + queryParamsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public Builder setQueryParams( + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder builderForValue) { + if (queryParamsBuilder_ == null) { + queryParams_ = builderForValue.build(); + onChanged(); + } else { + queryParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public Builder mergeQueryParams(com.google.cloud.dialogflow.cx.v3beta1.QueryParameters value) { + if (queryParamsBuilder_ == null) { + if (queryParams_ != null) { + queryParams_ = + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.newBuilder(queryParams_) + .mergeFrom(value) + .buildPartial(); + } else { + queryParams_ = value; + } + onChanged(); + } else { + queryParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public Builder clearQueryParams() { + if (queryParamsBuilder_ == null) { + queryParams_ = null; + onChanged(); + } else { + queryParams_ = null; + queryParamsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder getQueryParamsBuilder() { + + onChanged(); + return getQueryParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder + getQueryParamsOrBuilder() { + if (queryParamsBuilder_ != null) { + return queryParamsBuilder_.getMessageOrBuilder(); + } else { + return queryParams_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.getDefaultInstance() + : queryParams_; + } + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters, + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder> + getQueryParamsFieldBuilder() { + if (queryParamsBuilder_ == null) { + queryParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters, + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder>( + getQueryParams(), getParentForChildren(), isClean()); + queryParams_ = null; + } + return queryParamsBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.QueryInput queryInput_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryInput, + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder> + queryInputBuilder_; + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the queryInput field is set. + */ + public boolean hasQueryInput() { + return queryInputBuilder_ != null || queryInput_ != null; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The queryInput. + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryInput getQueryInput() { + if (queryInputBuilder_ == null) { + return queryInput_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryInput.getDefaultInstance() + : queryInput_; + } else { + return queryInputBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQueryInput(com.google.cloud.dialogflow.cx.v3beta1.QueryInput value) { + if (queryInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryInput_ = value; + onChanged(); + } else { + queryInputBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQueryInput( + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder builderForValue) { + if (queryInputBuilder_ == null) { + queryInput_ = builderForValue.build(); + onChanged(); + } else { + queryInputBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeQueryInput(com.google.cloud.dialogflow.cx.v3beta1.QueryInput value) { + if (queryInputBuilder_ == null) { + if (queryInput_ != null) { + queryInput_ = + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.newBuilder(queryInput_) + .mergeFrom(value) + .buildPartial(); + } else { + queryInput_ = value; + } + onChanged(); + } else { + queryInputBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearQueryInput() { + if (queryInputBuilder_ == null) { + queryInput_ = null; + onChanged(); + } else { + queryInput_ = null; + queryInputBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder getQueryInputBuilder() { + + onChanged(); + return getQueryInputFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputOrBuilder() { + if (queryInputBuilder_ != null) { + return queryInputBuilder_.getMessageOrBuilder(); + } else { + return queryInput_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryInput.getDefaultInstance() + : queryInput_; + } + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryInput, + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder> + getQueryInputFieldBuilder() { + if (queryInputBuilder_ == null) { + queryInputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryInput, + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder>( + getQueryInput(), getParentForChildren(), isClean()); + queryInput_ = null; + } + return queryInputBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig outputAudioConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder> + outputAudioConfigBuilder_; + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return Whether the outputAudioConfig field is set. + */ + public boolean hasOutputAudioConfig() { + return outputAudioConfigBuilder_ != null || outputAudioConfig_ != null; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return The outputAudioConfig. + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig() { + if (outputAudioConfigBuilder_ == null) { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } else { + return outputAudioConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public Builder setOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig value) { + if (outputAudioConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputAudioConfig_ = value; + onChanged(); + } else { + outputAudioConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public Builder setOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder builderForValue) { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = builderForValue.build(); + onChanged(); + } else { + outputAudioConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public Builder mergeOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig value) { + if (outputAudioConfigBuilder_ == null) { + if (outputAudioConfig_ != null) { + outputAudioConfig_ = + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.newBuilder( + outputAudioConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + outputAudioConfig_ = value; + } + onChanged(); + } else { + outputAudioConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public Builder clearOutputAudioConfig() { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = null; + onChanged(); + } else { + outputAudioConfig_ = null; + outputAudioConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder + getOutputAudioConfigBuilder() { + + onChanged(); + return getOutputAudioConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder + getOutputAudioConfigOrBuilder() { + if (outputAudioConfigBuilder_ != null) { + return outputAudioConfigBuilder_.getMessageOrBuilder(); + } else { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder> + getOutputAudioConfigFieldBuilder() { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder>( + getOutputAudioConfig(), getParentForChildren(), isClean()); + outputAudioConfig_ = null; + } + return outputAudioConfigBuilder_; + } + + @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.dialogflow.cx.v3beta1.DetectIntentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DetectIntentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DetectIntentRequest(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.dialogflow.cx.v3beta1.DetectIntentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentRequestOrBuilder.java new file mode 100644 index 000000000..cb909fcf6 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentRequestOrBuilder.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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface DetectIntentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the session this query is sent to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * It's up to the API caller to choose an appropriate `Session ID`. It can be
+   * a random number or some type of session identifiers (preferably hashed).
+   * The length of the `Session ID` must not exceed 36 characters.
+   * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The session. + */ + java.lang.String getSession(); + /** + * + * + *
+   * Required. The name of the session this query is sent to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * It's up to the API caller to choose an appropriate `Session ID`. It can be
+   * a random number or some type of session identifiers (preferably hashed).
+   * The length of the `Session ID` must not exceed 36 characters.
+   * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for session. + */ + com.google.protobuf.ByteString getSessionBytes(); + + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return Whether the queryParams field is set. + */ + boolean hasQueryParams(); + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return The queryParams. + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters getQueryParams(); + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder getQueryParamsOrBuilder(); + + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the queryInput field is set. + */ + boolean hasQueryInput(); + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The queryInput. + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryInput getQueryInput(); + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputOrBuilder(); + + /** + * + * + *
+   * Instructs the speech synthesizer how to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return Whether the outputAudioConfig field is set. + */ + boolean hasOutputAudioConfig(); + /** + * + * + *
+   * Instructs the speech synthesizer how to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return The outputAudioConfig. + */ + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig(); + /** + * + * + *
+   * Instructs the speech synthesizer how to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder getOutputAudioConfigOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentResponse.java new file mode 100644 index 000000000..c144fbed4 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentResponse.java @@ -0,0 +1,1338 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The message returned from the DetectIntent method.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse} + */ +public final class DetectIntentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) + DetectIntentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use DetectIntentResponse.newBuilder() to construct. + private DetectIntentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DetectIntentResponse() { + responseId_ = ""; + outputAudio_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DetectIntentResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DetectIntentResponse( + 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(); + + responseId_ = s; + break; + } + case 18: + { + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.Builder subBuilder = null; + if (queryResult_ != null) { + subBuilder = queryResult_.toBuilder(); + } + queryResult_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryResult_); + queryResult_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + outputAudio_ = input.readBytes(); + break; + } + case 42: + { + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder subBuilder = null; + if (outputAudioConfig_ != null) { + subBuilder = outputAudioConfig_.toBuilder(); + } + outputAudioConfig_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputAudioConfig_); + outputAudioConfig_ = 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.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.Builder.class); + } + + public static final int RESPONSE_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object responseId_; + /** + * + * + *
+   * Output only. The unique identifier of the response. It can be used to
+   * locate a response in the training example set or for reporting issues.
+   * 
+ * + * string response_id = 1; + * + * @return The responseId. + */ + @java.lang.Override + public java.lang.String getResponseId() { + java.lang.Object ref = responseId_; + 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(); + responseId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The unique identifier of the response. It can be used to
+   * locate a response in the training example set or for reporting issues.
+   * 
+ * + * string response_id = 1; + * + * @return The bytes for responseId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResponseIdBytes() { + java.lang.Object ref = responseId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + responseId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_RESULT_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.QueryResult queryResult_; + /** + * + * + *
+   * The result of the conversational query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + * + * @return Whether the queryResult field is set. + */ + @java.lang.Override + public boolean hasQueryResult() { + return queryResult_ != null; + } + /** + * + * + *
+   * The result of the conversational query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + * + * @return The queryResult. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryResult getQueryResult() { + return queryResult_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryResult.getDefaultInstance() + : queryResult_; + } + /** + * + * + *
+   * The result of the conversational query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryResultOrBuilder getQueryResultOrBuilder() { + return getQueryResult(); + } + + public static final int OUTPUT_AUDIO_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString outputAudio_; + /** + * + * + *
+   * The audio data bytes encoded as specified in the request.
+   * Note: The output audio is generated based on the values of default platform
+   * text responses found in the
+   * [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] field. If
+   * multiple default text responses exist, they will be concatenated when
+   * generating audio. If no default platform text responses exist, the
+   * generated audio content will be empty.
+   * In some scenarios, multiple output audio fields may be present in the
+   * response structure. In these cases, only the top-most-level audio output
+   * has content.
+   * 
+ * + * bytes output_audio = 4; + * + * @return The outputAudio. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputAudio() { + return outputAudio_; + } + + public static final int OUTPUT_AUDIO_CONFIG_FIELD_NUMBER = 5; + private com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig outputAudioConfig_; + /** + * + * + *
+   * The config used by the speech synthesizer to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + * + * @return Whether the outputAudioConfig field is set. + */ + @java.lang.Override + public boolean hasOutputAudioConfig() { + return outputAudioConfig_ != null; + } + /** + * + * + *
+   * The config used by the speech synthesizer to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + * + * @return The outputAudioConfig. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig() { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } + /** + * + * + *
+   * The config used by the speech synthesizer to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder + getOutputAudioConfigOrBuilder() { + return getOutputAudioConfig(); + } + + 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 (!getResponseIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, responseId_); + } + if (queryResult_ != null) { + output.writeMessage(2, getQueryResult()); + } + if (!outputAudio_.isEmpty()) { + output.writeBytes(4, outputAudio_); + } + if (outputAudioConfig_ != null) { + output.writeMessage(5, getOutputAudioConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getResponseIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, responseId_); + } + if (queryResult_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQueryResult()); + } + if (!outputAudio_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, outputAudio_); + } + if (outputAudioConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getOutputAudioConfig()); + } + 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.dialogflow.cx.v3beta1.DetectIntentResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) obj; + + if (!getResponseId().equals(other.getResponseId())) return false; + if (hasQueryResult() != other.hasQueryResult()) return false; + if (hasQueryResult()) { + if (!getQueryResult().equals(other.getQueryResult())) return false; + } + if (!getOutputAudio().equals(other.getOutputAudio())) return false; + if (hasOutputAudioConfig() != other.hasOutputAudioConfig()) return false; + if (hasOutputAudioConfig()) { + if (!getOutputAudioConfig().equals(other.getOutputAudioConfig())) 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) + RESPONSE_ID_FIELD_NUMBER; + hash = (53 * hash) + getResponseId().hashCode(); + if (hasQueryResult()) { + hash = (37 * hash) + QUERY_RESULT_FIELD_NUMBER; + hash = (53 * hash) + getQueryResult().hashCode(); + } + hash = (37 * hash) + OUTPUT_AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getOutputAudio().hashCode(); + if (hasOutputAudioConfig()) { + hash = (37 * hash) + OUTPUT_AUDIO_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputAudioConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse 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.dialogflow.cx.v3beta1.DetectIntentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse 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.dialogflow.cx.v3beta1.DetectIntentResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse 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.dialogflow.cx.v3beta1.DetectIntentResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse 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.dialogflow.cx.v3beta1.DetectIntentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse 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.dialogflow.cx.v3beta1.DetectIntentResponse 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 message returned from the DetectIntent method.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.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(); + responseId_ = ""; + + if (queryResultBuilder_ == null) { + queryResult_ = null; + } else { + queryResult_ = null; + queryResultBuilder_ = null; + } + outputAudio_ = com.google.protobuf.ByteString.EMPTY; + + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = null; + } else { + outputAudioConfig_ = null; + outputAudioConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse(this); + result.responseId_ = responseId_; + if (queryResultBuilder_ == null) { + result.queryResult_ = queryResult_; + } else { + result.queryResult_ = queryResultBuilder_.build(); + } + result.outputAudio_ = outputAudio_; + if (outputAudioConfigBuilder_ == null) { + result.outputAudioConfig_ = outputAudioConfig_; + } else { + result.outputAudioConfig_ = outputAudioConfigBuilder_.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.dialogflow.cx.v3beta1.DetectIntentResponse) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.getDefaultInstance()) + return this; + if (!other.getResponseId().isEmpty()) { + responseId_ = other.responseId_; + onChanged(); + } + if (other.hasQueryResult()) { + mergeQueryResult(other.getQueryResult()); + } + if (other.getOutputAudio() != com.google.protobuf.ByteString.EMPTY) { + setOutputAudio(other.getOutputAudio()); + } + if (other.hasOutputAudioConfig()) { + mergeOutputAudioConfig(other.getOutputAudioConfig()); + } + 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.dialogflow.cx.v3beta1.DetectIntentResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object responseId_ = ""; + /** + * + * + *
+     * Output only. The unique identifier of the response. It can be used to
+     * locate a response in the training example set or for reporting issues.
+     * 
+ * + * string response_id = 1; + * + * @return The responseId. + */ + public java.lang.String getResponseId() { + java.lang.Object ref = responseId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + responseId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The unique identifier of the response. It can be used to
+     * locate a response in the training example set or for reporting issues.
+     * 
+ * + * string response_id = 1; + * + * @return The bytes for responseId. + */ + public com.google.protobuf.ByteString getResponseIdBytes() { + java.lang.Object ref = responseId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + responseId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The unique identifier of the response. It can be used to
+     * locate a response in the training example set or for reporting issues.
+     * 
+ * + * string response_id = 1; + * + * @param value The responseId to set. + * @return This builder for chaining. + */ + public Builder setResponseId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + responseId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique identifier of the response. It can be used to
+     * locate a response in the training example set or for reporting issues.
+     * 
+ * + * string response_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearResponseId() { + + responseId_ = getDefaultInstance().getResponseId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique identifier of the response. It can be used to
+     * locate a response in the training example set or for reporting issues.
+     * 
+ * + * string response_id = 1; + * + * @param value The bytes for responseId to set. + * @return This builder for chaining. + */ + public Builder setResponseIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + responseId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.QueryResult queryResult_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryResult, + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryResultOrBuilder> + queryResultBuilder_; + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + * + * @return Whether the queryResult field is set. + */ + public boolean hasQueryResult() { + return queryResultBuilder_ != null || queryResult_ != null; + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + * + * @return The queryResult. + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryResult getQueryResult() { + if (queryResultBuilder_ == null) { + return queryResult_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryResult.getDefaultInstance() + : queryResult_; + } else { + return queryResultBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + public Builder setQueryResult(com.google.cloud.dialogflow.cx.v3beta1.QueryResult value) { + if (queryResultBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryResult_ = value; + onChanged(); + } else { + queryResultBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + public Builder setQueryResult( + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.Builder builderForValue) { + if (queryResultBuilder_ == null) { + queryResult_ = builderForValue.build(); + onChanged(); + } else { + queryResultBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + public Builder mergeQueryResult(com.google.cloud.dialogflow.cx.v3beta1.QueryResult value) { + if (queryResultBuilder_ == null) { + if (queryResult_ != null) { + queryResult_ = + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.newBuilder(queryResult_) + .mergeFrom(value) + .buildPartial(); + } else { + queryResult_ = value; + } + onChanged(); + } else { + queryResultBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + public Builder clearQueryResult() { + if (queryResultBuilder_ == null) { + queryResult_ = null; + onChanged(); + } else { + queryResult_ = null; + queryResultBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryResult.Builder getQueryResultBuilder() { + + onChanged(); + return getQueryResultFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryResultOrBuilder getQueryResultOrBuilder() { + if (queryResultBuilder_ != null) { + return queryResultBuilder_.getMessageOrBuilder(); + } else { + return queryResult_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryResult.getDefaultInstance() + : queryResult_; + } + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryResult, + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryResultOrBuilder> + getQueryResultFieldBuilder() { + if (queryResultBuilder_ == null) { + queryResultBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryResult, + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryResultOrBuilder>( + getQueryResult(), getParentForChildren(), isClean()); + queryResult_ = null; + } + return queryResultBuilder_; + } + + private com.google.protobuf.ByteString outputAudio_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * Note: The output audio is generated based on the values of default platform
+     * text responses found in the
+     * [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] field. If
+     * multiple default text responses exist, they will be concatenated when
+     * generating audio. If no default platform text responses exist, the
+     * generated audio content will be empty.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * bytes output_audio = 4; + * + * @return The outputAudio. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputAudio() { + return outputAudio_; + } + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * Note: The output audio is generated based on the values of default platform
+     * text responses found in the
+     * [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] field. If
+     * multiple default text responses exist, they will be concatenated when
+     * generating audio. If no default platform text responses exist, the
+     * generated audio content will be empty.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * bytes output_audio = 4; + * + * @param value The outputAudio to set. + * @return This builder for chaining. + */ + public Builder setOutputAudio(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + outputAudio_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * Note: The output audio is generated based on the values of default platform
+     * text responses found in the
+     * [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] field. If
+     * multiple default text responses exist, they will be concatenated when
+     * generating audio. If no default platform text responses exist, the
+     * generated audio content will be empty.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * bytes output_audio = 4; + * + * @return This builder for chaining. + */ + public Builder clearOutputAudio() { + + outputAudio_ = getDefaultInstance().getOutputAudio(); + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig outputAudioConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder> + outputAudioConfigBuilder_; + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + * + * @return Whether the outputAudioConfig field is set. + */ + public boolean hasOutputAudioConfig() { + return outputAudioConfigBuilder_ != null || outputAudioConfig_ != null; + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + * + * @return The outputAudioConfig. + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig() { + if (outputAudioConfigBuilder_ == null) { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } else { + return outputAudioConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + */ + public Builder setOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig value) { + if (outputAudioConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputAudioConfig_ = value; + onChanged(); + } else { + outputAudioConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + */ + public Builder setOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder builderForValue) { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = builderForValue.build(); + onChanged(); + } else { + outputAudioConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + */ + public Builder mergeOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig value) { + if (outputAudioConfigBuilder_ == null) { + if (outputAudioConfig_ != null) { + outputAudioConfig_ = + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.newBuilder( + outputAudioConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + outputAudioConfig_ = value; + } + onChanged(); + } else { + outputAudioConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + */ + public Builder clearOutputAudioConfig() { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = null; + onChanged(); + } else { + outputAudioConfig_ = null; + outputAudioConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder + getOutputAudioConfigBuilder() { + + onChanged(); + return getOutputAudioConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder + getOutputAudioConfigOrBuilder() { + if (outputAudioConfigBuilder_ != null) { + return outputAudioConfigBuilder_.getMessageOrBuilder(); + } else { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder> + getOutputAudioConfigFieldBuilder() { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder>( + getOutputAudioConfig(), getParentForChildren(), isClean()); + outputAudioConfig_ = null; + } + return outputAudioConfigBuilder_; + } + + @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.dialogflow.cx.v3beta1.DetectIntentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DetectIntentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DetectIntentResponse(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.dialogflow.cx.v3beta1.DetectIntentResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentResponseOrBuilder.java new file mode 100644 index 000000000..0acc80768 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentResponseOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface DetectIntentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The unique identifier of the response. It can be used to
+   * locate a response in the training example set or for reporting issues.
+   * 
+ * + * string response_id = 1; + * + * @return The responseId. + */ + java.lang.String getResponseId(); + /** + * + * + *
+   * Output only. The unique identifier of the response. It can be used to
+   * locate a response in the training example set or for reporting issues.
+   * 
+ * + * string response_id = 1; + * + * @return The bytes for responseId. + */ + com.google.protobuf.ByteString getResponseIdBytes(); + + /** + * + * + *
+   * The result of the conversational query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + * + * @return Whether the queryResult field is set. + */ + boolean hasQueryResult(); + /** + * + * + *
+   * The result of the conversational query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + * + * @return The queryResult. + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryResult getQueryResult(); + /** + * + * + *
+   * The result of the conversational query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryResultOrBuilder getQueryResultOrBuilder(); + + /** + * + * + *
+   * The audio data bytes encoded as specified in the request.
+   * Note: The output audio is generated based on the values of default platform
+   * text responses found in the
+   * [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] field. If
+   * multiple default text responses exist, they will be concatenated when
+   * generating audio. If no default platform text responses exist, the
+   * generated audio content will be empty.
+   * In some scenarios, multiple output audio fields may be present in the
+   * response structure. In these cases, only the top-most-level audio output
+   * has content.
+   * 
+ * + * bytes output_audio = 4; + * + * @return The outputAudio. + */ + com.google.protobuf.ByteString getOutputAudio(); + + /** + * + * + *
+   * The config used by the speech synthesizer to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + * + * @return Whether the outputAudioConfig field is set. + */ + boolean hasOutputAudioConfig(); + /** + * + * + *
+   * The config used by the speech synthesizer to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + * + * @return The outputAudioConfig. + */ + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig(); + /** + * + * + *
+   * The config used by the speech synthesizer to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 5; + */ + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder getOutputAudioConfigOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityType.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityType.java new file mode 100644 index 000000000..029a4e3ca --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityType.java @@ -0,0 +1,4597 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Entities are extracted from user input and represent parameters that are
+ * meaningful to your application. For example, a date range, a proper name
+ * such as a geographic location or landmark, and so on. Entities represent
+ * actionable data for your application.
+ * When you define an entity, you can also include synonyms that all map to
+ * that entity. For example, "soft drink", "soda", "pop", and so on.
+ * There are three types of entities:
+ * *   **System** - entities that are defined by the Dialogflow API for common
+ *     data types such as date, time, currency, and so on. A system entity is
+ *     represented by the `EntityType` type.
+ * *   **Custom** - entities that are defined by you that represent
+ *     actionable data that is meaningful to your application. For example,
+ *     you could define a `pizza.sauce` entity for red or white pizza sauce,
+ *     a `pizza.cheese` entity for the different types of cheese on a pizza,
+ *     a `pizza.topping` entity for different toppings, and so on. A custom
+ *     entity is represented by the `EntityType` type.
+ * *   **User** - entities that are built for an individual user such as
+ *     favorites, preferences, playlists, and so on. A user entity is
+ *     represented by the [SessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityType] type.
+ * For more information about entity types, see the [Dialogflow
+ * documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.EntityType} + */ +public final class EntityType extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.EntityType) + EntityTypeOrBuilder { + private static final long serialVersionUID = 0L; + // Use EntityType.newBuilder() to construct. + private EntityType(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EntityType() { + name_ = ""; + displayName_ = ""; + kind_ = 0; + autoExpansionMode_ = 0; + entities_ = java.util.Collections.emptyList(); + excludedPhrases_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EntityType(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EntityType( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + kind_ = rawValue; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + autoExpansionMode_ = rawValue; + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + entities_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity>(); + mutable_bitField0_ |= 0x00000001; + } + entities_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.parser(), + extensionRegistry)); + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + excludedPhrases_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase>(); + mutable_bitField0_ |= 0x00000002; + } + excludedPhrases_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.parser(), + extensionRegistry)); + break; + } + case 56: + { + enableFuzzyExtraction_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + entities_ = java.util.Collections.unmodifiableList(entities_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + excludedPhrases_ = java.util.Collections.unmodifiableList(excludedPhrases_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.class, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder.class); + } + + /** + * + * + *
+   * Represents kinds of entities.
+   * 
+ * + * Protobuf enum {@code google.cloud.dialogflow.cx.v3beta1.EntityType.Kind} + */ + public enum Kind implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. This value should be never used.
+     * 
+ * + * KIND_UNSPECIFIED = 0; + */ + KIND_UNSPECIFIED(0), + /** + * + * + *
+     * Map entity types allow mapping of a group of synonyms to a canonical
+     * value.
+     * 
+ * + * KIND_MAP = 1; + */ + KIND_MAP(1), + /** + * + * + *
+     * List entity types contain a set of entries that do not map to canonical
+     * values. However, list entity types can contain references to other entity
+     * types (with or without aliases).
+     * 
+ * + * KIND_LIST = 2; + */ + KIND_LIST(2), + /** + * + * + *
+     * Regexp entity types allow to specify regular expressions in entries
+     * values.
+     * 
+ * + * KIND_REGEXP = 3; + */ + KIND_REGEXP(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. This value should be never used.
+     * 
+ * + * KIND_UNSPECIFIED = 0; + */ + public static final int KIND_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Map entity types allow mapping of a group of synonyms to a canonical
+     * value.
+     * 
+ * + * KIND_MAP = 1; + */ + public static final int KIND_MAP_VALUE = 1; + /** + * + * + *
+     * List entity types contain a set of entries that do not map to canonical
+     * values. However, list entity types can contain references to other entity
+     * types (with or without aliases).
+     * 
+ * + * KIND_LIST = 2; + */ + public static final int KIND_LIST_VALUE = 2; + /** + * + * + *
+     * Regexp entity types allow to specify regular expressions in entries
+     * values.
+     * 
+ * + * KIND_REGEXP = 3; + */ + public static final int KIND_REGEXP_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 Kind 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 Kind forNumber(int value) { + switch (value) { + case 0: + return KIND_UNSPECIFIED; + case 1: + return KIND_MAP; + case 2: + return KIND_LIST; + case 3: + return KIND_REGEXP; + 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 Kind findValueByNumber(int number) { + return Kind.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityType.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Kind[] VALUES = values(); + + public static Kind 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 Kind(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.EntityType.Kind) + } + + /** + * + * + *
+   * Represents different entity type expansion modes. Automated expansion
+   * allows an agent to recognize values that have not been explicitly listed in
+   * the entity (for example, new kinds of shopping list items).
+   * 
+ * + * Protobuf enum {@code google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode} + */ + public enum AutoExpansionMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Auto expansion disabled for the entity.
+     * 
+ * + * AUTO_EXPANSION_MODE_UNSPECIFIED = 0; + */ + AUTO_EXPANSION_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Allows an agent to recognize values that have not been explicitly
+     * listed in the entity.
+     * 
+ * + * AUTO_EXPANSION_MODE_DEFAULT = 1; + */ + AUTO_EXPANSION_MODE_DEFAULT(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Auto expansion disabled for the entity.
+     * 
+ * + * AUTO_EXPANSION_MODE_UNSPECIFIED = 0; + */ + public static final int AUTO_EXPANSION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Allows an agent to recognize values that have not been explicitly
+     * listed in the entity.
+     * 
+ * + * AUTO_EXPANSION_MODE_DEFAULT = 1; + */ + public static final int AUTO_EXPANSION_MODE_DEFAULT_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AutoExpansionMode 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 AutoExpansionMode forNumber(int value) { + switch (value) { + case 0: + return AUTO_EXPANSION_MODE_UNSPECIFIED; + case 1: + return AUTO_EXPANSION_MODE_DEFAULT; + 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 AutoExpansionMode findValueByNumber(int number) { + return AutoExpansionMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityType.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final AutoExpansionMode[] VALUES = values(); + + public static AutoExpansionMode 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 AutoExpansionMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode) + } + + public interface EntityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.EntityType.Entity) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The primary value associated with this entity entry.
+     * For example, if the entity type is *vegetable*, the value could be
+     * *scallions*.
+     * For `KIND_MAP` entity types:
+     * *   A canonical value to be used in place of synonyms.
+     * For `KIND_LIST` entity types:
+     * *   A string that can contain references to other entity types (with or
+     *     without aliases).
+     * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+     * Required. The primary value associated with this entity entry.
+     * For example, if the entity type is *vegetable*, the value could be
+     * *scallions*.
+     * For `KIND_MAP` entity types:
+     * *   A canonical value to be used in place of synonyms.
+     * For `KIND_LIST` entity types:
+     * *   A string that can contain references to other entity types (with or
+     *     without aliases).
+     * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+     * Required. A collection of value synonyms. For example, if the entity type
+     * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+     * onions*.
+     * For `KIND_LIST` entity types:
+     * *   This collection must contain exactly one synonym equal to `value`.
+     * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the synonyms. + */ + java.util.List getSynonymsList(); + /** + * + * + *
+     * Required. A collection of value synonyms. For example, if the entity type
+     * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+     * onions*.
+     * For `KIND_LIST` entity types:
+     * *   This collection must contain exactly one synonym equal to `value`.
+     * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of synonyms. + */ + int getSynonymsCount(); + /** + * + * + *
+     * Required. A collection of value synonyms. For example, if the entity type
+     * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+     * onions*.
+     * For `KIND_LIST` entity types:
+     * *   This collection must contain exactly one synonym equal to `value`.
+     * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + java.lang.String getSynonyms(int index); + /** + * + * + *
+     * Required. A collection of value synonyms. For example, if the entity type
+     * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+     * onions*.
+     * For `KIND_LIST` entity types:
+     * *   This collection must contain exactly one synonym equal to `value`.
+     * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + com.google.protobuf.ByteString getSynonymsBytes(int index); + } + /** + * + * + *
+   * An **entity entry** for an associated entity type.
+   * Next Id = 8
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.EntityType.Entity} + */ + public static final class Entity extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.EntityType.Entity) + EntityOrBuilder { + private static final long serialVersionUID = 0L; + // Use Entity.newBuilder() to construct. + private Entity(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Entity() { + value_ = ""; + synonyms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Entity(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Entity( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + synonyms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + synonyms_.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)) { + synonyms_ = synonyms_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_Entity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_Entity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.class, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private volatile java.lang.Object value_; + /** + * + * + *
+     * Required. The primary value associated with this entity entry.
+     * For example, if the entity type is *vegetable*, the value could be
+     * *scallions*.
+     * For `KIND_MAP` entity types:
+     * *   A canonical value to be used in place of synonyms.
+     * For `KIND_LIST` entity types:
+     * *   A string that can contain references to other entity types (with or
+     *     without aliases).
+     * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The primary value associated with this entity entry.
+     * For example, if the entity type is *vegetable*, the value could be
+     * *scallions*.
+     * For `KIND_MAP` entity types:
+     * *   A canonical value to be used in place of synonyms.
+     * For `KIND_LIST` entity types:
+     * *   A string that can contain references to other entity types (with or
+     *     without aliases).
+     * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SYNONYMS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList synonyms_; + /** + * + * + *
+     * Required. A collection of value synonyms. For example, if the entity type
+     * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+     * onions*.
+     * For `KIND_LIST` entity types:
+     * *   This collection must contain exactly one synonym equal to `value`.
+     * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the synonyms. + */ + public com.google.protobuf.ProtocolStringList getSynonymsList() { + return synonyms_; + } + /** + * + * + *
+     * Required. A collection of value synonyms. For example, if the entity type
+     * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+     * onions*.
+     * For `KIND_LIST` entity types:
+     * *   This collection must contain exactly one synonym equal to `value`.
+     * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of synonyms. + */ + public int getSynonymsCount() { + return synonyms_.size(); + } + /** + * + * + *
+     * Required. A collection of value synonyms. For example, if the entity type
+     * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+     * onions*.
+     * For `KIND_LIST` entity types:
+     * *   This collection must contain exactly one synonym equal to `value`.
+     * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + public java.lang.String getSynonyms(int index) { + return synonyms_.get(index); + } + /** + * + * + *
+     * Required. A collection of value synonyms. For example, if the entity type
+     * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+     * onions*.
+     * For `KIND_LIST` entity types:
+     * *   This collection must contain exactly one synonym equal to `value`.
+     * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + public com.google.protobuf.ByteString getSynonymsBytes(int index) { + return synonyms_.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 { + if (!getValueBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); + } + for (int i = 0; i < synonyms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, synonyms_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getValueBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); + } + { + int dataSize = 0; + for (int i = 0; i < synonyms_.size(); i++) { + dataSize += computeStringSizeNoTag(synonyms_.getRaw(i)); + } + size += dataSize; + size += 1 * getSynonymsList().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.dialogflow.cx.v3beta1.EntityType.Entity)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity other = + (com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity) obj; + + if (!getValue().equals(other.getValue())) return false; + if (!getSynonymsList().equals(other.getSynonymsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + if (getSynonymsCount() > 0) { + hash = (37 * hash) + SYNONYMS_FIELD_NUMBER; + hash = (53 * hash) + getSynonymsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity 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.dialogflow.cx.v3beta1.EntityType.Entity parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity 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.dialogflow.cx.v3beta1.EntityType.Entity parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity 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.dialogflow.cx.v3beta1.EntityType.Entity parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity 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.dialogflow.cx.v3beta1.EntityType.Entity parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity 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.dialogflow.cx.v3beta1.EntityType.Entity prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * An **entity entry** for an associated entity type.
+     * Next Id = 8
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.EntityType.Entity} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.EntityType.Entity) + com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_Entity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_Entity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.class, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.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_ = ""; + + synonyms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_Entity_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity build() { + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity result = + new com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity(this); + int from_bitField0_ = bitField0_; + result.value_ = value_; + if (((bitField0_ & 0x00000001) != 0)) { + synonyms_ = synonyms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.synonyms_ = synonyms_; + 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.dialogflow.cx.v3beta1.EntityType.Entity) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.getDefaultInstance()) + return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + if (!other.synonyms_.isEmpty()) { + if (synonyms_.isEmpty()) { + synonyms_ = other.synonyms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSynonymsIsMutable(); + synonyms_.addAll(other.synonyms_); + } + 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.dialogflow.cx.v3beta1.EntityType.Entity parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object value_ = ""; + /** + * + * + *
+       * Required. The primary value associated with this entity entry.
+       * For example, if the entity type is *vegetable*, the value could be
+       * *scallions*.
+       * For `KIND_MAP` entity types:
+       * *   A canonical value to be used in place of synonyms.
+       * For `KIND_LIST` entity types:
+       * *   A string that can contain references to other entity types (with or
+       *     without aliases).
+       * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The primary value associated with this entity entry.
+       * For example, if the entity type is *vegetable*, the value could be
+       * *scallions*.
+       * For `KIND_MAP` entity types:
+       * *   A canonical value to be used in place of synonyms.
+       * For `KIND_LIST` entity types:
+       * *   A string that can contain references to other entity types (with or
+       *     without aliases).
+       * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The primary value associated with this entity entry.
+       * For example, if the entity type is *vegetable*, the value could be
+       * *scallions*.
+       * For `KIND_MAP` entity types:
+       * *   A canonical value to be used in place of synonyms.
+       * For `KIND_LIST` entity types:
+       * *   A string that can contain references to other entity types (with or
+       *     without aliases).
+       * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The primary value associated with this entity entry.
+       * For example, if the entity type is *vegetable*, the value could be
+       * *scallions*.
+       * For `KIND_MAP` entity types:
+       * *   A canonical value to be used in place of synonyms.
+       * For `KIND_LIST` entity types:
+       * *   A string that can contain references to other entity types (with or
+       *     without aliases).
+       * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The primary value associated with this entity entry.
+       * For example, if the entity type is *vegetable*, the value could be
+       * *scallions*.
+       * For `KIND_MAP` entity types:
+       * *   A canonical value to be used in place of synonyms.
+       * For `KIND_LIST` entity types:
+       * *   A string that can contain references to other entity types (with or
+       *     without aliases).
+       * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList synonyms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureSynonymsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + synonyms_ = new com.google.protobuf.LazyStringArrayList(synonyms_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Required. A collection of value synonyms. For example, if the entity type
+       * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+       * onions*.
+       * For `KIND_LIST` entity types:
+       * *   This collection must contain exactly one synonym equal to `value`.
+       * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the synonyms. + */ + public com.google.protobuf.ProtocolStringList getSynonymsList() { + return synonyms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Required. A collection of value synonyms. For example, if the entity type
+       * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+       * onions*.
+       * For `KIND_LIST` entity types:
+       * *   This collection must contain exactly one synonym equal to `value`.
+       * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of synonyms. + */ + public int getSynonymsCount() { + return synonyms_.size(); + } + /** + * + * + *
+       * Required. A collection of value synonyms. For example, if the entity type
+       * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+       * onions*.
+       * For `KIND_LIST` entity types:
+       * *   This collection must contain exactly one synonym equal to `value`.
+       * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + public java.lang.String getSynonyms(int index) { + return synonyms_.get(index); + } + /** + * + * + *
+       * Required. A collection of value synonyms. For example, if the entity type
+       * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+       * onions*.
+       * For `KIND_LIST` entity types:
+       * *   This collection must contain exactly one synonym equal to `value`.
+       * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + public com.google.protobuf.ByteString getSynonymsBytes(int index) { + return synonyms_.getByteString(index); + } + /** + * + * + *
+       * Required. A collection of value synonyms. For example, if the entity type
+       * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+       * onions*.
+       * For `KIND_LIST` entity types:
+       * *   This collection must contain exactly one synonym equal to `value`.
+       * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The synonyms to set. + * @return This builder for chaining. + */ + public Builder setSynonyms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymsIsMutable(); + synonyms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. A collection of value synonyms. For example, if the entity type
+       * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+       * onions*.
+       * For `KIND_LIST` entity types:
+       * *   This collection must contain exactly one synonym equal to `value`.
+       * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The synonyms to add. + * @return This builder for chaining. + */ + public Builder addSynonyms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymsIsMutable(); + synonyms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. A collection of value synonyms. For example, if the entity type
+       * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+       * onions*.
+       * For `KIND_LIST` entity types:
+       * *   This collection must contain exactly one synonym equal to `value`.
+       * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The synonyms to add. + * @return This builder for chaining. + */ + public Builder addAllSynonyms(java.lang.Iterable values) { + ensureSynonymsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, synonyms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. A collection of value synonyms. For example, if the entity type
+       * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+       * onions*.
+       * For `KIND_LIST` entity types:
+       * *   This collection must contain exactly one synonym equal to `value`.
+       * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearSynonyms() { + synonyms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. A collection of value synonyms. For example, if the entity type
+       * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+       * onions*.
+       * For `KIND_LIST` entity types:
+       * *   This collection must contain exactly one synonym equal to `value`.
+       * 
+ * + * repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the synonyms to add. + * @return This builder for chaining. + */ + public Builder addSynonymsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSynonymsIsMutable(); + synonyms_.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.dialogflow.cx.v3beta1.EntityType.Entity) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.EntityType.Entity) + private static final com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Entity parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Entity(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.dialogflow.cx.v3beta1.EntityType.Entity getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ExcludedPhraseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The word or phrase to be excluded.
+     * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+     * Required. The word or phrase to be excluded.
+     * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + } + /** + * + * + *
+   * An excluded entity phrase that should not be matched.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase} + */ + public static final class ExcludedPhrase extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase) + ExcludedPhraseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExcludedPhrase.newBuilder() to construct. + private ExcludedPhrase(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExcludedPhrase() { + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExcludedPhrase(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExcludedPhrase( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_ExcludedPhrase_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_ExcludedPhrase_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.class, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private volatile java.lang.Object value_; + /** + * + * + *
+     * Required. The word or phrase to be excluded.
+     * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The word or phrase to be excluded.
+     * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getValueBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getValueBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase other = + (com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase) obj; + + if (!getValue().equals(other.getValue())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase 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.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase 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.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase 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.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + 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.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase 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.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * An excluded entity phrase that should not be matched.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase) + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhraseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_ExcludedPhrase_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_ExcludedPhrase_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.class, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + value_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_ExcludedPhrase_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase build() { + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase result = + new com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase(this); + result.value_ = value_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + .getDefaultInstance()) return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object value_ = ""; + /** + * + * + *
+       * Required. The word or phrase to be excluded.
+       * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The word or phrase to be excluded.
+       * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The word or phrase to be excluded.
+       * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The word or phrase to be excluded.
+       * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The word or phrase to be excluded.
+       * 
+ * + * string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase) + private static final com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExcludedPhrase parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExcludedPhrase(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.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The unique identifier of the entity type.
+   * Required for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The unique identifier of the entity type.
+   * Required for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required. The human-readable name of the entity type, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The human-readable name of the entity type, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 3; + private int kind_; + /** + * + * + *
+   * Required. Indicates the kind of entity type.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for kind. + */ + @java.lang.Override + public int getKindValue() { + return kind_; + } + /** + * + * + *
+   * Required. Indicates the kind of entity type.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The kind. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Kind getKind() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Kind result = + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Kind.valueOf(kind_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.EntityType.Kind.UNRECOGNIZED + : result; + } + + public static final int AUTO_EXPANSION_MODE_FIELD_NUMBER = 4; + private int autoExpansionMode_; + /** + * + * + *
+   * Indicates whether the entity type can be automatically expanded.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode auto_expansion_mode = 4; + * + * + * @return The enum numeric value on the wire for autoExpansionMode. + */ + @java.lang.Override + public int getAutoExpansionModeValue() { + return autoExpansionMode_; + } + /** + * + * + *
+   * Indicates whether the entity type can be automatically expanded.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode auto_expansion_mode = 4; + * + * + * @return The autoExpansionMode. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode + getAutoExpansionMode() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode result = + com.google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode.valueOf( + autoExpansionMode_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode.UNRECOGNIZED + : result; + } + + public static final int ENTITIES_FIELD_NUMBER = 5; + private java.util.List entities_; + /** + * + * + *
+   * The collection of entity entries associated with the entity type.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + @java.lang.Override + public java.util.List + getEntitiesList() { + return entities_; + } + /** + * + * + *
+   * The collection of entity entries associated with the entity type.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + @java.lang.Override + public java.util.List + getEntitiesOrBuilderList() { + return entities_; + } + /** + * + * + *
+   * The collection of entity entries associated with the entity type.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + @java.lang.Override + public int getEntitiesCount() { + return entities_.size(); + } + /** + * + * + *
+   * The collection of entity entries associated with the entity type.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity getEntities(int index) { + return entities_.get(index); + } + /** + * + * + *
+   * The collection of entity entries associated with the entity type.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder getEntitiesOrBuilder( + int index) { + return entities_.get(index); + } + + public static final int EXCLUDED_PHRASES_FIELD_NUMBER = 6; + private java.util.List + excludedPhrases_; + /** + * + * + *
+   * Collection of exceptional words and phrases that shouldn't be matched.
+   * For example, if you have a size entity type with entry `giant`(an
+   * adjective), you might consider adding `giants`(a noun) as an exclusion.
+   * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+   * entities and excluded phrases should be mutually exclusive.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + @java.lang.Override + public java.util.List + getExcludedPhrasesList() { + return excludedPhrases_; + } + /** + * + * + *
+   * Collection of exceptional words and phrases that shouldn't be matched.
+   * For example, if you have a size entity type with entry `giant`(an
+   * adjective), you might consider adding `giants`(a noun) as an exclusion.
+   * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+   * entities and excluded phrases should be mutually exclusive.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhraseOrBuilder> + getExcludedPhrasesOrBuilderList() { + return excludedPhrases_; + } + /** + * + * + *
+   * Collection of exceptional words and phrases that shouldn't be matched.
+   * For example, if you have a size entity type with entry `giant`(an
+   * adjective), you might consider adding `giants`(a noun) as an exclusion.
+   * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+   * entities and excluded phrases should be mutually exclusive.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + @java.lang.Override + public int getExcludedPhrasesCount() { + return excludedPhrases_.size(); + } + /** + * + * + *
+   * Collection of exceptional words and phrases that shouldn't be matched.
+   * For example, if you have a size entity type with entry `giant`(an
+   * adjective), you might consider adding `giants`(a noun) as an exclusion.
+   * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+   * entities and excluded phrases should be mutually exclusive.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase getExcludedPhrases( + int index) { + return excludedPhrases_.get(index); + } + /** + * + * + *
+   * Collection of exceptional words and phrases that shouldn't be matched.
+   * For example, if you have a size entity type with entry `giant`(an
+   * adjective), you might consider adding `giants`(a noun) as an exclusion.
+   * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+   * entities and excluded phrases should be mutually exclusive.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhraseOrBuilder + getExcludedPhrasesOrBuilder(int index) { + return excludedPhrases_.get(index); + } + + public static final int ENABLE_FUZZY_EXTRACTION_FIELD_NUMBER = 7; + private boolean enableFuzzyExtraction_; + /** + * + * + *
+   * Enables fuzzy entity extraction during classification.
+   * 
+ * + * bool enable_fuzzy_extraction = 7; + * + * @return The enableFuzzyExtraction. + */ + @java.lang.Override + public boolean getEnableFuzzyExtraction() { + return enableFuzzyExtraction_; + } + + 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 (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (kind_ + != com.google.cloud.dialogflow.cx.v3beta1.EntityType.Kind.KIND_UNSPECIFIED.getNumber()) { + output.writeEnum(3, kind_); + } + if (autoExpansionMode_ + != com.google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode + .AUTO_EXPANSION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, autoExpansionMode_); + } + for (int i = 0; i < entities_.size(); i++) { + output.writeMessage(5, entities_.get(i)); + } + for (int i = 0; i < excludedPhrases_.size(); i++) { + output.writeMessage(6, excludedPhrases_.get(i)); + } + if (enableFuzzyExtraction_ != false) { + output.writeBool(7, enableFuzzyExtraction_); + } + 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 (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (kind_ + != com.google.cloud.dialogflow.cx.v3beta1.EntityType.Kind.KIND_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, kind_); + } + if (autoExpansionMode_ + != com.google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode + .AUTO_EXPANSION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, autoExpansionMode_); + } + for (int i = 0; i < entities_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, entities_.get(i)); + } + for (int i = 0; i < excludedPhrases_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, excludedPhrases_.get(i)); + } + if (enableFuzzyExtraction_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, enableFuzzyExtraction_); + } + 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.dialogflow.cx.v3beta1.EntityType)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.EntityType other = + (com.google.cloud.dialogflow.cx.v3beta1.EntityType) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (kind_ != other.kind_) return false; + if (autoExpansionMode_ != other.autoExpansionMode_) return false; + if (!getEntitiesList().equals(other.getEntitiesList())) return false; + if (!getExcludedPhrasesList().equals(other.getExcludedPhrasesList())) return false; + if (getEnableFuzzyExtraction() != other.getEnableFuzzyExtraction()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + kind_; + hash = (37 * hash) + AUTO_EXPANSION_MODE_FIELD_NUMBER; + hash = (53 * hash) + autoExpansionMode_; + if (getEntitiesCount() > 0) { + hash = (37 * hash) + ENTITIES_FIELD_NUMBER; + hash = (53 * hash) + getEntitiesList().hashCode(); + } + if (getExcludedPhrasesCount() > 0) { + hash = (37 * hash) + EXCLUDED_PHRASES_FIELD_NUMBER; + hash = (53 * hash) + getExcludedPhrasesList().hashCode(); + } + hash = (37 * hash) + ENABLE_FUZZY_EXTRACTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableFuzzyExtraction()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType 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.dialogflow.cx.v3beta1.EntityType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType 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.dialogflow.cx.v3beta1.EntityType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType 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.dialogflow.cx.v3beta1.EntityType parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType 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.dialogflow.cx.v3beta1.EntityType parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType 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.dialogflow.cx.v3beta1.EntityType 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; + } + /** + * + * + *
+   * Entities are extracted from user input and represent parameters that are
+   * meaningful to your application. For example, a date range, a proper name
+   * such as a geographic location or landmark, and so on. Entities represent
+   * actionable data for your application.
+   * When you define an entity, you can also include synonyms that all map to
+   * that entity. For example, "soft drink", "soda", "pop", and so on.
+   * There are three types of entities:
+   * *   **System** - entities that are defined by the Dialogflow API for common
+   *     data types such as date, time, currency, and so on. A system entity is
+   *     represented by the `EntityType` type.
+   * *   **Custom** - entities that are defined by you that represent
+   *     actionable data that is meaningful to your application. For example,
+   *     you could define a `pizza.sauce` entity for red or white pizza sauce,
+   *     a `pizza.cheese` entity for the different types of cheese on a pizza,
+   *     a `pizza.topping` entity for different toppings, and so on. A custom
+   *     entity is represented by the `EntityType` type.
+   * *   **User** - entities that are built for an individual user such as
+   *     favorites, preferences, playlists, and so on. A user entity is
+   *     represented by the [SessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityType] type.
+   * For more information about entity types, see the [Dialogflow
+   * documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.EntityType} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.EntityType) + com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.class, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.EntityType.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEntitiesFieldBuilder(); + getExcludedPhrasesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + kind_ = 0; + + autoExpansionMode_ = 0; + + if (entitiesBuilder_ == null) { + entities_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + entitiesBuilder_.clear(); + } + if (excludedPhrasesBuilder_ == null) { + excludedPhrases_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + excludedPhrasesBuilder_.clear(); + } + enableFuzzyExtraction_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType build() { + com.google.cloud.dialogflow.cx.v3beta1.EntityType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.EntityType result = + new com.google.cloud.dialogflow.cx.v3beta1.EntityType(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + result.kind_ = kind_; + result.autoExpansionMode_ = autoExpansionMode_; + if (entitiesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + entities_ = java.util.Collections.unmodifiableList(entities_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.entities_ = entities_; + } else { + result.entities_ = entitiesBuilder_.build(); + } + if (excludedPhrasesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + excludedPhrases_ = java.util.Collections.unmodifiableList(excludedPhrases_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.excludedPhrases_ = excludedPhrases_; + } else { + result.excludedPhrases_ = excludedPhrasesBuilder_.build(); + } + result.enableFuzzyExtraction_ = enableFuzzyExtraction_; + 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.dialogflow.cx.v3beta1.EntityType) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.EntityType) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.EntityType other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.EntityType.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.kind_ != 0) { + setKindValue(other.getKindValue()); + } + if (other.autoExpansionMode_ != 0) { + setAutoExpansionModeValue(other.getAutoExpansionModeValue()); + } + if (entitiesBuilder_ == null) { + if (!other.entities_.isEmpty()) { + if (entities_.isEmpty()) { + entities_ = other.entities_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEntitiesIsMutable(); + entities_.addAll(other.entities_); + } + onChanged(); + } + } else { + if (!other.entities_.isEmpty()) { + if (entitiesBuilder_.isEmpty()) { + entitiesBuilder_.dispose(); + entitiesBuilder_ = null; + entities_ = other.entities_; + bitField0_ = (bitField0_ & ~0x00000001); + entitiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEntitiesFieldBuilder() + : null; + } else { + entitiesBuilder_.addAllMessages(other.entities_); + } + } + } + if (excludedPhrasesBuilder_ == null) { + if (!other.excludedPhrases_.isEmpty()) { + if (excludedPhrases_.isEmpty()) { + excludedPhrases_ = other.excludedPhrases_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureExcludedPhrasesIsMutable(); + excludedPhrases_.addAll(other.excludedPhrases_); + } + onChanged(); + } + } else { + if (!other.excludedPhrases_.isEmpty()) { + if (excludedPhrasesBuilder_.isEmpty()) { + excludedPhrasesBuilder_.dispose(); + excludedPhrasesBuilder_ = null; + excludedPhrases_ = other.excludedPhrases_; + bitField0_ = (bitField0_ & ~0x00000002); + excludedPhrasesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getExcludedPhrasesFieldBuilder() + : null; + } else { + excludedPhrasesBuilder_.addAllMessages(other.excludedPhrases_); + } + } + } + if (other.getEnableFuzzyExtraction() != false) { + setEnableFuzzyExtraction(other.getEnableFuzzyExtraction()); + } + 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.dialogflow.cx.v3beta1.EntityType parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.EntityType) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The unique identifier of the entity type.
+     * Required for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unique identifier of the entity type.
+     * Required for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unique identifier of the entity type.
+     * Required for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the entity type.
+     * Required for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the entity type.
+     * Required for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The human-readable name of the entity type, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the entity type, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the entity type, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the entity type, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the entity type, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private int kind_ = 0; + /** + * + * + *
+     * Required. Indicates the kind of entity type.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for kind. + */ + @java.lang.Override + public int getKindValue() { + return kind_; + } + /** + * + * + *
+     * Required. Indicates the kind of entity type.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for kind to set. + * @return This builder for chaining. + */ + public Builder setKindValue(int value) { + + kind_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Indicates the kind of entity type.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The kind. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Kind getKind() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Kind result = + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Kind.valueOf(kind_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.EntityType.Kind.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. Indicates the kind of entity type.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(com.google.cloud.dialogflow.cx.v3beta1.EntityType.Kind value) { + if (value == null) { + throw new NullPointerException(); + } + + kind_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Indicates the kind of entity type.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearKind() { + + kind_ = 0; + onChanged(); + return this; + } + + private int autoExpansionMode_ = 0; + /** + * + * + *
+     * Indicates whether the entity type can be automatically expanded.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode auto_expansion_mode = 4; + * + * + * @return The enum numeric value on the wire for autoExpansionMode. + */ + @java.lang.Override + public int getAutoExpansionModeValue() { + return autoExpansionMode_; + } + /** + * + * + *
+     * Indicates whether the entity type can be automatically expanded.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode auto_expansion_mode = 4; + * + * + * @param value The enum numeric value on the wire for autoExpansionMode to set. + * @return This builder for chaining. + */ + public Builder setAutoExpansionModeValue(int value) { + + autoExpansionMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates whether the entity type can be automatically expanded.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode auto_expansion_mode = 4; + * + * + * @return The autoExpansionMode. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode + getAutoExpansionMode() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode result = + com.google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode.valueOf( + autoExpansionMode_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Indicates whether the entity type can be automatically expanded.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode auto_expansion_mode = 4; + * + * + * @param value The autoExpansionMode to set. + * @return This builder for chaining. + */ + public Builder setAutoExpansionMode( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode value) { + if (value == null) { + throw new NullPointerException(); + } + + autoExpansionMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates whether the entity type can be automatically expanded.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode auto_expansion_mode = 4; + * + * + * @return This builder for chaining. + */ + public Builder clearAutoExpansionMode() { + + autoExpansionMode_ = 0; + onChanged(); + return this; + } + + private java.util.List entities_ = + java.util.Collections.emptyList(); + + private void ensureEntitiesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + entities_ = + new java.util.ArrayList( + entities_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder> + entitiesBuilder_; + + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public java.util.List + getEntitiesList() { + if (entitiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entities_); + } else { + return entitiesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public int getEntitiesCount() { + if (entitiesBuilder_ == null) { + return entities_.size(); + } else { + return entitiesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity getEntities(int index) { + if (entitiesBuilder_ == null) { + return entities_.get(index); + } else { + return entitiesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public Builder setEntities( + int index, com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity value) { + if (entitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntitiesIsMutable(); + entities_.set(index, value); + onChanged(); + } else { + entitiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public Builder setEntities( + int index, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder builderForValue) { + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + entities_.set(index, builderForValue.build()); + onChanged(); + } else { + entitiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public Builder addEntities(com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity value) { + if (entitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntitiesIsMutable(); + entities_.add(value); + onChanged(); + } else { + entitiesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public Builder addEntities( + int index, com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity value) { + if (entitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntitiesIsMutable(); + entities_.add(index, value); + onChanged(); + } else { + entitiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public Builder addEntities( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder builderForValue) { + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + entities_.add(builderForValue.build()); + onChanged(); + } else { + entitiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public Builder addEntities( + int index, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder builderForValue) { + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + entities_.add(index, builderForValue.build()); + onChanged(); + } else { + entitiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public Builder addAllEntities( + java.lang.Iterable + values) { + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entities_); + onChanged(); + } else { + entitiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public Builder clearEntities() { + if (entitiesBuilder_ == null) { + entities_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + entitiesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public Builder removeEntities(int index) { + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + entities_.remove(index); + onChanged(); + } else { + entitiesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder getEntitiesBuilder( + int index) { + return getEntitiesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder getEntitiesOrBuilder( + int index) { + if (entitiesBuilder_ == null) { + return entities_.get(index); + } else { + return entitiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder> + getEntitiesOrBuilderList() { + if (entitiesBuilder_ != null) { + return entitiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entities_); + } + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder addEntitiesBuilder() { + return getEntitiesFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.getDefaultInstance()); + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder addEntitiesBuilder( + int index) { + return getEntitiesFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.getDefaultInstance()); + } + /** + * + * + *
+     * The collection of entity entries associated with the entity type.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + public java.util.List + getEntitiesBuilderList() { + return getEntitiesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder> + getEntitiesFieldBuilder() { + if (entitiesBuilder_ == null) { + entitiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder>( + entities_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + entities_ = null; + } + return entitiesBuilder_; + } + + private java.util.List + excludedPhrases_ = java.util.Collections.emptyList(); + + private void ensureExcludedPhrasesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + excludedPhrases_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase>(excludedPhrases_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhraseOrBuilder> + excludedPhrasesBuilder_; + + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public java.util.List + getExcludedPhrasesList() { + if (excludedPhrasesBuilder_ == null) { + return java.util.Collections.unmodifiableList(excludedPhrases_); + } else { + return excludedPhrasesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public int getExcludedPhrasesCount() { + if (excludedPhrasesBuilder_ == null) { + return excludedPhrases_.size(); + } else { + return excludedPhrasesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase getExcludedPhrases( + int index) { + if (excludedPhrasesBuilder_ == null) { + return excludedPhrases_.get(index); + } else { + return excludedPhrasesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public Builder setExcludedPhrases( + int index, com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase value) { + if (excludedPhrasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedPhrasesIsMutable(); + excludedPhrases_.set(index, value); + onChanged(); + } else { + excludedPhrasesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public Builder setExcludedPhrases( + int index, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.Builder builderForValue) { + if (excludedPhrasesBuilder_ == null) { + ensureExcludedPhrasesIsMutable(); + excludedPhrases_.set(index, builderForValue.build()); + onChanged(); + } else { + excludedPhrasesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public Builder addExcludedPhrases( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase value) { + if (excludedPhrasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedPhrasesIsMutable(); + excludedPhrases_.add(value); + onChanged(); + } else { + excludedPhrasesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public Builder addExcludedPhrases( + int index, com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase value) { + if (excludedPhrasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedPhrasesIsMutable(); + excludedPhrases_.add(index, value); + onChanged(); + } else { + excludedPhrasesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public Builder addExcludedPhrases( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.Builder builderForValue) { + if (excludedPhrasesBuilder_ == null) { + ensureExcludedPhrasesIsMutable(); + excludedPhrases_.add(builderForValue.build()); + onChanged(); + } else { + excludedPhrasesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public Builder addExcludedPhrases( + int index, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.Builder builderForValue) { + if (excludedPhrasesBuilder_ == null) { + ensureExcludedPhrasesIsMutable(); + excludedPhrases_.add(index, builderForValue.build()); + onChanged(); + } else { + excludedPhrasesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public Builder addAllExcludedPhrases( + java.lang.Iterable< + ? extends com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase> + values) { + if (excludedPhrasesBuilder_ == null) { + ensureExcludedPhrasesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, excludedPhrases_); + onChanged(); + } else { + excludedPhrasesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public Builder clearExcludedPhrases() { + if (excludedPhrasesBuilder_ == null) { + excludedPhrases_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + excludedPhrasesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public Builder removeExcludedPhrases(int index) { + if (excludedPhrasesBuilder_ == null) { + ensureExcludedPhrasesIsMutable(); + excludedPhrases_.remove(index); + onChanged(); + } else { + excludedPhrasesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.Builder + getExcludedPhrasesBuilder(int index) { + return getExcludedPhrasesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhraseOrBuilder + getExcludedPhrasesOrBuilder(int index) { + if (excludedPhrasesBuilder_ == null) { + return excludedPhrases_.get(index); + } else { + return excludedPhrasesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhraseOrBuilder> + getExcludedPhrasesOrBuilderList() { + if (excludedPhrasesBuilder_ != null) { + return excludedPhrasesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(excludedPhrases_); + } + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.Builder + addExcludedPhrasesBuilder() { + return getExcludedPhrasesFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + .getDefaultInstance()); + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.Builder + addExcludedPhrasesBuilder(int index) { + return getExcludedPhrasesFieldBuilder() + .addBuilder( + index, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase + .getDefaultInstance()); + } + /** + * + * + *
+     * Collection of exceptional words and phrases that shouldn't be matched.
+     * For example, if you have a size entity type with entry `giant`(an
+     * adjective), you might consider adding `giants`(a noun) as an exclusion.
+     * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+     * entities and excluded phrases should be mutually exclusive.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + public java.util.List + getExcludedPhrasesBuilderList() { + return getExcludedPhrasesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhraseOrBuilder> + getExcludedPhrasesFieldBuilder() { + if (excludedPhrasesBuilder_ == null) { + excludedPhrasesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhraseOrBuilder>( + excludedPhrases_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + excludedPhrases_ = null; + } + return excludedPhrasesBuilder_; + } + + private boolean enableFuzzyExtraction_; + /** + * + * + *
+     * Enables fuzzy entity extraction during classification.
+     * 
+ * + * bool enable_fuzzy_extraction = 7; + * + * @return The enableFuzzyExtraction. + */ + @java.lang.Override + public boolean getEnableFuzzyExtraction() { + return enableFuzzyExtraction_; + } + /** + * + * + *
+     * Enables fuzzy entity extraction during classification.
+     * 
+ * + * bool enable_fuzzy_extraction = 7; + * + * @param value The enableFuzzyExtraction to set. + * @return This builder for chaining. + */ + public Builder setEnableFuzzyExtraction(boolean value) { + + enableFuzzyExtraction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Enables fuzzy entity extraction during classification.
+     * 
+ * + * bool enable_fuzzy_extraction = 7; + * + * @return This builder for chaining. + */ + public Builder clearEnableFuzzyExtraction() { + + enableFuzzyExtraction_ = 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.dialogflow.cx.v3beta1.EntityType) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.EntityType) + private static final com.google.cloud.dialogflow.cx.v3beta1.EntityType DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.EntityType(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EntityType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EntityType parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EntityType(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.dialogflow.cx.v3beta1.EntityType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeName.java new file mode 100644 index 000000000..22cc944ab --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeName.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.dialogflow.cx.v3beta1; + +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 EntityTypeName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String agent; + private final String entityType; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getEntityType() { + return entityType; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private EntityTypeName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + entityType = Preconditions.checkNotNull(builder.getEntityType()); + } + + public static EntityTypeName of( + String project, String location, String agent, String entityType) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setEntityType(entityType) + .build(); + } + + public static String format(String project, String location, String agent, String entityType) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setEntityType(entityType) + .build() + .toString(); + } + + public static EntityTypeName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "EntityTypeName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("agent"), + matchMap.get("entity_type")); + } + + 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 (EntityTypeName 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("agent", agent); + fieldMapBuilder.put("entityType", entityType); + 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, "agent", agent, "entity_type", entityType); + } + + /** Builder for EntityTypeName. */ + public static class Builder { + + private String project; + private String location; + private String agent; + private String entityType; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getEntityType() { + return entityType; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAgent(String agent) { + this.agent = agent; + return this; + } + + public Builder setEntityType(String entityType) { + this.entityType = entityType; + return this; + } + + private Builder() {} + + private Builder(EntityTypeName entityTypeName) { + project = entityTypeName.project; + location = entityTypeName.location; + agent = entityTypeName.agent; + entityType = entityTypeName.entityType; + } + + public EntityTypeName build() { + return new EntityTypeName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof EntityTypeName) { + EntityTypeName that = (EntityTypeName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.agent.equals(that.agent)) + && (this.entityType.equals(that.entityType)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= agent.hashCode(); + h *= 1000003; + h ^= entityType.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeOrBuilder.java new file mode 100644 index 000000000..6c2cdc66c --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface EntityTypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.EntityType) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique identifier of the entity type.
+   * Required for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The unique identifier of the entity type.
+   * Required for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The human-readable name of the entity type, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The human-readable name of the entity type, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Required. Indicates the kind of entity type.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for kind. + */ + int getKindValue(); + /** + * + * + *
+   * Required. Indicates the kind of entity type.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The kind. + */ + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Kind getKind(); + + /** + * + * + *
+   * Indicates whether the entity type can be automatically expanded.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode auto_expansion_mode = 4; + * + * + * @return The enum numeric value on the wire for autoExpansionMode. + */ + int getAutoExpansionModeValue(); + /** + * + * + *
+   * Indicates whether the entity type can be automatically expanded.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode auto_expansion_mode = 4; + * + * + * @return The autoExpansionMode. + */ + com.google.cloud.dialogflow.cx.v3beta1.EntityType.AutoExpansionMode getAutoExpansionMode(); + + /** + * + * + *
+   * The collection of entity entries associated with the entity type.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + java.util.List getEntitiesList(); + /** + * + * + *
+   * The collection of entity entries associated with the entity type.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity getEntities(int index); + /** + * + * + *
+   * The collection of entity entries associated with the entity type.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + int getEntitiesCount(); + /** + * + * + *
+   * The collection of entity entries associated with the entity type.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + java.util.List + getEntitiesOrBuilderList(); + /** + * + * + *
+   * The collection of entity entries associated with the entity type.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 5; + */ + com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder getEntitiesOrBuilder(int index); + + /** + * + * + *
+   * Collection of exceptional words and phrases that shouldn't be matched.
+   * For example, if you have a size entity type with entry `giant`(an
+   * adjective), you might consider adding `giants`(a noun) as an exclusion.
+   * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+   * entities and excluded phrases should be mutually exclusive.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + java.util.List + getExcludedPhrasesList(); + /** + * + * + *
+   * Collection of exceptional words and phrases that shouldn't be matched.
+   * For example, if you have a size entity type with entry `giant`(an
+   * adjective), you might consider adding `giants`(a noun) as an exclusion.
+   * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+   * entities and excluded phrases should be mutually exclusive.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase getExcludedPhrases(int index); + /** + * + * + *
+   * Collection of exceptional words and phrases that shouldn't be matched.
+   * For example, if you have a size entity type with entry `giant`(an
+   * adjective), you might consider adding `giants`(a noun) as an exclusion.
+   * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+   * entities and excluded phrases should be mutually exclusive.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + int getExcludedPhrasesCount(); + /** + * + * + *
+   * Collection of exceptional words and phrases that shouldn't be matched.
+   * For example, if you have a size entity type with entry `giant`(an
+   * adjective), you might consider adding `giants`(a noun) as an exclusion.
+   * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+   * entities and excluded phrases should be mutually exclusive.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhraseOrBuilder> + getExcludedPhrasesOrBuilderList(); + /** + * + * + *
+   * Collection of exceptional words and phrases that shouldn't be matched.
+   * For example, if you have a size entity type with entry `giant`(an
+   * adjective), you might consider adding `giants`(a noun) as an exclusion.
+   * If the kind of entity type is `KIND_MAP`, then the phrases specified by
+   * entities and excluded phrases should be mutually exclusive.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhrase excluded_phrases = 6; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.EntityType.ExcludedPhraseOrBuilder + getExcludedPhrasesOrBuilder(int index); + + /** + * + * + *
+   * Enables fuzzy entity extraction during classification.
+   * 
+ * + * bool enable_fuzzy_extraction = 7; + * + * @return The enableFuzzyExtraction. + */ + boolean getEnableFuzzyExtraction(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeProto.java new file mode 100644 index 000000000..2aa97ffe8 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeProto.java @@ -0,0 +1,272 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class EntityTypeProto { + private EntityTypeProto() {} + + 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_dialogflow_cx_v3beta1_EntityType_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_Entity_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_Entity_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_ExcludedPhrase_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_ExcludedPhrase_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_GetEntityTypeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_GetEntityTypeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEntityTypeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEntityTypeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEntityTypeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEntityTypeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEntityTypeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEntityTypeRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n4google/cloud/dialogflow/cx/v3beta1/ent" + + "ity_type.proto\022\"google.cloud.dialogflow." + + "cx.v3beta1\032\034google/api/annotations.proto" + + "\032\027google/api/client.proto\032\037google/api/fi" + + "eld_behavior.proto\032\031google/api/resource." + + "proto\032\033google/protobuf/empty.proto\032 goog" + + "le/protobuf/field_mask.proto\"\236\006\n\nEntityT" + + "ype\022\014\n\004name\030\001 \001(\t\022\031\n\014display_name\030\002 \001(\tB" + + "\003\340A\002\022F\n\004kind\030\003 \001(\01623.google.cloud.dialog" + + "flow.cx.v3beta1.EntityType.KindB\003\340A\002\022]\n\023" + + "auto_expansion_mode\030\004 \001(\0162@.google.cloud" + + ".dialogflow.cx.v3beta1.EntityType.AutoEx" + + "pansionMode\022G\n\010entities\030\005 \003(\01325.google.c" + + "loud.dialogflow.cx.v3beta1.EntityType.En" + + "tity\022W\n\020excluded_phrases\030\006 \003(\0132=.google." + + "cloud.dialogflow.cx.v3beta1.EntityType.E" + + "xcludedPhrase\022\037\n\027enable_fuzzy_extraction" + + "\030\007 \001(\010\0323\n\006Entity\022\022\n\005value\030\001 \001(\tB\003\340A\002\022\025\n\010" + + "synonyms\030\002 \003(\tB\003\340A\002\032$\n\016ExcludedPhrase\022\022\n" + + "\005value\030\001 \001(\tB\003\340A\002\"J\n\004Kind\022\024\n\020KIND_UNSPEC" + + "IFIED\020\000\022\014\n\010KIND_MAP\020\001\022\r\n\tKIND_LIST\020\002\022\017\n\013" + + "KIND_REGEXP\020\003\"Y\n\021AutoExpansionMode\022#\n\037AU" + + "TO_EXPANSION_MODE_UNSPECIFIED\020\000\022\037\n\033AUTO_" + + "EXPANSION_MODE_DEFAULT\020\001:{\352Ax\n$dialogflo" + + "w.googleapis.com/EntityType\022Pprojects/{p" + + "roject}/locations/{location}/agents/{age" + + "nt}/entityTypes/{entity_type}\"\224\001\n\026ListEn" + + "tityTypesRequest\022<\n\006parent\030\001 \001(\tB,\340A\002\372A&" + + "\022$dialogflow.googleapis.com/EntityType\022\025" + + "\n\rlanguage_code\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005" + + "\022\022\n\npage_token\030\004 \001(\t\"x\n\027ListEntityTypesR" + + "esponse\022D\n\014entity_types\030\001 \003(\0132..google.c" + + "loud.dialogflow.cx.v3beta1.EntityType\022\027\n" + + "\017next_page_token\030\002 \001(\t\"i\n\024GetEntityTypeR" + + "equest\022:\n\004name\030\001 \001(\tB,\340A\002\372A&\n$dialogflow" + + ".googleapis.com/EntityType\022\025\n\rlanguage_c" + + "ode\030\002 \001(\t\"\270\001\n\027CreateEntityTypeRequest\022<\n" + + "\006parent\030\001 \001(\tB,\340A\002\372A&\022$dialogflow.google" + + "apis.com/EntityType\022H\n\013entity_type\030\002 \001(\013" + + "2..google.cloud.dialogflow.cx.v3beta1.En" + + "tityTypeB\003\340A\002\022\025\n\rlanguage_code\030\003 \001(\t\"\253\001\n" + + "\027UpdateEntityTypeRequest\022H\n\013entity_type\030" + + "\001 \001(\0132..google.cloud.dialogflow.cx.v3bet" + + "a1.EntityTypeB\003\340A\002\022\025\n\rlanguage_code\030\002 \001(" + + "\t\022/\n\013update_mask\030\003 \001(\0132\032.google.protobuf" + + ".FieldMask\"U\n\027DeleteEntityTypeRequest\022:\n" + + "\004name\030\001 \001(\tB,\340A\002\372A&\n$dialogflow.googleap" + + "is.com/EntityType2\315\t\n\013EntityTypes\022\332\001\n\017Li" + + "stEntityTypes\022:.google.cloud.dialogflow." + + "cx.v3beta1.ListEntityTypesRequest\032;.goog" + + "le.cloud.dialogflow.cx.v3beta1.ListEntit" + + "yTypesResponse\"N\202\323\344\223\002?\022=/v3beta1/{parent" + + "=projects/*/locations/*/agents/*}/entity" + + "Types\332A\006parent\022\307\001\n\rGetEntityType\0228.googl" + + "e.cloud.dialogflow.cx.v3beta1.GetEntityT" + + "ypeRequest\032..google.cloud.dialogflow.cx." + + "v3beta1.EntityType\"L\202\323\344\223\002?\022=/v3beta1/{na" + + "me=projects/*/locations/*/agents/*/entit" + + "yTypes/*}\332A\004name\022\350\001\n\020CreateEntityType\022;." + + "google.cloud.dialogflow.cx.v3beta1.Creat" + + "eEntityTypeRequest\032..google.cloud.dialog" + + "flow.cx.v3beta1.EntityType\"g\202\323\344\223\002L\"=/v3b" + + "eta1/{parent=projects/*/locations/*/agen" + + "ts/*}/entityTypes:\013entity_type\332A\022parent," + + "entity_type\022\371\001\n\020UpdateEntityType\022;.googl" + + "e.cloud.dialogflow.cx.v3beta1.UpdateEnti" + + "tyTypeRequest\032..google.cloud.dialogflow." + + "cx.v3beta1.EntityType\"x\202\323\344\223\002X2I/v3beta1/" + + "{entity_type.name=projects/*/locations/*" + + "/agents/*/entityTypes/*}:\013entity_type\332A\027" + + "entity_type,update_mask\022\265\001\n\020DeleteEntity" + + "Type\022;.google.cloud.dialogflow.cx.v3beta" + + "1.DeleteEntityTypeRequest\032\026.google.proto" + + "buf.Empty\"L\202\323\344\223\002?*=/v3beta1/{name=projec" + + "ts/*/locations/*/agents/*/entityTypes/*}" + + "\332A\004name\032x\312A\031dialogflow.googleapis.com\322AY" + + "https://www.googleapis.com/auth/cloud-pl" + + "atform,https://www.googleapis.com/auth/d" + + "ialogflowB\256\001\n&com.google.cloud.dialogflo" + + "w.cx.v3beta1B\017EntityTypeProtoP\001ZDgoogle." + + "golang.org/genproto/googleapis/cloud/dia" + + "logflow/cx/v3beta1;cx\370\001\001\242\002\002DF\252\002\"Google.C" + + "loud.Dialogflow.Cx.V3Beta1b\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.api.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Kind", + "AutoExpansionMode", + "Entities", + "ExcludedPhrases", + "EnableFuzzyExtraction", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_Entity_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_Entity_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_Entity_descriptor, + new java.lang.String[] { + "Value", "Synonyms", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_ExcludedPhrase_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_ExcludedPhrase_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_EntityType_ExcludedPhrase_descriptor, + new java.lang.String[] { + "Value", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesRequest_descriptor, + new java.lang.String[] { + "Parent", "LanguageCode", "PageSize", "PageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesResponse_descriptor, + new java.lang.String[] { + "EntityTypes", "NextPageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetEntityTypeRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetEntityTypeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_GetEntityTypeRequest_descriptor, + new java.lang.String[] { + "Name", "LanguageCode", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEntityTypeRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEntityTypeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEntityTypeRequest_descriptor, + new java.lang.String[] { + "Parent", "EntityType", "LanguageCode", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEntityTypeRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEntityTypeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEntityTypeRequest_descriptor, + new java.lang.String[] { + "EntityType", "LanguageCode", "UpdateMask", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEntityTypeRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEntityTypeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEntityTypeRequest_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.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Environment.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Environment.java new file mode 100644 index 000000000..f46512d9b --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Environment.java @@ -0,0 +1,2660 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Represents an environment for an agent. You can create multiple versions
+ * of your agent and publish them to separate environments. When you edit an
+ * agent, you are editing the draft agent. At any point, you can save the draft
+ * agent as an agent version, which is an immutable snapshot of your agent. When
+ * you save the draft agent, it is published to the default environment. When
+ * you create agent versions, you can publish them to custom environments. You
+ * can create a variety of custom environments for testing, development,
+ * production, etc.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Environment} + */ +public final class Environment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Environment) + EnvironmentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Environment.newBuilder() to construct. + private Environment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Environment() { + name_ = ""; + displayName_ = ""; + description_ = ""; + versionConfigs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Environment(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Environment( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 42: + { + 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; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + versionConfigs_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig>(); + mutable_bitField0_ |= 0x00000001; + } + versionConfigs_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.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)) { + versionConfigs_ = java.util.Collections.unmodifiableList(versionConfigs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Environment.class, + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder.class); + } + + public interface VersionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>.
+     * 
+ * + * + * string version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+     * Required. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>.
+     * 
+ * + * + * string version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); + } + /** + * + * + *
+   * Configuration for the version.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig} + */ + public static final class VersionConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig) + VersionConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use VersionConfig.newBuilder() to construct. + private VersionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VersionConfig() { + version_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VersionConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private VersionConfig( + 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(); + + version_ = 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.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_VersionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_VersionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.class, + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.Builder.class); + } + + public static final int VERSION_FIELD_NUMBER = 1; + private volatile java.lang.Object version_; + /** + * + * + *
+     * Required. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>.
+     * 
+ * + * + * string version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + 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(); + version_ = s; + return s; + } + } + /** + * + * + *
+     * Required. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>.
+     * 
+ * + * + * string version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = 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 (!getVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, version_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, version_); + } + 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.dialogflow.cx.v3beta1.Environment.VersionConfig)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig other = + (com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig) obj; + + if (!getVersion().equals(other.getVersion())) 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) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig 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.dialogflow.cx.v3beta1.Environment.VersionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig 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.dialogflow.cx.v3beta1.Environment.VersionConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig 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.dialogflow.cx.v3beta1.Environment.VersionConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + 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.dialogflow.cx.v3beta1.Environment.VersionConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig 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.dialogflow.cx.v3beta1.Environment.VersionConfig 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 for the version.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig) + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_VersionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_VersionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.class, + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.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(); + version_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_VersionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig build() { + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig result = + new com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig(this); + result.version_ = version_; + 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.dialogflow.cx.v3beta1.Environment.VersionConfig) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + .getDefaultInstance()) return this; + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + 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.dialogflow.cx.v3beta1.Environment.VersionConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+       * Required. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/flows/<Flow ID>/versions/<Version ID>.
+       * 
+ * + * + * string version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/flows/<Flow ID>/versions/<Version ID>.
+       * 
+ * + * + * string version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/flows/<Flow ID>/versions/<Version ID>.
+       * 
+ * + * + * string version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/flows/<Flow ID>/versions/<Version ID>.
+       * 
+ * + * + * string version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/flows/<Flow ID>/versions/<Version ID>.
+       * 
+ * + * + * string version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = 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.dialogflow.cx.v3beta1.Environment.VersionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig) + private static final com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VersionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VersionConfig(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.dialogflow.cx.v3beta1.Environment.VersionConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The name of the environment.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the environment.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required. The human-readable name of the environment (unique in an agent). Limit of
+   * 64 characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The human-readable name of the environment (unique in an agent). Limit of
+   * 64 characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * The human-readable description of the environment. The maximum length is
+   * 500 characters. If exceeded, the request is rejected.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The human-readable description of the environment. The maximum length is
+   * 500 characters. If exceeded, the request is rejected.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + 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 VERSION_CONFIGS_FIELD_NUMBER = 6; + private java.util.List + versionConfigs_; + /** + * + * + *
+   * Required. A list of configurations for flow versions. You should include version
+   * configs for all flows that are reachable from [`Start
+   * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+   * returned.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getVersionConfigsList() { + return versionConfigs_; + } + /** + * + * + *
+   * Required. A list of configurations for flow versions. You should include version
+   * configs for all flows that are reachable from [`Start
+   * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+   * returned.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfigOrBuilder> + getVersionConfigsOrBuilderList() { + return versionConfigs_; + } + /** + * + * + *
+   * Required. A list of configurations for flow versions. You should include version
+   * configs for all flows that are reachable from [`Start
+   * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+   * returned.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getVersionConfigsCount() { + return versionConfigs_.size(); + } + /** + * + * + *
+   * Required. A list of configurations for flow versions. You should include version
+   * configs for all flows that are reachable from [`Start
+   * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+   * returned.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig getVersionConfigs( + int index) { + return versionConfigs_.get(index); + } + /** + * + * + *
+   * Required. A list of configurations for flow versions. You should include version
+   * configs for all flows that are reachable from [`Start
+   * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+   * returned.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfigOrBuilder + getVersionConfigsOrBuilder(int index) { + return versionConfigs_.get(index); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time of this environment.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Update time of this environment.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Update time of this environment.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + for (int i = 0; i < versionConfigs_.size(); i++) { + output.writeMessage(6, versionConfigs_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + for (int i = 0; i < versionConfigs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, versionConfigs_.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.dialogflow.cx.v3beta1.Environment)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Environment other = + (com.google.cloud.dialogflow.cx.v3beta1.Environment) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getVersionConfigsList().equals(other.getVersionConfigsList())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getVersionConfigsCount() > 0) { + hash = (37 * hash) + VERSION_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getVersionConfigsList().hashCode(); + } + 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.dialogflow.cx.v3beta1.Environment parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment 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.dialogflow.cx.v3beta1.Environment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment 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.dialogflow.cx.v3beta1.Environment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment 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.dialogflow.cx.v3beta1.Environment parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment 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.dialogflow.cx.v3beta1.Environment parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment 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.dialogflow.cx.v3beta1.Environment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents an environment for an agent. You can create multiple versions
+   * of your agent and publish them to separate environments. When you edit an
+   * agent, you are editing the draft agent. At any point, you can save the draft
+   * agent as an agent version, which is an immutable snapshot of your agent. When
+   * you save the draft agent, it is published to the default environment. When
+   * you create agent versions, you can publish them to custom environments. You
+   * can create a variety of custom environments for testing, development,
+   * production, etc.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Environment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Environment) + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Environment.class, + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.Environment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getVersionConfigsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + description_ = ""; + + if (versionConfigsBuilder_ == null) { + versionConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + versionConfigsBuilder_.clear(); + } + 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.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Environment getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Environment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Environment build() { + com.google.cloud.dialogflow.cx.v3beta1.Environment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Environment buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Environment result = + new com.google.cloud.dialogflow.cx.v3beta1.Environment(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + result.description_ = description_; + if (versionConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + versionConfigs_ = java.util.Collections.unmodifiableList(versionConfigs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.versionConfigs_ = versionConfigs_; + } else { + result.versionConfigs_ = versionConfigsBuilder_.build(); + } + 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.dialogflow.cx.v3beta1.Environment) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.Environment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Environment other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.Environment.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (versionConfigsBuilder_ == null) { + if (!other.versionConfigs_.isEmpty()) { + if (versionConfigs_.isEmpty()) { + versionConfigs_ = other.versionConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVersionConfigsIsMutable(); + versionConfigs_.addAll(other.versionConfigs_); + } + onChanged(); + } + } else { + if (!other.versionConfigs_.isEmpty()) { + if (versionConfigsBuilder_.isEmpty()) { + versionConfigsBuilder_.dispose(); + versionConfigsBuilder_ = null; + versionConfigs_ = other.versionConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + versionConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVersionConfigsFieldBuilder() + : null; + } else { + versionConfigsBuilder_.addAllMessages(other.versionConfigs_); + } + } + } + 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.dialogflow.cx.v3beta1.Environment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.Environment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the environment.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the environment.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the environment.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the environment.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the environment.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The human-readable name of the environment (unique in an agent). Limit of
+     * 64 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the environment (unique in an agent). Limit of
+     * 64 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the environment (unique in an agent). Limit of
+     * 64 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the environment (unique in an agent). Limit of
+     * 64 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the environment (unique in an agent). Limit of
+     * 64 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * The human-readable description of the environment. The maximum length is
+     * 500 characters. If exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @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; + } + } + /** + * + * + *
+     * The human-readable description of the environment. The maximum length is
+     * 500 characters. If exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @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; + } + } + /** + * + * + *
+     * The human-readable description of the environment. The maximum length is
+     * 500 characters. If exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @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; + } + /** + * + * + *
+     * The human-readable description of the environment. The maximum length is
+     * 500 characters. If exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * The human-readable description of the environment. The maximum length is
+     * 500 characters. If exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @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 java.util.List + versionConfigs_ = java.util.Collections.emptyList(); + + private void ensureVersionConfigsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + versionConfigs_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig>(versionConfigs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig, + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfigOrBuilder> + versionConfigsBuilder_; + + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getVersionConfigsList() { + if (versionConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(versionConfigs_); + } else { + return versionConfigsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getVersionConfigsCount() { + if (versionConfigsBuilder_ == null) { + return versionConfigs_.size(); + } else { + return versionConfigsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig getVersionConfigs( + int index) { + if (versionConfigsBuilder_ == null) { + return versionConfigs_.get(index); + } else { + return versionConfigsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setVersionConfigs( + int index, com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig value) { + if (versionConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionConfigsIsMutable(); + versionConfigs_.set(index, value); + onChanged(); + } else { + versionConfigsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setVersionConfigs( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.Builder builderForValue) { + if (versionConfigsBuilder_ == null) { + ensureVersionConfigsIsMutable(); + versionConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + versionConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addVersionConfigs( + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig value) { + if (versionConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionConfigsIsMutable(); + versionConfigs_.add(value); + onChanged(); + } else { + versionConfigsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addVersionConfigs( + int index, com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig value) { + if (versionConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionConfigsIsMutable(); + versionConfigs_.add(index, value); + onChanged(); + } else { + versionConfigsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addVersionConfigs( + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.Builder builderForValue) { + if (versionConfigsBuilder_ == null) { + ensureVersionConfigsIsMutable(); + versionConfigs_.add(builderForValue.build()); + onChanged(); + } else { + versionConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addVersionConfigs( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.Builder builderForValue) { + if (versionConfigsBuilder_ == null) { + ensureVersionConfigsIsMutable(); + versionConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + versionConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllVersionConfigs( + java.lang.Iterable< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig> + values) { + if (versionConfigsBuilder_ == null) { + ensureVersionConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, versionConfigs_); + onChanged(); + } else { + versionConfigsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearVersionConfigs() { + if (versionConfigsBuilder_ == null) { + versionConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + versionConfigsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeVersionConfigs(int index) { + if (versionConfigsBuilder_ == null) { + ensureVersionConfigsIsMutable(); + versionConfigs_.remove(index); + onChanged(); + } else { + versionConfigsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.Builder + getVersionConfigsBuilder(int index) { + return getVersionConfigsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfigOrBuilder + getVersionConfigsOrBuilder(int index) { + if (versionConfigsBuilder_ == null) { + return versionConfigs_.get(index); + } else { + return versionConfigsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfigOrBuilder> + getVersionConfigsOrBuilderList() { + if (versionConfigsBuilder_ != null) { + return versionConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(versionConfigs_); + } + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.Builder + addVersionConfigsBuilder() { + return getVersionConfigsFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + .getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.Builder + addVersionConfigsBuilder(int index) { + return getVersionConfigsFieldBuilder() + .addBuilder( + index, + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig + .getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of configurations for flow versions. You should include version
+     * configs for all flows that are reachable from [`Start
+     * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+     * returned.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getVersionConfigsBuilderList() { + return getVersionConfigsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig, + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfigOrBuilder> + getVersionConfigsFieldBuilder() { + if (versionConfigsBuilder_ == null) { + versionConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig, + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfigOrBuilder>( + versionConfigs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + versionConfigs_ = null; + } + return versionConfigsBuilder_; + } + + 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_; + /** + * + * + *
+     * Output only. Update time of this environment.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. Update time of this environment.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Output only. Update time of this environment.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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; + } + /** + * + * + *
+     * Output only. Update time of this environment.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Update time of this environment.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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; + } + /** + * + * + *
+     * Output only. Update time of this environment.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Update time of this environment.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time of this environment.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Update time of this environment.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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.dialogflow.cx.v3beta1.Environment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Environment) + private static final com.google.cloud.dialogflow.cx.v3beta1.Environment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Environment(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Environment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Environment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Environment(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.dialogflow.cx.v3beta1.Environment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentName.java new file mode 100644 index 000000000..33cfca470 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentName.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.dialogflow.cx.v3beta1; + +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 EnvironmentName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String agent; + private final String environment; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getEnvironment() { + return environment; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private EnvironmentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + environment = Preconditions.checkNotNull(builder.getEnvironment()); + } + + public static EnvironmentName of( + String project, String location, String agent, String environment) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setEnvironment(environment) + .build(); + } + + public static String format(String project, String location, String agent, String environment) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setEnvironment(environment) + .build() + .toString(); + } + + public static EnvironmentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "EnvironmentName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("agent"), + matchMap.get("environment")); + } + + 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 (EnvironmentName 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("agent", agent); + fieldMapBuilder.put("environment", environment); + 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, "agent", agent, "environment", environment); + } + + /** Builder for EnvironmentName. */ + public static class Builder { + + private String project; + private String location; + private String agent; + private String environment; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getEnvironment() { + return environment; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAgent(String agent) { + this.agent = agent; + return this; + } + + public Builder setEnvironment(String environment) { + this.environment = environment; + return this; + } + + private Builder() {} + + private Builder(EnvironmentName environmentName) { + project = environmentName.project; + location = environmentName.location; + agent = environmentName.agent; + environment = environmentName.environment; + } + + public EnvironmentName build() { + return new EnvironmentName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof EnvironmentName) { + EnvironmentName that = (EnvironmentName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.agent.equals(that.agent)) + && (this.environment.equals(that.environment)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= agent.hashCode(); + h *= 1000003; + h ^= environment.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentOrBuilder.java new file mode 100644 index 000000000..d90706d1c --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface EnvironmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Environment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the environment.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the environment.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The human-readable name of the environment (unique in an agent). Limit of
+   * 64 characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The human-readable name of the environment (unique in an agent). Limit of
+   * 64 characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The human-readable description of the environment. The maximum length is
+   * 500 characters. If exceeded, the request is rejected.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * The human-readable description of the environment. The maximum length is
+   * 500 characters. If exceeded, the request is rejected.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Required. A list of configurations for flow versions. You should include version
+   * configs for all flows that are reachable from [`Start
+   * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+   * returned.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getVersionConfigsList(); + /** + * + * + *
+   * Required. A list of configurations for flow versions. You should include version
+   * configs for all flows that are reachable from [`Start
+   * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+   * returned.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig getVersionConfigs(int index); + /** + * + * + *
+   * Required. A list of configurations for flow versions. You should include version
+   * configs for all flows that are reachable from [`Start
+   * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+   * returned.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getVersionConfigsCount(); + /** + * + * + *
+   * Required. A list of configurations for flow versions. You should include version
+   * configs for all flows that are reachable from [`Start
+   * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+   * returned.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfigOrBuilder> + getVersionConfigsOrBuilderList(); + /** + * + * + *
+   * Required. A list of configurations for flow versions. You should include version
+   * configs for all flows that are reachable from [`Start
+   * Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
+   * returned.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfig version_configs = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Environment.VersionConfigOrBuilder + getVersionConfigsOrBuilder(int index); + + /** + * + * + *
+   * Output only. Update time of this environment.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time of this environment.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time of this environment.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentProto.java new file mode 100644 index 000000000..d2b14d789 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentProto.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class EnvironmentProto { + private EnvironmentProto() {} + + 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_dialogflow_cx_v3beta1_Environment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_VersionConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_VersionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_GetEnvironmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_GetEnvironmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEnvironmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEnvironmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEnvironmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEnvironmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEnvironmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEnvironmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n4google/cloud/dialogflow/cx/v3beta1/env" + + "ironment.proto\022\"google.cloud.dialogflow." + + "cx.v3beta1\032\034google/api/annotations.proto" + + "\032\027google/api/client.proto\032\037google/api/fi" + + "eld_behavior.proto\032\031google/api/resource." + + "proto\032#google/longrunning/operations.pro" + + "to\032\033google/protobuf/empty.proto\032 google/" + + "protobuf/field_mask.proto\032\037google/protob" + + "uf/timestamp.proto\"\252\003\n\013Environment\022\014\n\004na" + + "me\030\001 \001(\t\022\031\n\014display_name\030\002 \001(\tB\003\340A\002\022\023\n\013d" + + "escription\030\003 \001(\t\022[\n\017version_configs\030\006 \003(" + + "\0132=.google.cloud.dialogflow.cx.v3beta1.E" + + "nvironment.VersionConfigB\003\340A\002\0224\n\013update_" + + "time\030\005 \001(\0132\032.google.protobuf.TimestampB\003" + + "\340A\003\032K\n\rVersionConfig\022:\n\007version\030\001 \001(\tB)\340" + + "A\002\372A#\n!dialogflow.googleapis.com/Version" + + ":}\352Az\n%dialogflow.googleapis.com/Environ" + + "ment\022Qprojects/{project}/locations/{loca" + + "tion}/agents/{agent}/environments/{envir" + + "onment}\"\177\n\027ListEnvironmentsRequest\022=\n\006pa" + + "rent\030\001 \001(\tB-\340A\002\372A\'\022%dialogflow.googleapi" + + "s.com/Environment\022\021\n\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"z\n\030ListEnvironmentsResp" + + "onse\022E\n\014environments\030\001 \003(\0132/.google.clou" + + "d.dialogflow.cx.v3beta1.Environment\022\027\n\017n" + + "ext_page_token\030\002 \001(\t\"T\n\025GetEnvironmentRe" + + "quest\022;\n\004name\030\001 \001(\tB-\340A\002\372A\'\n%dialogflow." + + "googleapis.com/Environment\"\244\001\n\030CreateEnv" + + "ironmentRequest\022=\n\006parent\030\001 \001(\tB-\340A\002\372A\'\022" + + "%dialogflow.googleapis.com/Environment\022I" + + "\n\013environment\030\002 \001(\0132/.google.cloud.dialo" + + "gflow.cx.v3beta1.EnvironmentB\003\340A\002\"\233\001\n\030Up" + + "dateEnvironmentRequest\022I\n\013environment\030\001 " + + "\001(\0132/.google.cloud.dialogflow.cx.v3beta1" + + ".EnvironmentB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032" + + ".google.protobuf.FieldMaskB\003\340A\002\"W\n\030Delet" + + "eEnvironmentRequest\022;\n\004name\030\001 \001(\tB-\340A\002\372A" + + "\'\n%dialogflow.googleapis.com/Environment" + + "\"\205\001\n\037LookupEnvironmentHistoryRequest\022;\n\004" + + "name\030\001 \001(\tB-\340A\002\372A\'\n%dialogflow.googleapi" + + "s.com/Environment\022\021\n\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"\202\001\n LookupEnvironmentHi" + + "storyResponse\022E\n\014environments\030\001 \003(\0132/.go" + + "ogle.cloud.dialogflow.cx.v3beta1.Environ" + + "ment\022\027\n\017next_page_token\030\002 \001(\t2\237\014\n\014Enviro" + + "nments\022\336\001\n\020ListEnvironments\022;.google.clo" + + "ud.dialogflow.cx.v3beta1.ListEnvironment" + + "sRequest\032<.google.cloud.dialogflow.cx.v3" + + "beta1.ListEnvironmentsResponse\"O\202\323\344\223\002@\022>" + + "/v3beta1/{parent=projects/*/locations/*/" + + "agents/*}/environments\332A\006parent\022\313\001\n\016GetE" + + "nvironment\0229.google.cloud.dialogflow.cx." + + "v3beta1.GetEnvironmentRequest\032/.google.c" + + "loud.dialogflow.cx.v3beta1.Environment\"M" + + "\202\323\344\223\002@\022>/v3beta1/{name=projects/*/locati" + + "ons/*/agents/*/environments/*}\332A\004name\022\203\002" + + "\n\021CreateEnvironment\022<.google.cloud.dialo" + + "gflow.cx.v3beta1.CreateEnvironmentReques" + + "t\032\035.google.longrunning.Operation\"\220\001\202\323\344\223\002" + + "M\">/v3beta1/{parent=projects/*/locations" + + "/*/agents/*}/environments:\013environment\332A" + + "\022parent,environment\312A%\n\013Environment\022\026goo" + + "gle.protobuf.Struct\022\224\002\n\021UpdateEnvironmen" + + "t\022<.google.cloud.dialogflow.cx.v3beta1.U" + + "pdateEnvironmentRequest\032\035.google.longrun" + + "ning.Operation\"\241\001\202\323\344\223\002Y2J/v3beta1/{envir" + + "onment.name=projects/*/locations/*/agent" + + "s/*/environments/*}:\013environment\332A\027envir" + + "onment,update_mask\312A%\n\013Environment\022\026goog" + + "le.protobuf.Struct\022\270\001\n\021DeleteEnvironment" + + "\022<.google.cloud.dialogflow.cx.v3beta1.De" + + "leteEnvironmentRequest\032\026.google.protobuf" + + ".Empty\"M\202\323\344\223\002@*>/v3beta1/{name=projects/" + + "*/locations/*/agents/*/environments/*}\332A" + + "\004name\022\215\002\n\030LookupEnvironmentHistory\022C.goo" + + "gle.cloud.dialogflow.cx.v3beta1.LookupEn" + + "vironmentHistoryRequest\032D.google.cloud.d" + + "ialogflow.cx.v3beta1.LookupEnvironmentHi" + + "storyResponse\"f\202\323\344\223\002Y\022W/v3beta1/{name=pr" + + "ojects/*/locations/*/agents/*/environmen" + + "ts/*}:lookupEnvironmentHistory\332A\004name\032x\312" + + "A\031dialogflow.googleapis.com\322AYhttps://ww" + + "w.googleapis.com/auth/cloud-platform,htt" + + "ps://www.googleapis.com/auth/dialogflowB" + + "\257\001\n&com.google.cloud.dialogflow.cx.v3bet" + + "a1B\020EnvironmentProtoP\001ZDgoogle.golang.or" + + "g/genproto/googleapis/cloud/dialogflow/c" + + "x/v3beta1;cx\370\001\001\242\002\002DF\252\002\"Google.Cloud.Dial" + + "ogflow.Cx.V3Beta1b\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.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Description", "VersionConfigs", "UpdateTime", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_VersionConfig_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_VersionConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Environment_VersionConfig_descriptor, + new java.lang.String[] { + "Version", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsResponse_descriptor, + new java.lang.String[] { + "Environments", "NextPageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetEnvironmentRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetEnvironmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_GetEnvironmentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEnvironmentRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEnvironmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateEnvironmentRequest_descriptor, + new java.lang.String[] { + "Parent", "Environment", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEnvironmentRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEnvironmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEnvironmentRequest_descriptor, + new java.lang.String[] { + "Environment", "UpdateMask", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEnvironmentRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEnvironmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteEnvironmentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryRequest_descriptor, + new java.lang.String[] { + "Name", "PageSize", "PageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryResponse_descriptor, + new java.lang.String[] { + "Environments", "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.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EventHandler.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EventHandler.java new file mode 100644 index 000000000..d20d16874 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EventHandler.java @@ -0,0 +1,1669 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * An event handler specifies an [event][google.cloud.dialogflow.cx.v3beta1.EventHandler.event] that can be handled
+ * during a session. When the specified event happens, the following actions are
+ * taken in order:
+ * *   If there is a
+ * [`trigger_fulfillment`][google.cloud.dialogflow.cx.v3beta1.EventHandler.trigger_fulfillment] associated with
+ * the event, it will be called.
+ * *   If there is a [`target_page`][google.cloud.dialogflow.cx.v3beta1.EventHandler.target_page] associated
+ * with the event, the session will transition into the specified page.
+ * *   If there is a [`target_flow`][google.cloud.dialogflow.cx.v3beta1.EventHandler.target_flow] associated
+ * with the event, the session will transition into the specified flow.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.EventHandler} + */ +public final class EventHandler extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.EventHandler) + EventHandlerOrBuilder { + private static final long serialVersionUID = 0L; + // Use EventHandler.newBuilder() to construct. + private EventHandler(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EventHandler() { + name_ = ""; + event_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EventHandler(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EventHandler( + 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 18: + { + java.lang.String s = input.readStringRequireUtf8(); + targetCase_ = 2; + target_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + targetCase_ = 3; + target_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + event_ = s; + break; + } + case 42: + { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder subBuilder = null; + if (triggerFulfillment_ != null) { + subBuilder = triggerFulfillment_.toBuilder(); + } + triggerFulfillment_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(triggerFulfillment_); + triggerFulfillment_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + 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.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EventHandler_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EventHandler_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.class, + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder.class); + } + + private int targetCase_ = 0; + private java.lang.Object target_; + + public enum TargetCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TARGET_PAGE(2), + TARGET_FLOW(3), + TARGET_NOT_SET(0); + private final int value; + + private TargetCase(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 TargetCase valueOf(int value) { + return forNumber(value); + } + + public static TargetCase forNumber(int value) { + switch (value) { + case 2: + return TARGET_PAGE; + case 3: + return TARGET_FLOW; + case 0: + return TARGET_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TargetCase getTargetCase() { + return TargetCase.forNumber(targetCase_); + } + + public static final int NAME_FIELD_NUMBER = 6; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The unique identifier of this event handler.
+   * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The unique identifier of this event handler.
+   * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_FIELD_NUMBER = 4; + private volatile java.lang.Object event_; + /** + * + * + *
+   * Required. The name of the event to handle.
+   * 
+ * + * string event = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The event. + */ + @java.lang.Override + public java.lang.String getEvent() { + java.lang.Object ref = event_; + 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(); + event_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the event to handle.
+   * 
+ * + * string event = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for event. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEventBytes() { + java.lang.Object ref = event_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + event_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRIGGER_FULFILLMENT_FIELD_NUMBER = 5; + private com.google.cloud.dialogflow.cx.v3beta1.Fulfillment triggerFulfillment_; + /** + * + * + *
+   * The fulfillment to call when the event occurs.
+   * Handling webhook errors with a fulfillment enabled with webhook could
+   * cause infinite loop. It is invalid to specify such fulfillment for a
+   * handler handling webhooks.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + * + * @return Whether the triggerFulfillment field is set. + */ + @java.lang.Override + public boolean hasTriggerFulfillment() { + return triggerFulfillment_ != null; + } + /** + * + * + *
+   * The fulfillment to call when the event occurs.
+   * Handling webhook errors with a fulfillment enabled with webhook could
+   * cause infinite loop. It is invalid to specify such fulfillment for a
+   * handler handling webhooks.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + * + * @return The triggerFulfillment. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment getTriggerFulfillment() { + return triggerFulfillment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.getDefaultInstance() + : triggerFulfillment_; + } + /** + * + * + *
+   * The fulfillment to call when the event occurs.
+   * Handling webhook errors with a fulfillment enabled with webhook could
+   * cause infinite loop. It is invalid to specify such fulfillment for a
+   * handler handling webhooks.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder + getTriggerFulfillmentOrBuilder() { + return getTriggerFulfillment(); + } + + public static final int TARGET_PAGE_FIELD_NUMBER = 2; + /** + * + * + *
+   * The target page to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string target_page = 2 [(.google.api.resource_reference) = { ... } + * + * @return The targetPage. + */ + public java.lang.String getTargetPage() { + java.lang.Object ref = ""; + if (targetCase_ == 2) { + ref = target_; + } + 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 (targetCase_ == 2) { + target_ = s; + } + return s; + } + } + /** + * + * + *
+   * The target page to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string target_page = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetPage. + */ + public com.google.protobuf.ByteString getTargetPageBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 2) { + ref = target_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 2) { + target_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_FLOW_FIELD_NUMBER = 3; + /** + * + * + *
+   * The target flow to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string target_flow = 3 [(.google.api.resource_reference) = { ... } + * + * @return The targetFlow. + */ + public java.lang.String getTargetFlow() { + java.lang.Object ref = ""; + if (targetCase_ == 3) { + ref = target_; + } + 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 (targetCase_ == 3) { + target_ = s; + } + return s; + } + } + /** + * + * + *
+   * The target flow to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string target_flow = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetFlow. + */ + public com.google.protobuf.ByteString getTargetFlowBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 3) { + ref = target_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 3) { + target_ = 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 (targetCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, target_); + } + if (targetCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!getEventBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, event_); + } + if (triggerFulfillment_ != null) { + output.writeMessage(5, getTriggerFulfillment()); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (targetCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, target_); + } + if (targetCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!getEventBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, event_); + } + if (triggerFulfillment_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getTriggerFulfillment()); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, 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.dialogflow.cx.v3beta1.EventHandler)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.EventHandler other = + (com.google.cloud.dialogflow.cx.v3beta1.EventHandler) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEvent().equals(other.getEvent())) return false; + if (hasTriggerFulfillment() != other.hasTriggerFulfillment()) return false; + if (hasTriggerFulfillment()) { + if (!getTriggerFulfillment().equals(other.getTriggerFulfillment())) return false; + } + if (!getTargetCase().equals(other.getTargetCase())) return false; + switch (targetCase_) { + case 2: + if (!getTargetPage().equals(other.getTargetPage())) return false; + break; + case 3: + if (!getTargetFlow().equals(other.getTargetFlow())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + if (hasTriggerFulfillment()) { + hash = (37 * hash) + TRIGGER_FULFILLMENT_FIELD_NUMBER; + hash = (53 * hash) + getTriggerFulfillment().hashCode(); + } + switch (targetCase_) { + case 2: + hash = (37 * hash) + TARGET_PAGE_FIELD_NUMBER; + hash = (53 * hash) + getTargetPage().hashCode(); + break; + case 3: + hash = (37 * hash) + TARGET_FLOW_FIELD_NUMBER; + hash = (53 * hash) + getTargetFlow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EventHandler parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EventHandler 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.dialogflow.cx.v3beta1.EventHandler parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EventHandler 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.dialogflow.cx.v3beta1.EventHandler parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EventHandler parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EventHandler parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EventHandler 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.dialogflow.cx.v3beta1.EventHandler parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EventHandler 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.dialogflow.cx.v3beta1.EventHandler parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EventHandler 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.dialogflow.cx.v3beta1.EventHandler prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An event handler specifies an [event][google.cloud.dialogflow.cx.v3beta1.EventHandler.event] that can be handled
+   * during a session. When the specified event happens, the following actions are
+   * taken in order:
+   * *   If there is a
+   * [`trigger_fulfillment`][google.cloud.dialogflow.cx.v3beta1.EventHandler.trigger_fulfillment] associated with
+   * the event, it will be called.
+   * *   If there is a [`target_page`][google.cloud.dialogflow.cx.v3beta1.EventHandler.target_page] associated
+   * with the event, the session will transition into the specified page.
+   * *   If there is a [`target_flow`][google.cloud.dialogflow.cx.v3beta1.EventHandler.target_flow] associated
+   * with the event, the session will transition into the specified flow.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.EventHandler} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.EventHandler) + com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EventHandler_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EventHandler_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.class, + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.EventHandler.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_ = ""; + + event_ = ""; + + if (triggerFulfillmentBuilder_ == null) { + triggerFulfillment_ = null; + } else { + triggerFulfillment_ = null; + triggerFulfillmentBuilder_ = null; + } + targetCase_ = 0; + target_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_EventHandler_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EventHandler.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler build() { + com.google.cloud.dialogflow.cx.v3beta1.EventHandler result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.EventHandler result = + new com.google.cloud.dialogflow.cx.v3beta1.EventHandler(this); + result.name_ = name_; + result.event_ = event_; + if (triggerFulfillmentBuilder_ == null) { + result.triggerFulfillment_ = triggerFulfillment_; + } else { + result.triggerFulfillment_ = triggerFulfillmentBuilder_.build(); + } + if (targetCase_ == 2) { + result.target_ = target_; + } + if (targetCase_ == 3) { + result.target_ = target_; + } + result.targetCase_ = targetCase_; + 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.dialogflow.cx.v3beta1.EventHandler) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.EventHandler) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.EventHandler other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.EventHandler.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getEvent().isEmpty()) { + event_ = other.event_; + onChanged(); + } + if (other.hasTriggerFulfillment()) { + mergeTriggerFulfillment(other.getTriggerFulfillment()); + } + switch (other.getTargetCase()) { + case TARGET_PAGE: + { + targetCase_ = 2; + target_ = other.target_; + onChanged(); + break; + } + case TARGET_FLOW: + { + targetCase_ = 3; + target_ = other.target_; + onChanged(); + break; + } + case TARGET_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.dialogflow.cx.v3beta1.EventHandler parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.EventHandler) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int targetCase_ = 0; + private java.lang.Object target_; + + public TargetCase getTargetCase() { + return TargetCase.forNumber(targetCase_); + } + + public Builder clearTarget() { + targetCase_ = 0; + target_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The unique identifier of this event handler.
+     * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The unique identifier of this event handler.
+     * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The unique identifier of this event handler.
+     * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. The unique identifier of this event handler.
+     * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique identifier of this event handler.
+     * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object event_ = ""; + /** + * + * + *
+     * Required. The name of the event to handle.
+     * 
+ * + * string event = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The event. + */ + public java.lang.String getEvent() { + java.lang.Object ref = event_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + event_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the event to handle.
+     * 
+ * + * string event = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for event. + */ + public com.google.protobuf.ByteString getEventBytes() { + java.lang.Object ref = event_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + event_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the event to handle.
+     * 
+ * + * string event = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The event to set. + * @return This builder for chaining. + */ + public Builder setEvent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + event_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the event to handle.
+     * 
+ * + * string event = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEvent() { + + event_ = getDefaultInstance().getEvent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the event to handle.
+     * 
+ * + * string event = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for event to set. + * @return This builder for chaining. + */ + public Builder setEventBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + event_ = value; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Fulfillment triggerFulfillment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder> + triggerFulfillmentBuilder_; + /** + * + * + *
+     * The fulfillment to call when the event occurs.
+     * Handling webhook errors with a fulfillment enabled with webhook could
+     * cause infinite loop. It is invalid to specify such fulfillment for a
+     * handler handling webhooks.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + * + * @return Whether the triggerFulfillment field is set. + */ + public boolean hasTriggerFulfillment() { + return triggerFulfillmentBuilder_ != null || triggerFulfillment_ != null; + } + /** + * + * + *
+     * The fulfillment to call when the event occurs.
+     * Handling webhook errors with a fulfillment enabled with webhook could
+     * cause infinite loop. It is invalid to specify such fulfillment for a
+     * handler handling webhooks.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + * + * @return The triggerFulfillment. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment getTriggerFulfillment() { + if (triggerFulfillmentBuilder_ == null) { + return triggerFulfillment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.getDefaultInstance() + : triggerFulfillment_; + } else { + return triggerFulfillmentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fulfillment to call when the event occurs.
+     * Handling webhook errors with a fulfillment enabled with webhook could
+     * cause infinite loop. It is invalid to specify such fulfillment for a
+     * handler handling webhooks.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + */ + public Builder setTriggerFulfillment(com.google.cloud.dialogflow.cx.v3beta1.Fulfillment value) { + if (triggerFulfillmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + triggerFulfillment_ = value; + onChanged(); + } else { + triggerFulfillmentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fulfillment to call when the event occurs.
+     * Handling webhook errors with a fulfillment enabled with webhook could
+     * cause infinite loop. It is invalid to specify such fulfillment for a
+     * handler handling webhooks.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + */ + public Builder setTriggerFulfillment( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder builderForValue) { + if (triggerFulfillmentBuilder_ == null) { + triggerFulfillment_ = builderForValue.build(); + onChanged(); + } else { + triggerFulfillmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fulfillment to call when the event occurs.
+     * Handling webhook errors with a fulfillment enabled with webhook could
+     * cause infinite loop. It is invalid to specify such fulfillment for a
+     * handler handling webhooks.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + */ + public Builder mergeTriggerFulfillment( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment value) { + if (triggerFulfillmentBuilder_ == null) { + if (triggerFulfillment_ != null) { + triggerFulfillment_ = + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.newBuilder(triggerFulfillment_) + .mergeFrom(value) + .buildPartial(); + } else { + triggerFulfillment_ = value; + } + onChanged(); + } else { + triggerFulfillmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fulfillment to call when the event occurs.
+     * Handling webhook errors with a fulfillment enabled with webhook could
+     * cause infinite loop. It is invalid to specify such fulfillment for a
+     * handler handling webhooks.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + */ + public Builder clearTriggerFulfillment() { + if (triggerFulfillmentBuilder_ == null) { + triggerFulfillment_ = null; + onChanged(); + } else { + triggerFulfillment_ = null; + triggerFulfillmentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fulfillment to call when the event occurs.
+     * Handling webhook errors with a fulfillment enabled with webhook could
+     * cause infinite loop. It is invalid to specify such fulfillment for a
+     * handler handling webhooks.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder + getTriggerFulfillmentBuilder() { + + onChanged(); + return getTriggerFulfillmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fulfillment to call when the event occurs.
+     * Handling webhook errors with a fulfillment enabled with webhook could
+     * cause infinite loop. It is invalid to specify such fulfillment for a
+     * handler handling webhooks.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + */ + public com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder + getTriggerFulfillmentOrBuilder() { + if (triggerFulfillmentBuilder_ != null) { + return triggerFulfillmentBuilder_.getMessageOrBuilder(); + } else { + return triggerFulfillment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.getDefaultInstance() + : triggerFulfillment_; + } + } + /** + * + * + *
+     * The fulfillment to call when the event occurs.
+     * Handling webhook errors with a fulfillment enabled with webhook could
+     * cause infinite loop. It is invalid to specify such fulfillment for a
+     * handler handling webhooks.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder> + getTriggerFulfillmentFieldBuilder() { + if (triggerFulfillmentBuilder_ == null) { + triggerFulfillmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder>( + getTriggerFulfillment(), getParentForChildren(), isClean()); + triggerFulfillment_ = null; + } + return triggerFulfillmentBuilder_; + } + + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 2 [(.google.api.resource_reference) = { ... } + * + * @return The targetPage. + */ + @java.lang.Override + public java.lang.String getTargetPage() { + java.lang.Object ref = ""; + if (targetCase_ == 2) { + ref = target_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (targetCase_ == 2) { + target_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetPage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetPageBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 2) { + ref = target_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 2) { + target_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The targetPage to set. + * @return This builder for chaining. + */ + public Builder setTargetPage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetCase_ = 2; + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearTargetPage() { + if (targetCase_ == 2) { + targetCase_ = 0; + target_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for targetPage to set. + * @return This builder for chaining. + */ + public Builder setTargetPageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetCase_ = 2; + target_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 3 [(.google.api.resource_reference) = { ... } + * + * @return The targetFlow. + */ + @java.lang.Override + public java.lang.String getTargetFlow() { + java.lang.Object ref = ""; + if (targetCase_ == 3) { + ref = target_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (targetCase_ == 3) { + target_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetFlow. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetFlowBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 3) { + ref = target_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 3) { + target_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The targetFlow to set. + * @return This builder for chaining. + */ + public Builder setTargetFlow(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetCase_ = 3; + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 3 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearTargetFlow() { + if (targetCase_ == 3) { + targetCase_ = 0; + target_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for targetFlow to set. + * @return This builder for chaining. + */ + public Builder setTargetFlowBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetCase_ = 3; + target_ = 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.dialogflow.cx.v3beta1.EventHandler) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.EventHandler) + private static final com.google.cloud.dialogflow.cx.v3beta1.EventHandler DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.EventHandler(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.EventHandler getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventHandler parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EventHandler(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.dialogflow.cx.v3beta1.EventHandler getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EventHandlerOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EventHandlerOrBuilder.java new file mode 100644 index 000000000..97ef9c118 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EventHandlerOrBuilder.java @@ -0,0 +1,179 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface EventHandlerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.EventHandler) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The unique identifier of this event handler.
+   * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The unique identifier of this event handler.
+   * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The name of the event to handle.
+   * 
+ * + * string event = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The event. + */ + java.lang.String getEvent(); + /** + * + * + *
+   * Required. The name of the event to handle.
+   * 
+ * + * string event = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for event. + */ + com.google.protobuf.ByteString getEventBytes(); + + /** + * + * + *
+   * The fulfillment to call when the event occurs.
+   * Handling webhook errors with a fulfillment enabled with webhook could
+   * cause infinite loop. It is invalid to specify such fulfillment for a
+   * handler handling webhooks.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + * + * @return Whether the triggerFulfillment field is set. + */ + boolean hasTriggerFulfillment(); + /** + * + * + *
+   * The fulfillment to call when the event occurs.
+   * Handling webhook errors with a fulfillment enabled with webhook could
+   * cause infinite loop. It is invalid to specify such fulfillment for a
+   * handler handling webhooks.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + * + * @return The triggerFulfillment. + */ + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment getTriggerFulfillment(); + /** + * + * + *
+   * The fulfillment to call when the event occurs.
+   * Handling webhook errors with a fulfillment enabled with webhook could
+   * cause infinite loop. It is invalid to specify such fulfillment for a
+   * handler handling webhooks.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 5; + */ + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder getTriggerFulfillmentOrBuilder(); + + /** + * + * + *
+   * The target page to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string target_page = 2 [(.google.api.resource_reference) = { ... } + * + * @return The targetPage. + */ + java.lang.String getTargetPage(); + /** + * + * + *
+   * The target page to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string target_page = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetPage. + */ + com.google.protobuf.ByteString getTargetPageBytes(); + + /** + * + * + *
+   * The target flow to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string target_flow = 3 [(.google.api.resource_reference) = { ... } + * + * @return The targetFlow. + */ + java.lang.String getTargetFlow(); + /** + * + * + *
+   * The target flow to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string target_flow = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetFlow. + */ + com.google.protobuf.ByteString getTargetFlowBytes(); + + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler.TargetCase getTargetCase(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ExportAgentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ExportAgentRequest.java new file mode 100644 index 000000000..27b117424 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ExportAgentRequest.java @@ -0,0 +1,858 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Agents.ExportAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgent].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest} + */ +public final class ExportAgentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest) + ExportAgentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportAgentRequest.newBuilder() to construct. + private ExportAgentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportAgentRequest() { + name_ = ""; + agentUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportAgentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportAgentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + agentUri_ = 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.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the agent to export.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the agent to export.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AGENT_URI_FIELD_NUMBER = 2; + private volatile java.lang.Object agentUri_; + /** + * + * + *
+   * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
+   * export the agent to. The format of this URI must be
+   * `gs://<bucket-name>/<object-name>`.
+   * If left unspecified, the serialized agent is returned inline.
+   * 
+ * + * string agent_uri = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The agentUri. + */ + @java.lang.Override + public java.lang.String getAgentUri() { + java.lang.Object ref = agentUri_; + 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(); + agentUri_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
+   * export the agent to. The format of this URI must be
+   * `gs://<bucket-name>/<object-name>`.
+   * If left unspecified, the serialized agent is returned inline.
+   * 
+ * + * string agent_uri = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for agentUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAgentUriBytes() { + java.lang.Object ref = agentUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + agentUri_ = 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_); + } + if (!getAgentUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, agentUri_); + } + 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 (!getAgentUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, agentUri_); + } + 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.dialogflow.cx.v3beta1.ExportAgentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAgentUri().equals(other.getAgentUri())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + AGENT_URI_FIELD_NUMBER; + hash = (53 * hash) + getAgentUri().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest 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.dialogflow.cx.v3beta1.ExportAgentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest 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.dialogflow.cx.v3beta1.ExportAgentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest 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.dialogflow.cx.v3beta1.ExportAgentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest 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.dialogflow.cx.v3beta1.ExportAgentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest 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.dialogflow.cx.v3beta1.ExportAgentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Agents.ExportAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgent].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest) + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.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_ = ""; + + agentUri_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest(this); + result.name_ = name_; + result.agentUri_ = agentUri_; + 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.dialogflow.cx.v3beta1.ExportAgentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getAgentUri().isEmpty()) { + agentUri_ = other.agentUri_; + 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.dialogflow.cx.v3beta1.ExportAgentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the agent to export.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the agent to export.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the agent to export.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the agent to export.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the agent to export.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object agentUri_ = ""; + /** + * + * + *
+     * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
+     * export the agent to. The format of this URI must be
+     * `gs://<bucket-name>/<object-name>`.
+     * If left unspecified, the serialized agent is returned inline.
+     * 
+ * + * string agent_uri = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The agentUri. + */ + public java.lang.String getAgentUri() { + java.lang.Object ref = agentUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + agentUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
+     * export the agent to. The format of this URI must be
+     * `gs://<bucket-name>/<object-name>`.
+     * If left unspecified, the serialized agent is returned inline.
+     * 
+ * + * string agent_uri = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for agentUri. + */ + public com.google.protobuf.ByteString getAgentUriBytes() { + java.lang.Object ref = agentUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + agentUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
+     * export the agent to. The format of this URI must be
+     * `gs://<bucket-name>/<object-name>`.
+     * If left unspecified, the serialized agent is returned inline.
+     * 
+ * + * string agent_uri = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The agentUri to set. + * @return This builder for chaining. + */ + public Builder setAgentUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + agentUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
+     * export the agent to. The format of this URI must be
+     * `gs://<bucket-name>/<object-name>`.
+     * If left unspecified, the serialized agent is returned inline.
+     * 
+ * + * string agent_uri = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAgentUri() { + + agentUri_ = getDefaultInstance().getAgentUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
+     * export the agent to. The format of this URI must be
+     * `gs://<bucket-name>/<object-name>`.
+     * If left unspecified, the serialized agent is returned inline.
+     * 
+ * + * string agent_uri = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for agentUri to set. + * @return This builder for chaining. + */ + public Builder setAgentUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + agentUri_ = 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.dialogflow.cx.v3beta1.ExportAgentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportAgentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportAgentRequest(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.dialogflow.cx.v3beta1.ExportAgentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ExportAgentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ExportAgentRequestOrBuilder.java new file mode 100644 index 000000000..b98996f88 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ExportAgentRequestOrBuilder.java @@ -0,0 +1,87 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ExportAgentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the agent to export.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the agent to export.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
+   * export the agent to. The format of this URI must be
+   * `gs://<bucket-name>/<object-name>`.
+   * If left unspecified, the serialized agent is returned inline.
+   * 
+ * + * string agent_uri = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The agentUri. + */ + java.lang.String getAgentUri(); + /** + * + * + *
+   * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
+   * export the agent to. The format of this URI must be
+   * `gs://<bucket-name>/<object-name>`.
+   * If left unspecified, the serialized agent is returned inline.
+   * 
+ * + * string agent_uri = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for agentUri. + */ + com.google.protobuf.ByteString getAgentUriBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ExportAgentResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ExportAgentResponse.java new file mode 100644 index 000000000..2a4779528 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ExportAgentResponse.java @@ -0,0 +1,855 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The response message for [Agents.ExportAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgent].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse} + */ +public final class ExportAgentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse) + ExportAgentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportAgentResponse.newBuilder() to construct. + private ExportAgentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportAgentResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportAgentResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportAgentResponse( + 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(); + agentCase_ = 1; + agent_ = s; + break; + } + case 18: + { + agentCase_ = 2; + agent_ = input.readBytes(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse.Builder.class); + } + + private int agentCase_ = 0; + private java.lang.Object agent_; + + public enum AgentCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AGENT_URI(1), + AGENT_CONTENT(2), + AGENT_NOT_SET(0); + private final int value; + + private AgentCase(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 AgentCase valueOf(int value) { + return forNumber(value); + } + + public static AgentCase forNumber(int value) { + switch (value) { + case 1: + return AGENT_URI; + case 2: + return AGENT_CONTENT; + case 0: + return AGENT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public AgentCase getAgentCase() { + return AgentCase.forNumber(agentCase_); + } + + public static final int AGENT_URI_FIELD_NUMBER = 1; + /** + * + * + *
+   * The URI to a file containing the exported agent. This field is populated
+   * only if `agent_uri` is specified in [ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest].
+   * 
+ * + * string agent_uri = 1; + * + * @return The agentUri. + */ + public java.lang.String getAgentUri() { + java.lang.Object ref = ""; + if (agentCase_ == 1) { + ref = agent_; + } + 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 (agentCase_ == 1) { + agent_ = s; + } + return s; + } + } + /** + * + * + *
+   * The URI to a file containing the exported agent. This field is populated
+   * only if `agent_uri` is specified in [ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest].
+   * 
+ * + * string agent_uri = 1; + * + * @return The bytes for agentUri. + */ + public com.google.protobuf.ByteString getAgentUriBytes() { + java.lang.Object ref = ""; + if (agentCase_ == 1) { + ref = agent_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (agentCase_ == 1) { + agent_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AGENT_CONTENT_FIELD_NUMBER = 2; + /** + * + * + *
+   * Uncompressed raw byte content for agent.
+   * 
+ * + * bytes agent_content = 2; + * + * @return The agentContent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAgentContent() { + if (agentCase_ == 2) { + return (com.google.protobuf.ByteString) agent_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (agentCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, agent_); + } + if (agentCase_ == 2) { + output.writeBytes(2, (com.google.protobuf.ByteString) agent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (agentCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, agent_); + } + if (agentCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 2, (com.google.protobuf.ByteString) agent_); + } + 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.dialogflow.cx.v3beta1.ExportAgentResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse) obj; + + if (!getAgentCase().equals(other.getAgentCase())) return false; + switch (agentCase_) { + case 1: + if (!getAgentUri().equals(other.getAgentUri())) return false; + break; + case 2: + if (!getAgentContent().equals(other.getAgentContent())) 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 (agentCase_) { + case 1: + hash = (37 * hash) + AGENT_URI_FIELD_NUMBER; + hash = (53 * hash) + getAgentUri().hashCode(); + break; + case 2: + hash = (37 * hash) + AGENT_CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getAgentContent().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse 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.dialogflow.cx.v3beta1.ExportAgentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse 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.dialogflow.cx.v3beta1.ExportAgentResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse 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.dialogflow.cx.v3beta1.ExportAgentResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse 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.dialogflow.cx.v3beta1.ExportAgentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse 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.dialogflow.cx.v3beta1.ExportAgentResponse 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 response message for [Agents.ExportAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgent].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse) + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse.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(); + agentCase_ = 0; + agent_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ExportAgentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse(this); + if (agentCase_ == 1) { + result.agent_ = agent_; + } + if (agentCase_ == 2) { + result.agent_ = agent_; + } + result.agentCase_ = agentCase_; + 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.dialogflow.cx.v3beta1.ExportAgentResponse) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse.getDefaultInstance()) + return this; + switch (other.getAgentCase()) { + case AGENT_URI: + { + agentCase_ = 1; + agent_ = other.agent_; + onChanged(); + break; + } + case AGENT_CONTENT: + { + setAgentContent(other.getAgentContent()); + break; + } + case AGENT_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.dialogflow.cx.v3beta1.ExportAgentResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int agentCase_ = 0; + private java.lang.Object agent_; + + public AgentCase getAgentCase() { + return AgentCase.forNumber(agentCase_); + } + + public Builder clearAgent() { + agentCase_ = 0; + agent_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * The URI to a file containing the exported agent. This field is populated
+     * only if `agent_uri` is specified in [ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest].
+     * 
+ * + * string agent_uri = 1; + * + * @return The agentUri. + */ + @java.lang.Override + public java.lang.String getAgentUri() { + java.lang.Object ref = ""; + if (agentCase_ == 1) { + ref = agent_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (agentCase_ == 1) { + agent_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URI to a file containing the exported agent. This field is populated
+     * only if `agent_uri` is specified in [ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest].
+     * 
+ * + * string agent_uri = 1; + * + * @return The bytes for agentUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAgentUriBytes() { + java.lang.Object ref = ""; + if (agentCase_ == 1) { + ref = agent_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (agentCase_ == 1) { + agent_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URI to a file containing the exported agent. This field is populated
+     * only if `agent_uri` is specified in [ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest].
+     * 
+ * + * string agent_uri = 1; + * + * @param value The agentUri to set. + * @return This builder for chaining. + */ + public Builder setAgentUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + agentCase_ = 1; + agent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The URI to a file containing the exported agent. This field is populated
+     * only if `agent_uri` is specified in [ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest].
+     * 
+ * + * string agent_uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearAgentUri() { + if (agentCase_ == 1) { + agentCase_ = 0; + agent_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The URI to a file containing the exported agent. This field is populated
+     * only if `agent_uri` is specified in [ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest].
+     * 
+ * + * string agent_uri = 1; + * + * @param value The bytes for agentUri to set. + * @return This builder for chaining. + */ + public Builder setAgentUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + agentCase_ = 1; + agent_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Uncompressed raw byte content for agent.
+     * 
+ * + * bytes agent_content = 2; + * + * @return The agentContent. + */ + public com.google.protobuf.ByteString getAgentContent() { + if (agentCase_ == 2) { + return (com.google.protobuf.ByteString) agent_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+     * Uncompressed raw byte content for agent.
+     * 
+ * + * bytes agent_content = 2; + * + * @param value The agentContent to set. + * @return This builder for chaining. + */ + public Builder setAgentContent(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + agentCase_ = 2; + agent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Uncompressed raw byte content for agent.
+     * 
+ * + * bytes agent_content = 2; + * + * @return This builder for chaining. + */ + public Builder clearAgentContent() { + if (agentCase_ == 2) { + agentCase_ = 0; + agent_ = null; + onChanged(); + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportAgentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportAgentResponse(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.dialogflow.cx.v3beta1.ExportAgentResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ExportAgentResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ExportAgentResponseOrBuilder.java new file mode 100644 index 000000000..c3a8774a5 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ExportAgentResponseOrBuilder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ExportAgentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The URI to a file containing the exported agent. This field is populated
+   * only if `agent_uri` is specified in [ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest].
+   * 
+ * + * string agent_uri = 1; + * + * @return The agentUri. + */ + java.lang.String getAgentUri(); + /** + * + * + *
+   * The URI to a file containing the exported agent. This field is populated
+   * only if `agent_uri` is specified in [ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest].
+   * 
+ * + * string agent_uri = 1; + * + * @return The bytes for agentUri. + */ + com.google.protobuf.ByteString getAgentUriBytes(); + + /** + * + * + *
+   * Uncompressed raw byte content for agent.
+   * 
+ * + * bytes agent_content = 2; + * + * @return The agentContent. + */ + com.google.protobuf.ByteString getAgentContent(); + + public com.google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse.AgentCase getAgentCase(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Flow.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Flow.java new file mode 100644 index 000000000..e4ddacffb --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Flow.java @@ -0,0 +1,2814 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Flows represents the conversation flows when you build your chatbot agent.
+ * A flow consists of many pages connected by the transition routes.
+ * Conversations always start with the built-in Start Flow (with an all-0 ID).
+ * Transition routes can direct the conversation session from the current flow
+ * (parent flow) to another flow (sub flow). When the sub flow is finished,
+ * Dialogflow will bring the session back to the parent flow, where the sub flow
+ * is started.
+ * Usually, when a transition route is followed by a matched intent, the intent
+ * will be "consumed". This means the intent won't activate more transition
+ * routes. However, when the followed transition route moves the conversation
+ * session into a different flow, the matched intent can be carried over and to
+ * be consumed in the target flow.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Flow} + */ +public final class Flow extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Flow) + FlowOrBuilder { + private static final long serialVersionUID = 0L; + // Use Flow.newBuilder() to construct. + private Flow(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Flow() { + name_ = ""; + displayName_ = ""; + description_ = ""; + transitionRoutes_ = java.util.Collections.emptyList(); + eventHandlers_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Flow(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Flow( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + transitionRoutes_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute>(); + mutable_bitField0_ |= 0x00000001; + } + transitionRoutes_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.parser(), + extensionRegistry)); + break; + } + case 82: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + eventHandlers_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + eventHandlers_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.parser(), + extensionRegistry)); + break; + } + case 90: + { + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.Builder subBuilder = null; + if (nluSettings_ != null) { + subBuilder = nluSettings_.toBuilder(); + } + nluSettings_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(nluSettings_); + nluSettings_ = 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)) { + transitionRoutes_ = java.util.Collections.unmodifiableList(transitionRoutes_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + eventHandlers_ = java.util.Collections.unmodifiableList(eventHandlers_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Flow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Flow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Flow.class, + com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The unique identifier of the flow.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The unique identifier of the flow.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required. The human-readable name of the flow.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The human-readable name of the flow.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * The description of the flow. The maximum length is 500 characters. If
+   * exceeded, the request is rejected.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The description of the flow. The maximum length is 500 characters. If
+   * exceeded, the request is rejected.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + 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 TRANSITION_ROUTES_FIELD_NUMBER = 4; + private java.util.List transitionRoutes_; + /** + * + * + *
+   * A flow's transition routes serve two purposes:
+   * *   They are responsible for matching the user's first utterances in the
+   * flow.
+   * *   They are inherited by every page's [transition
+   * routes][Page.transition_routes] and can support use cases such as the user
+   * saying "help" or "can I talk to a human?", which can be handled in a common
+   * way regardless of the current page. Transition routes defined in the page
+   * have higher priority than those defined in the flow.
+   * TransitionRoutes are evalauted in the following order:
+   * *   TransitionRoutes with intent specified..
+   * *   TransitionRoutes with only condition specified.
+   * TransitionRoutes with intent specified are inherited by pages in the flow.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + @java.lang.Override + public java.util.List + getTransitionRoutesList() { + return transitionRoutes_; + } + /** + * + * + *
+   * A flow's transition routes serve two purposes:
+   * *   They are responsible for matching the user's first utterances in the
+   * flow.
+   * *   They are inherited by every page's [transition
+   * routes][Page.transition_routes] and can support use cases such as the user
+   * saying "help" or "can I talk to a human?", which can be handled in a common
+   * way regardless of the current page. Transition routes defined in the page
+   * have higher priority than those defined in the flow.
+   * TransitionRoutes are evalauted in the following order:
+   * *   TransitionRoutes with intent specified..
+   * *   TransitionRoutes with only condition specified.
+   * TransitionRoutes with intent specified are inherited by pages in the flow.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + @java.lang.Override + public java.util.List + getTransitionRoutesOrBuilderList() { + return transitionRoutes_; + } + /** + * + * + *
+   * A flow's transition routes serve two purposes:
+   * *   They are responsible for matching the user's first utterances in the
+   * flow.
+   * *   They are inherited by every page's [transition
+   * routes][Page.transition_routes] and can support use cases such as the user
+   * saying "help" or "can I talk to a human?", which can be handled in a common
+   * way regardless of the current page. Transition routes defined in the page
+   * have higher priority than those defined in the flow.
+   * TransitionRoutes are evalauted in the following order:
+   * *   TransitionRoutes with intent specified..
+   * *   TransitionRoutes with only condition specified.
+   * TransitionRoutes with intent specified are inherited by pages in the flow.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + @java.lang.Override + public int getTransitionRoutesCount() { + return transitionRoutes_.size(); + } + /** + * + * + *
+   * A flow's transition routes serve two purposes:
+   * *   They are responsible for matching the user's first utterances in the
+   * flow.
+   * *   They are inherited by every page's [transition
+   * routes][Page.transition_routes] and can support use cases such as the user
+   * saying "help" or "can I talk to a human?", which can be handled in a common
+   * way regardless of the current page. Transition routes defined in the page
+   * have higher priority than those defined in the flow.
+   * TransitionRoutes are evalauted in the following order:
+   * *   TransitionRoutes with intent specified..
+   * *   TransitionRoutes with only condition specified.
+   * TransitionRoutes with intent specified are inherited by pages in the flow.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute getTransitionRoutes(int index) { + return transitionRoutes_.get(index); + } + /** + * + * + *
+   * A flow's transition routes serve two purposes:
+   * *   They are responsible for matching the user's first utterances in the
+   * flow.
+   * *   They are inherited by every page's [transition
+   * routes][Page.transition_routes] and can support use cases such as the user
+   * saying "help" or "can I talk to a human?", which can be handled in a common
+   * way regardless of the current page. Transition routes defined in the page
+   * have higher priority than those defined in the flow.
+   * TransitionRoutes are evalauted in the following order:
+   * *   TransitionRoutes with intent specified..
+   * *   TransitionRoutes with only condition specified.
+   * TransitionRoutes with intent specified are inherited by pages in the flow.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder + getTransitionRoutesOrBuilder(int index) { + return transitionRoutes_.get(index); + } + + public static final int EVENT_HANDLERS_FIELD_NUMBER = 10; + private java.util.List eventHandlers_; + /** + * + * + *
+   * A flow's event handlers serve two purposes:
+   * *   They are responsible for handling events (e.g. no match,
+   * webhook errors) in the flow.
+   * *   They are inherited by every page's [event
+   * handlers][Page.event_handlers], which can be used to handle common events
+   * regardless of the current page. Event handlers defined in the page
+   * have higher priority than those defined in the flow.
+   * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+   * evaluated on a first-match basis. The first one that matches the event
+   * get executed, with the rest being ignored.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + @java.lang.Override + public java.util.List + getEventHandlersList() { + return eventHandlers_; + } + /** + * + * + *
+   * A flow's event handlers serve two purposes:
+   * *   They are responsible for handling events (e.g. no match,
+   * webhook errors) in the flow.
+   * *   They are inherited by every page's [event
+   * handlers][Page.event_handlers], which can be used to handle common events
+   * regardless of the current page. Event handlers defined in the page
+   * have higher priority than those defined in the flow.
+   * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+   * evaluated on a first-match basis. The first one that matches the event
+   * get executed, with the rest being ignored.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + @java.lang.Override + public java.util.List + getEventHandlersOrBuilderList() { + return eventHandlers_; + } + /** + * + * + *
+   * A flow's event handlers serve two purposes:
+   * *   They are responsible for handling events (e.g. no match,
+   * webhook errors) in the flow.
+   * *   They are inherited by every page's [event
+   * handlers][Page.event_handlers], which can be used to handle common events
+   * regardless of the current page. Event handlers defined in the page
+   * have higher priority than those defined in the flow.
+   * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+   * evaluated on a first-match basis. The first one that matches the event
+   * get executed, with the rest being ignored.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + @java.lang.Override + public int getEventHandlersCount() { + return eventHandlers_.size(); + } + /** + * + * + *
+   * A flow's event handlers serve two purposes:
+   * *   They are responsible for handling events (e.g. no match,
+   * webhook errors) in the flow.
+   * *   They are inherited by every page's [event
+   * handlers][Page.event_handlers], which can be used to handle common events
+   * regardless of the current page. Event handlers defined in the page
+   * have higher priority than those defined in the flow.
+   * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+   * evaluated on a first-match basis. The first one that matches the event
+   * get executed, with the rest being ignored.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler getEventHandlers(int index) { + return eventHandlers_.get(index); + } + /** + * + * + *
+   * A flow's event handlers serve two purposes:
+   * *   They are responsible for handling events (e.g. no match,
+   * webhook errors) in the flow.
+   * *   They are inherited by every page's [event
+   * handlers][Page.event_handlers], which can be used to handle common events
+   * regardless of the current page. Event handlers defined in the page
+   * have higher priority than those defined in the flow.
+   * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+   * evaluated on a first-match basis. The first one that matches the event
+   * get executed, with the rest being ignored.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder getEventHandlersOrBuilder( + int index) { + return eventHandlers_.get(index); + } + + public static final int NLU_SETTINGS_FIELD_NUMBER = 11; + private com.google.cloud.dialogflow.cx.v3beta1.NluSettings nluSettings_; + /** + * + * + *
+   * NLU related settings of the flow.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + * + * @return Whether the nluSettings field is set. + */ + @java.lang.Override + public boolean hasNluSettings() { + return nluSettings_ != null; + } + /** + * + * + *
+   * NLU related settings of the flow.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + * + * @return The nluSettings. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.NluSettings getNluSettings() { + return nluSettings_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.NluSettings.getDefaultInstance() + : nluSettings_; + } + /** + * + * + *
+   * NLU related settings of the flow.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.NluSettingsOrBuilder getNluSettingsOrBuilder() { + return getNluSettings(); + } + + 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 (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + for (int i = 0; i < transitionRoutes_.size(); i++) { + output.writeMessage(4, transitionRoutes_.get(i)); + } + for (int i = 0; i < eventHandlers_.size(); i++) { + output.writeMessage(10, eventHandlers_.get(i)); + } + if (nluSettings_ != null) { + output.writeMessage(11, getNluSettings()); + } + 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 (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + for (int i = 0; i < transitionRoutes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, transitionRoutes_.get(i)); + } + for (int i = 0; i < eventHandlers_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, eventHandlers_.get(i)); + } + if (nluSettings_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getNluSettings()); + } + 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.dialogflow.cx.v3beta1.Flow)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Flow other = + (com.google.cloud.dialogflow.cx.v3beta1.Flow) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getTransitionRoutesList().equals(other.getTransitionRoutesList())) return false; + if (!getEventHandlersList().equals(other.getEventHandlersList())) return false; + if (hasNluSettings() != other.hasNluSettings()) return false; + if (hasNluSettings()) { + if (!getNluSettings().equals(other.getNluSettings())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getTransitionRoutesCount() > 0) { + hash = (37 * hash) + TRANSITION_ROUTES_FIELD_NUMBER; + hash = (53 * hash) + getTransitionRoutesList().hashCode(); + } + if (getEventHandlersCount() > 0) { + hash = (37 * hash) + EVENT_HANDLERS_FIELD_NUMBER; + hash = (53 * hash) + getEventHandlersList().hashCode(); + } + if (hasNluSettings()) { + hash = (37 * hash) + NLU_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getNluSettings().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Flow parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Flow 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.dialogflow.cx.v3beta1.Flow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Flow 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.dialogflow.cx.v3beta1.Flow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Flow parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Flow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Flow 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.dialogflow.cx.v3beta1.Flow parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Flow 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.dialogflow.cx.v3beta1.Flow parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Flow 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.dialogflow.cx.v3beta1.Flow 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; + } + /** + * + * + *
+   * Flows represents the conversation flows when you build your chatbot agent.
+   * A flow consists of many pages connected by the transition routes.
+   * Conversations always start with the built-in Start Flow (with an all-0 ID).
+   * Transition routes can direct the conversation session from the current flow
+   * (parent flow) to another flow (sub flow). When the sub flow is finished,
+   * Dialogflow will bring the session back to the parent flow, where the sub flow
+   * is started.
+   * Usually, when a transition route is followed by a matched intent, the intent
+   * will be "consumed". This means the intent won't activate more transition
+   * routes. However, when the followed transition route moves the conversation
+   * session into a different flow, the matched intent can be carried over and to
+   * be consumed in the target flow.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Flow} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Flow) + com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Flow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Flow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Flow.class, + com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.Flow.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTransitionRoutesFieldBuilder(); + getEventHandlersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + description_ = ""; + + if (transitionRoutesBuilder_ == null) { + transitionRoutes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + transitionRoutesBuilder_.clear(); + } + if (eventHandlersBuilder_ == null) { + eventHandlers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + eventHandlersBuilder_.clear(); + } + if (nluSettingsBuilder_ == null) { + nluSettings_ = null; + } else { + nluSettings_ = null; + nluSettingsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Flow_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Flow getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Flow.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Flow build() { + com.google.cloud.dialogflow.cx.v3beta1.Flow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Flow buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Flow result = + new com.google.cloud.dialogflow.cx.v3beta1.Flow(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + result.description_ = description_; + if (transitionRoutesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + transitionRoutes_ = java.util.Collections.unmodifiableList(transitionRoutes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.transitionRoutes_ = transitionRoutes_; + } else { + result.transitionRoutes_ = transitionRoutesBuilder_.build(); + } + if (eventHandlersBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + eventHandlers_ = java.util.Collections.unmodifiableList(eventHandlers_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.eventHandlers_ = eventHandlers_; + } else { + result.eventHandlers_ = eventHandlersBuilder_.build(); + } + if (nluSettingsBuilder_ == null) { + result.nluSettings_ = nluSettings_; + } else { + result.nluSettings_ = nluSettingsBuilder_.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.dialogflow.cx.v3beta1.Flow) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.Flow) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Flow other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.Flow.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (transitionRoutesBuilder_ == null) { + if (!other.transitionRoutes_.isEmpty()) { + if (transitionRoutes_.isEmpty()) { + transitionRoutes_ = other.transitionRoutes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.addAll(other.transitionRoutes_); + } + onChanged(); + } + } else { + if (!other.transitionRoutes_.isEmpty()) { + if (transitionRoutesBuilder_.isEmpty()) { + transitionRoutesBuilder_.dispose(); + transitionRoutesBuilder_ = null; + transitionRoutes_ = other.transitionRoutes_; + bitField0_ = (bitField0_ & ~0x00000001); + transitionRoutesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTransitionRoutesFieldBuilder() + : null; + } else { + transitionRoutesBuilder_.addAllMessages(other.transitionRoutes_); + } + } + } + if (eventHandlersBuilder_ == null) { + if (!other.eventHandlers_.isEmpty()) { + if (eventHandlers_.isEmpty()) { + eventHandlers_ = other.eventHandlers_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureEventHandlersIsMutable(); + eventHandlers_.addAll(other.eventHandlers_); + } + onChanged(); + } + } else { + if (!other.eventHandlers_.isEmpty()) { + if (eventHandlersBuilder_.isEmpty()) { + eventHandlersBuilder_.dispose(); + eventHandlersBuilder_ = null; + eventHandlers_ = other.eventHandlers_; + bitField0_ = (bitField0_ & ~0x00000002); + eventHandlersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEventHandlersFieldBuilder() + : null; + } else { + eventHandlersBuilder_.addAllMessages(other.eventHandlers_); + } + } + } + if (other.hasNluSettings()) { + mergeNluSettings(other.getNluSettings()); + } + 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.dialogflow.cx.v3beta1.Flow parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.dialogflow.cx.v3beta1.Flow) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The unique identifier of the flow.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unique identifier of the flow.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unique identifier of the flow.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the flow.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the flow.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The human-readable name of the flow.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the flow.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the flow.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the flow.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the flow.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * The description of the flow. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @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; + } + } + /** + * + * + *
+     * The description of the flow. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @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; + } + } + /** + * + * + *
+     * The description of the flow. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @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; + } + /** + * + * + *
+     * The description of the flow. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the flow. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @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 java.util.List + transitionRoutes_ = java.util.Collections.emptyList(); + + private void ensureTransitionRoutesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + transitionRoutes_ = + new java.util.ArrayList( + transitionRoutes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder> + transitionRoutesBuilder_; + + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public java.util.List + getTransitionRoutesList() { + if (transitionRoutesBuilder_ == null) { + return java.util.Collections.unmodifiableList(transitionRoutes_); + } else { + return transitionRoutesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public int getTransitionRoutesCount() { + if (transitionRoutesBuilder_ == null) { + return transitionRoutes_.size(); + } else { + return transitionRoutesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute getTransitionRoutes(int index) { + if (transitionRoutesBuilder_ == null) { + return transitionRoutes_.get(index); + } else { + return transitionRoutesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public Builder setTransitionRoutes( + int index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute value) { + if (transitionRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionRoutesIsMutable(); + transitionRoutes_.set(index, value); + onChanged(); + } else { + transitionRoutesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public Builder setTransitionRoutes( + int index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder builderForValue) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.set(index, builderForValue.build()); + onChanged(); + } else { + transitionRoutesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public Builder addTransitionRoutes( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute value) { + if (transitionRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionRoutesIsMutable(); + transitionRoutes_.add(value); + onChanged(); + } else { + transitionRoutesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public Builder addTransitionRoutes( + int index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute value) { + if (transitionRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionRoutesIsMutable(); + transitionRoutes_.add(index, value); + onChanged(); + } else { + transitionRoutesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public Builder addTransitionRoutes( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder builderForValue) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.add(builderForValue.build()); + onChanged(); + } else { + transitionRoutesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public Builder addTransitionRoutes( + int index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder builderForValue) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.add(index, builderForValue.build()); + onChanged(); + } else { + transitionRoutesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public Builder addAllTransitionRoutes( + java.lang.Iterable + values) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, transitionRoutes_); + onChanged(); + } else { + transitionRoutesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public Builder clearTransitionRoutes() { + if (transitionRoutesBuilder_ == null) { + transitionRoutes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + transitionRoutesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public Builder removeTransitionRoutes(int index) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.remove(index); + onChanged(); + } else { + transitionRoutesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder + getTransitionRoutesBuilder(int index) { + return getTransitionRoutesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder + getTransitionRoutesOrBuilder(int index) { + if (transitionRoutesBuilder_ == null) { + return transitionRoutes_.get(index); + } else { + return transitionRoutesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public java.util.List + getTransitionRoutesOrBuilderList() { + if (transitionRoutesBuilder_ != null) { + return transitionRoutesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(transitionRoutes_); + } + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder + addTransitionRoutesBuilder() { + return getTransitionRoutesFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.getDefaultInstance()); + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder + addTransitionRoutesBuilder(int index) { + return getTransitionRoutesFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.getDefaultInstance()); + } + /** + * + * + *
+     * A flow's transition routes serve two purposes:
+     * *   They are responsible for matching the user's first utterances in the
+     * flow.
+     * *   They are inherited by every page's [transition
+     * routes][Page.transition_routes] and can support use cases such as the user
+     * saying "help" or "can I talk to a human?", which can be handled in a common
+     * way regardless of the current page. Transition routes defined in the page
+     * have higher priority than those defined in the flow.
+     * TransitionRoutes are evalauted in the following order:
+     * *   TransitionRoutes with intent specified..
+     * *   TransitionRoutes with only condition specified.
+     * TransitionRoutes with intent specified are inherited by pages in the flow.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + public java.util.List + getTransitionRoutesBuilderList() { + return getTransitionRoutesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder> + getTransitionRoutesFieldBuilder() { + if (transitionRoutesBuilder_ == null) { + transitionRoutesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder>( + transitionRoutes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + transitionRoutes_ = null; + } + return transitionRoutesBuilder_; + } + + private java.util.List eventHandlers_ = + java.util.Collections.emptyList(); + + private void ensureEventHandlersIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + eventHandlers_ = + new java.util.ArrayList( + eventHandlers_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EventHandler, + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder> + eventHandlersBuilder_; + + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public java.util.List + getEventHandlersList() { + if (eventHandlersBuilder_ == null) { + return java.util.Collections.unmodifiableList(eventHandlers_); + } else { + return eventHandlersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public int getEventHandlersCount() { + if (eventHandlersBuilder_ == null) { + return eventHandlers_.size(); + } else { + return eventHandlersBuilder_.getCount(); + } + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler getEventHandlers(int index) { + if (eventHandlersBuilder_ == null) { + return eventHandlers_.get(index); + } else { + return eventHandlersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder setEventHandlers( + int index, com.google.cloud.dialogflow.cx.v3beta1.EventHandler value) { + if (eventHandlersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventHandlersIsMutable(); + eventHandlers_.set(index, value); + onChanged(); + } else { + eventHandlersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder setEventHandlers( + int index, com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder builderForValue) { + if (eventHandlersBuilder_ == null) { + ensureEventHandlersIsMutable(); + eventHandlers_.set(index, builderForValue.build()); + onChanged(); + } else { + eventHandlersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder addEventHandlers(com.google.cloud.dialogflow.cx.v3beta1.EventHandler value) { + if (eventHandlersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventHandlersIsMutable(); + eventHandlers_.add(value); + onChanged(); + } else { + eventHandlersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder addEventHandlers( + int index, com.google.cloud.dialogflow.cx.v3beta1.EventHandler value) { + if (eventHandlersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventHandlersIsMutable(); + eventHandlers_.add(index, value); + onChanged(); + } else { + eventHandlersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder addEventHandlers( + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder builderForValue) { + if (eventHandlersBuilder_ == null) { + ensureEventHandlersIsMutable(); + eventHandlers_.add(builderForValue.build()); + onChanged(); + } else { + eventHandlersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder addEventHandlers( + int index, com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder builderForValue) { + if (eventHandlersBuilder_ == null) { + ensureEventHandlersIsMutable(); + eventHandlers_.add(index, builderForValue.build()); + onChanged(); + } else { + eventHandlersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder addAllEventHandlers( + java.lang.Iterable values) { + if (eventHandlersBuilder_ == null) { + ensureEventHandlersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, eventHandlers_); + onChanged(); + } else { + eventHandlersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder clearEventHandlers() { + if (eventHandlersBuilder_ == null) { + eventHandlers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + eventHandlersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder removeEventHandlers(int index) { + if (eventHandlersBuilder_ == null) { + ensureEventHandlersIsMutable(); + eventHandlers_.remove(index); + onChanged(); + } else { + eventHandlersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder getEventHandlersBuilder( + int index) { + return getEventHandlersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder getEventHandlersOrBuilder( + int index) { + if (eventHandlersBuilder_ == null) { + return eventHandlers_.get(index); + } else { + return eventHandlersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public java.util.List + getEventHandlersOrBuilderList() { + if (eventHandlersBuilder_ != null) { + return eventHandlersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(eventHandlers_); + } + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder addEventHandlersBuilder() { + return getEventHandlersFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.EventHandler.getDefaultInstance()); + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder addEventHandlersBuilder( + int index) { + return getEventHandlersFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.EventHandler.getDefaultInstance()); + } + /** + * + * + *
+     * A flow's event handlers serve two purposes:
+     * *   They are responsible for handling events (e.g. no match,
+     * webhook errors) in the flow.
+     * *   They are inherited by every page's [event
+     * handlers][Page.event_handlers], which can be used to handle common events
+     * regardless of the current page. Event handlers defined in the page
+     * have higher priority than those defined in the flow.
+     * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+     * evaluated on a first-match basis. The first one that matches the event
+     * get executed, with the rest being ignored.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public java.util.List + getEventHandlersBuilderList() { + return getEventHandlersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EventHandler, + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder> + getEventHandlersFieldBuilder() { + if (eventHandlersBuilder_ == null) { + eventHandlersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EventHandler, + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder>( + eventHandlers_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + eventHandlers_ = null; + } + return eventHandlersBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.NluSettings nluSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.NluSettings, + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.Builder, + com.google.cloud.dialogflow.cx.v3beta1.NluSettingsOrBuilder> + nluSettingsBuilder_; + /** + * + * + *
+     * NLU related settings of the flow.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + * + * @return Whether the nluSettings field is set. + */ + public boolean hasNluSettings() { + return nluSettingsBuilder_ != null || nluSettings_ != null; + } + /** + * + * + *
+     * NLU related settings of the flow.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + * + * @return The nluSettings. + */ + public com.google.cloud.dialogflow.cx.v3beta1.NluSettings getNluSettings() { + if (nluSettingsBuilder_ == null) { + return nluSettings_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.NluSettings.getDefaultInstance() + : nluSettings_; + } else { + return nluSettingsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * NLU related settings of the flow.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + */ + public Builder setNluSettings(com.google.cloud.dialogflow.cx.v3beta1.NluSettings value) { + if (nluSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + nluSettings_ = value; + onChanged(); + } else { + nluSettingsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * NLU related settings of the flow.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + */ + public Builder setNluSettings( + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.Builder builderForValue) { + if (nluSettingsBuilder_ == null) { + nluSettings_ = builderForValue.build(); + onChanged(); + } else { + nluSettingsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * NLU related settings of the flow.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + */ + public Builder mergeNluSettings(com.google.cloud.dialogflow.cx.v3beta1.NluSettings value) { + if (nluSettingsBuilder_ == null) { + if (nluSettings_ != null) { + nluSettings_ = + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.newBuilder(nluSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + nluSettings_ = value; + } + onChanged(); + } else { + nluSettingsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * NLU related settings of the flow.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + */ + public Builder clearNluSettings() { + if (nluSettingsBuilder_ == null) { + nluSettings_ = null; + onChanged(); + } else { + nluSettings_ = null; + nluSettingsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * NLU related settings of the flow.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + */ + public com.google.cloud.dialogflow.cx.v3beta1.NluSettings.Builder getNluSettingsBuilder() { + + onChanged(); + return getNluSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * NLU related settings of the flow.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + */ + public com.google.cloud.dialogflow.cx.v3beta1.NluSettingsOrBuilder getNluSettingsOrBuilder() { + if (nluSettingsBuilder_ != null) { + return nluSettingsBuilder_.getMessageOrBuilder(); + } else { + return nluSettings_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.NluSettings.getDefaultInstance() + : nluSettings_; + } + } + /** + * + * + *
+     * NLU related settings of the flow.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.NluSettings, + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.Builder, + com.google.cloud.dialogflow.cx.v3beta1.NluSettingsOrBuilder> + getNluSettingsFieldBuilder() { + if (nluSettingsBuilder_ == null) { + nluSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.NluSettings, + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.Builder, + com.google.cloud.dialogflow.cx.v3beta1.NluSettingsOrBuilder>( + getNluSettings(), getParentForChildren(), isClean()); + nluSettings_ = null; + } + return nluSettingsBuilder_; + } + + @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.dialogflow.cx.v3beta1.Flow) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Flow) + private static final com.google.cloud.dialogflow.cx.v3beta1.Flow DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Flow(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Flow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Flow parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Flow(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.dialogflow.cx.v3beta1.Flow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowName.java new file mode 100644 index 000000000..12cb0199a --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowName.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 FlowName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String agent; + private final String flow; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getFlow() { + return flow; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private FlowName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + flow = Preconditions.checkNotNull(builder.getFlow()); + } + + public static FlowName of(String project, String location, String agent, String flow) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setFlow(flow) + .build(); + } + + public static String format(String project, String location, String agent, String flow) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setFlow(flow) + .build() + .toString(); + } + + public static FlowName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "FlowName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("agent"), + matchMap.get("flow")); + } + + 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 (FlowName 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("agent", agent); + fieldMapBuilder.put("flow", flow); + 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, "agent", agent, "flow", flow); + } + + /** Builder for FlowName. */ + public static class Builder { + + private String project; + private String location; + private String agent; + private String flow; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getFlow() { + return flow; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAgent(String agent) { + this.agent = agent; + return this; + } + + public Builder setFlow(String flow) { + this.flow = flow; + return this; + } + + private Builder() {} + + private Builder(FlowName flowName) { + project = flowName.project; + location = flowName.location; + agent = flowName.agent; + flow = flowName.flow; + } + + public FlowName build() { + return new FlowName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof FlowName) { + FlowName that = (FlowName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.agent.equals(that.agent)) + && (this.flow.equals(that.flow)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= agent.hashCode(); + h *= 1000003; + h ^= flow.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowOrBuilder.java new file mode 100644 index 000000000..1d4f81ae0 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowOrBuilder.java @@ -0,0 +1,351 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface FlowOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Flow) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique identifier of the flow.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The unique identifier of the flow.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The human-readable name of the flow.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The human-readable name of the flow.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The description of the flow. The maximum length is 500 characters. If
+   * exceeded, the request is rejected.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * The description of the flow. The maximum length is 500 characters. If
+   * exceeded, the request is rejected.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * A flow's transition routes serve two purposes:
+   * *   They are responsible for matching the user's first utterances in the
+   * flow.
+   * *   They are inherited by every page's [transition
+   * routes][Page.transition_routes] and can support use cases such as the user
+   * saying "help" or "can I talk to a human?", which can be handled in a common
+   * way regardless of the current page. Transition routes defined in the page
+   * have higher priority than those defined in the flow.
+   * TransitionRoutes are evalauted in the following order:
+   * *   TransitionRoutes with intent specified..
+   * *   TransitionRoutes with only condition specified.
+   * TransitionRoutes with intent specified are inherited by pages in the flow.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + java.util.List getTransitionRoutesList(); + /** + * + * + *
+   * A flow's transition routes serve two purposes:
+   * *   They are responsible for matching the user's first utterances in the
+   * flow.
+   * *   They are inherited by every page's [transition
+   * routes][Page.transition_routes] and can support use cases such as the user
+   * saying "help" or "can I talk to a human?", which can be handled in a common
+   * way regardless of the current page. Transition routes defined in the page
+   * have higher priority than those defined in the flow.
+   * TransitionRoutes are evalauted in the following order:
+   * *   TransitionRoutes with intent specified..
+   * *   TransitionRoutes with only condition specified.
+   * TransitionRoutes with intent specified are inherited by pages in the flow.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute getTransitionRoutes(int index); + /** + * + * + *
+   * A flow's transition routes serve two purposes:
+   * *   They are responsible for matching the user's first utterances in the
+   * flow.
+   * *   They are inherited by every page's [transition
+   * routes][Page.transition_routes] and can support use cases such as the user
+   * saying "help" or "can I talk to a human?", which can be handled in a common
+   * way regardless of the current page. Transition routes defined in the page
+   * have higher priority than those defined in the flow.
+   * TransitionRoutes are evalauted in the following order:
+   * *   TransitionRoutes with intent specified..
+   * *   TransitionRoutes with only condition specified.
+   * TransitionRoutes with intent specified are inherited by pages in the flow.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + int getTransitionRoutesCount(); + /** + * + * + *
+   * A flow's transition routes serve two purposes:
+   * *   They are responsible for matching the user's first utterances in the
+   * flow.
+   * *   They are inherited by every page's [transition
+   * routes][Page.transition_routes] and can support use cases such as the user
+   * saying "help" or "can I talk to a human?", which can be handled in a common
+   * way regardless of the current page. Transition routes defined in the page
+   * have higher priority than those defined in the flow.
+   * TransitionRoutes are evalauted in the following order:
+   * *   TransitionRoutes with intent specified..
+   * *   TransitionRoutes with only condition specified.
+   * TransitionRoutes with intent specified are inherited by pages in the flow.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + java.util.List + getTransitionRoutesOrBuilderList(); + /** + * + * + *
+   * A flow's transition routes serve two purposes:
+   * *   They are responsible for matching the user's first utterances in the
+   * flow.
+   * *   They are inherited by every page's [transition
+   * routes][Page.transition_routes] and can support use cases such as the user
+   * saying "help" or "can I talk to a human?", which can be handled in a common
+   * way regardless of the current page. Transition routes defined in the page
+   * have higher priority than those defined in the flow.
+   * TransitionRoutes are evalauted in the following order:
+   * *   TransitionRoutes with intent specified..
+   * *   TransitionRoutes with only condition specified.
+   * TransitionRoutes with intent specified are inherited by pages in the flow.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 4; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder getTransitionRoutesOrBuilder( + int index); + + /** + * + * + *
+   * A flow's event handlers serve two purposes:
+   * *   They are responsible for handling events (e.g. no match,
+   * webhook errors) in the flow.
+   * *   They are inherited by every page's [event
+   * handlers][Page.event_handlers], which can be used to handle common events
+   * regardless of the current page. Event handlers defined in the page
+   * have higher priority than those defined in the flow.
+   * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+   * evaluated on a first-match basis. The first one that matches the event
+   * get executed, with the rest being ignored.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + java.util.List getEventHandlersList(); + /** + * + * + *
+   * A flow's event handlers serve two purposes:
+   * *   They are responsible for handling events (e.g. no match,
+   * webhook errors) in the flow.
+   * *   They are inherited by every page's [event
+   * handlers][Page.event_handlers], which can be used to handle common events
+   * regardless of the current page. Event handlers defined in the page
+   * have higher priority than those defined in the flow.
+   * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+   * evaluated on a first-match basis. The first one that matches the event
+   * get executed, with the rest being ignored.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + com.google.cloud.dialogflow.cx.v3beta1.EventHandler getEventHandlers(int index); + /** + * + * + *
+   * A flow's event handlers serve two purposes:
+   * *   They are responsible for handling events (e.g. no match,
+   * webhook errors) in the flow.
+   * *   They are inherited by every page's [event
+   * handlers][Page.event_handlers], which can be used to handle common events
+   * regardless of the current page. Event handlers defined in the page
+   * have higher priority than those defined in the flow.
+   * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+   * evaluated on a first-match basis. The first one that matches the event
+   * get executed, with the rest being ignored.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + int getEventHandlersCount(); + /** + * + * + *
+   * A flow's event handlers serve two purposes:
+   * *   They are responsible for handling events (e.g. no match,
+   * webhook errors) in the flow.
+   * *   They are inherited by every page's [event
+   * handlers][Page.event_handlers], which can be used to handle common events
+   * regardless of the current page. Event handlers defined in the page
+   * have higher priority than those defined in the flow.
+   * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+   * evaluated on a first-match basis. The first one that matches the event
+   * get executed, with the rest being ignored.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + java.util.List + getEventHandlersOrBuilderList(); + /** + * + * + *
+   * A flow's event handlers serve two purposes:
+   * *   They are responsible for handling events (e.g. no match,
+   * webhook errors) in the flow.
+   * *   They are inherited by every page's [event
+   * handlers][Page.event_handlers], which can be used to handle common events
+   * regardless of the current page. Event handlers defined in the page
+   * have higher priority than those defined in the flow.
+   * Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
+   * evaluated on a first-match basis. The first one that matches the event
+   * get executed, with the rest being ignored.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder getEventHandlersOrBuilder(int index); + + /** + * + * + *
+   * NLU related settings of the flow.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + * + * @return Whether the nluSettings field is set. + */ + boolean hasNluSettings(); + /** + * + * + *
+   * NLU related settings of the flow.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + * + * @return The nluSettings. + */ + com.google.cloud.dialogflow.cx.v3beta1.NluSettings getNluSettings(); + /** + * + * + *
+   * NLU related settings of the flow.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 11; + */ + com.google.cloud.dialogflow.cx.v3beta1.NluSettingsOrBuilder getNluSettingsOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowProto.java new file mode 100644 index 000000000..658336130 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowProto.java @@ -0,0 +1,278 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class FlowProto { + private FlowProto() {} + + 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_dialogflow_cx_v3beta1_NluSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_NluSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Flow_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Flow_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateFlowRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateFlowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteFlowRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteFlowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListFlowsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListFlowsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListFlowsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListFlowsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_GetFlowRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_GetFlowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateFlowRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateFlowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_TrainFlowRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_TrainFlowRequest_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/dialogflow/cx/v3beta1/flo" + + "w.proto\022\"google.cloud.dialogflow.cx.v3be" + + "ta1\032\034google/api/annotations.proto\032\027googl" + + "e/api/client.proto\032\037google/api/field_beh" + + "avior.proto\032\031google/api/resource.proto\032-" + + "google/cloud/dialogflow/cx/v3beta1/page." + + "proto\032#google/longrunning/operations.pro" + + "to\032\033google/protobuf/empty.proto\032 google/" + + "protobuf/field_mask.proto\"\362\003\n\013NluSetting" + + "s\022M\n\nmodel_type\030\001 \001(\01629.google.cloud.dia" + + "logflow.cx.v3beta1.NluSettings.ModelType" + + "\022 \n\030classification_threshold\030\003 \001(\002\022^\n\023mo" + + "del_training_mode\030\004 \001(\0162A.google.cloud.d" + + "ialogflow.cx.v3beta1.NluSettings.ModelTr" + + "ainingMode\022#\n\027enable_spell_correction\030\005 " + + "\001(\010B\002\030\001\"p\n\tModelType\022\032\n\026MODEL_TYPE_UNSPE" + + "CIFIED\020\000\022\027\n\023MODEL_TYPE_STANDARD\020\001\022\025\n\021MOD" + + "EL_TYPE_CUSTOM\020\002\022\027\n\023MODEL_TYPE_ADVANCED\020" + + "\003\"{\n\021ModelTrainingMode\022#\n\037MODEL_TRAINING" + + "_MODE_UNSPECIFIED\020\000\022!\n\035MODEL_TRAINING_MO" + + "DE_AUTOMATIC\020\001\022\036\n\032MODEL_TRAINING_MODE_MA" + + "NUAL\020\002\"\217\003\n\004Flow\022\014\n\004name\030\001 \001(\t\022\031\n\014display" + + "_name\030\002 \001(\tB\003\340A\002\022\023\n\013description\030\003 \001(\t\022N\n" + + "\021transition_routes\030\004 \003(\01323.google.cloud." + + "dialogflow.cx.v3beta1.TransitionRoute\022H\n" + + "\016event_handlers\030\n \003(\01320.google.cloud.dia" + + "logflow.cx.v3beta1.EventHandler\022E\n\014nlu_s" + + "ettings\030\013 \001(\0132/.google.cloud.dialogflow." + + "cx.v3beta1.NluSettings:h\352Ae\n\036dialogflow." + + "googleapis.com/Flow\022Cprojects/{project}/" + + "locations/{location}/agents/{agent}/flow" + + "s/{flow}\"\237\001\n\021CreateFlowRequest\0226\n\006parent" + + "\030\001 \001(\tB&\340A\002\372A \022\036dialogflow.googleapis.co" + + "m/Flow\022;\n\004flow\030\002 \001(\0132(.google.cloud.dial" + + "ogflow.cx.v3beta1.FlowB\003\340A\002\022\025\n\rlanguage_" + + "code\030\003 \001(\t\"X\n\021DeleteFlowRequest\0224\n\004name\030" + + "\001 \001(\tB&\340A\002\372A \n\036dialogflow.googleapis.com" + + "/Flow\022\r\n\005force\030\002 \001(\010\"\210\001\n\020ListFlowsReques" + + "t\0226\n\006parent\030\001 \001(\tB&\340A\002\372A \022\036dialogflow.go" + + "ogleapis.com/Flow\022\021\n\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\022\025\n\rlanguage_code\030\004 \001(\t\"" + + "e\n\021ListFlowsResponse\0227\n\005flows\030\001 \003(\0132(.go" + + "ogle.cloud.dialogflow.cx.v3beta1.Flow\022\027\n" + + "\017next_page_token\030\002 \001(\t\"]\n\016GetFlowRequest" + + "\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036dialogflow.googl" + + "eapis.com/Flow\022\025\n\rlanguage_code\030\002 \001(\t\"\235\001" + + "\n\021UpdateFlowRequest\022;\n\004flow\030\001 \001(\0132(.goog" + + "le.cloud.dialogflow.cx.v3beta1.FlowB\003\340A\002" + + "\0224\n\013update_mask\030\002 \001(\0132\032.google.protobuf." + + "FieldMaskB\003\340A\002\022\025\n\rlanguage_code\030\003 \001(\t\"H\n" + + "\020TrainFlowRequest\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n" + + "\036dialogflow.googleapis.com/Flow2\231\n\n\005Flow" + + "s\022\302\001\n\nCreateFlow\0225.google.cloud.dialogfl" + + "ow.cx.v3beta1.CreateFlowRequest\032(.google" + + ".cloud.dialogflow.cx.v3beta1.Flow\"S\202\323\344\223\002" + + "?\"7/v3beta1/{parent=projects/*/locations" + + "/*/agents/*}/flows:\004flow\332A\013parent,flow\022\243" + + "\001\n\nDeleteFlow\0225.google.cloud.dialogflow." + + "cx.v3beta1.DeleteFlowRequest\032\026.google.pr" + + "otobuf.Empty\"F\202\323\344\223\0029*7/v3beta1/{name=pro" + + "jects/*/locations/*/agents/*/flows/*}\332A\004" + + "name\022\302\001\n\tListFlows\0224.google.cloud.dialog" + + "flow.cx.v3beta1.ListFlowsRequest\0325.googl" + + "e.cloud.dialogflow.cx.v3beta1.ListFlowsR" + + "esponse\"H\202\323\344\223\0029\0227/v3beta1/{parent=projec" + + "ts/*/locations/*/agents/*}/flows\332A\006paren" + + "t\022\257\001\n\007GetFlow\0222.google.cloud.dialogflow." + + "cx.v3beta1.GetFlowRequest\032(.google.cloud" + + ".dialogflow.cx.v3beta1.Flow\"F\202\323\344\223\0029\0227/v3" + + "beta1/{name=projects/*/locations/*/agent" + + "s/*/flows/*}\332A\004name\022\314\001\n\nUpdateFlow\0225.goo" + + "gle.cloud.dialogflow.cx.v3beta1.UpdateFl" + + "owRequest\032(.google.cloud.dialogflow.cx.v" + + "3beta1.Flow\"]\202\323\344\223\002D2 + * A form is a data model that groups related parameters that can be collected + * from the user. The process in which the agent prompts the user and collects + * parameter values from the user is called form filling. A form can be added to + * a [page][google.cloud.dialogflow.cx.v3beta1.Page]. When form filling is done, the filled parameters will be + * written to the [session][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters]. + * + * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Form} + */ +public final class Form extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Form) + FormOrBuilder { + private static final long serialVersionUID = 0L; + // Use Form.newBuilder() to construct. + private Form(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Form() { + parameters_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Form(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Form( + 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)) { + parameters_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter>(); + mutable_bitField0_ |= 0x00000001; + } + parameters_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.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)) { + parameters_ = java.util.Collections.unmodifiableList(parameters_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Form.class, + com.google.cloud.dialogflow.cx.v3beta1.Form.Builder.class); + } + + public interface ParameterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Form.Parameter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The human-readable name of the parameter, unique within the
+     * form.
+     * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+     * Required. The human-readable name of the parameter, unique within the
+     * form.
+     * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+     * Indicates whether the parameter is required. Optional parameters will not
+     * trigger prompts; however, they are filled if the user specifies them.
+     * Required parameters must be filled before form filling concludes.
+     * 
+ * + * bool required = 2; + * + * @return The required. + */ + boolean getRequired(); + + /** + * + * + *
+     * Required. The entity type of the parameter.
+     * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+     * ID>` for system entity types (for example,
+     * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+     * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+     * 
+ * + * + * string entity_type = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The entityType. + */ + java.lang.String getEntityType(); + /** + * + * + *
+     * Required. The entity type of the parameter.
+     * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+     * ID>` for system entity types (for example,
+     * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+     * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+     * 
+ * + * + * string entity_type = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for entityType. + */ + com.google.protobuf.ByteString getEntityTypeBytes(); + + /** + * + * + *
+     * Indicates whether the parameter represents a list of values.
+     * 
+ * + * bool is_list = 4; + * + * @return The isList. + */ + boolean getIsList(); + + /** + * + * + *
+     * Required. Defines fill behavior for the parameter.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the fillBehavior field is set. + */ + boolean hasFillBehavior(); + /** + * + * + *
+     * Required. Defines fill behavior for the parameter.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The fillBehavior. + */ + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior getFillBehavior(); + /** + * + * + *
+     * Required. Defines fill behavior for the parameter.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehaviorOrBuilder + getFillBehaviorOrBuilder(); + + /** + * + * + *
+     * The default value of an optional parameter. If the parameter is required,
+     * the default value will be ignored.
+     * 
+ * + * .google.protobuf.Value default_value = 9; + * + * @return Whether the defaultValue field is set. + */ + boolean hasDefaultValue(); + /** + * + * + *
+     * The default value of an optional parameter. If the parameter is required,
+     * the default value will be ignored.
+     * 
+ * + * .google.protobuf.Value default_value = 9; + * + * @return The defaultValue. + */ + com.google.protobuf.Value getDefaultValue(); + /** + * + * + *
+     * The default value of an optional parameter. If the parameter is required,
+     * the default value will be ignored.
+     * 
+ * + * .google.protobuf.Value default_value = 9; + */ + com.google.protobuf.ValueOrBuilder getDefaultValueOrBuilder(); + } + /** + * + * + *
+   * Represents a form parameter.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Form.Parameter} + */ + public static final class Parameter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Form.Parameter) + ParameterOrBuilder { + private static final long serialVersionUID = 0L; + // Use Parameter.newBuilder() to construct. + private Parameter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Parameter() { + displayName_ = ""; + entityType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Parameter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Parameter( + 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(); + + displayName_ = s; + break; + } + case 16: + { + required_ = input.readBool(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + entityType_ = s; + break; + } + case 32: + { + isList_ = input.readBool(); + break; + } + case 58: + { + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.Builder + subBuilder = null; + if (fillBehavior_ != null) { + subBuilder = fillBehavior_.toBuilder(); + } + fillBehavior_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fillBehavior_); + fillBehavior_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + com.google.protobuf.Value.Builder subBuilder = null; + if (defaultValue_ != null) { + subBuilder = defaultValue_.toBuilder(); + } + defaultValue_ = + input.readMessage(com.google.protobuf.Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(defaultValue_); + defaultValue_ = 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.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.class, + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.Builder.class); + } + + public interface FillBehaviorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Required. The fulfillment to provide the initial prompt that the agent
+       * can present to the user in order to fill the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the initialPromptFulfillment field is set. + */ + boolean hasInitialPromptFulfillment(); + /** + * + * + *
+       * Required. The fulfillment to provide the initial prompt that the agent
+       * can present to the user in order to fill the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The initialPromptFulfillment. + */ + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment getInitialPromptFulfillment(); + /** + * + * + *
+       * Required. The fulfillment to provide the initial prompt that the agent
+       * can present to the user in order to fill the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder + getInitialPromptFulfillmentOrBuilder(); + + /** + * + * + *
+       * The handlers for parameter-level events, used to provide reprompt for
+       * the parameter or transition to a different page/flow. The supported
+       * events are:
+       * *   `sys.no-match-<N>`, where N can be from 1 to 6
+       * *   `sys.no-match-default`
+       * *   `sys.no-input-<N>`, where N can be from 1 to 6
+       * *   `sys.no-input-default`
+       * *   `sys.invalid-parameter`
+       * `initial_prompt_fulfillment` provides the first prompt for the
+       * parameter.
+       * If the user's response does not fill the parameter, a
+       * no-match/no-input event will be triggered, and the fulfillment
+       * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+       * defined) will be called to provide a prompt. The
+       * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+       * the next no-match/no-input event, and so on.
+       * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+       * to handle all following no-match/no-input events after all numbered
+       * no-match/no-input handlers for the parameter are consumed.
+       * A `sys.invalid-parameter` handler can be defined to handle the case
+       * where the parameter values have been `invalidated` by webhook. For
+       * example, if the user's response fill the parameter, however the
+       * parameter was invalidated by webhook, the fulfillment associated with
+       * the `sys.invalid-parameter` handler (if defined) will be called to
+       * provide a prompt.
+       * If the event handler for the corresponding event can't be found on the
+       * parameter, `initial_prompt_fulfillment` will be re-prompted.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + java.util.List + getRepromptEventHandlersList(); + /** + * + * + *
+       * The handlers for parameter-level events, used to provide reprompt for
+       * the parameter or transition to a different page/flow. The supported
+       * events are:
+       * *   `sys.no-match-<N>`, where N can be from 1 to 6
+       * *   `sys.no-match-default`
+       * *   `sys.no-input-<N>`, where N can be from 1 to 6
+       * *   `sys.no-input-default`
+       * *   `sys.invalid-parameter`
+       * `initial_prompt_fulfillment` provides the first prompt for the
+       * parameter.
+       * If the user's response does not fill the parameter, a
+       * no-match/no-input event will be triggered, and the fulfillment
+       * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+       * defined) will be called to provide a prompt. The
+       * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+       * the next no-match/no-input event, and so on.
+       * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+       * to handle all following no-match/no-input events after all numbered
+       * no-match/no-input handlers for the parameter are consumed.
+       * A `sys.invalid-parameter` handler can be defined to handle the case
+       * where the parameter values have been `invalidated` by webhook. For
+       * example, if the user's response fill the parameter, however the
+       * parameter was invalidated by webhook, the fulfillment associated with
+       * the `sys.invalid-parameter` handler (if defined) will be called to
+       * provide a prompt.
+       * If the event handler for the corresponding event can't be found on the
+       * parameter, `initial_prompt_fulfillment` will be re-prompted.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.EventHandler getRepromptEventHandlers(int index); + /** + * + * + *
+       * The handlers for parameter-level events, used to provide reprompt for
+       * the parameter or transition to a different page/flow. The supported
+       * events are:
+       * *   `sys.no-match-<N>`, where N can be from 1 to 6
+       * *   `sys.no-match-default`
+       * *   `sys.no-input-<N>`, where N can be from 1 to 6
+       * *   `sys.no-input-default`
+       * *   `sys.invalid-parameter`
+       * `initial_prompt_fulfillment` provides the first prompt for the
+       * parameter.
+       * If the user's response does not fill the parameter, a
+       * no-match/no-input event will be triggered, and the fulfillment
+       * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+       * defined) will be called to provide a prompt. The
+       * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+       * the next no-match/no-input event, and so on.
+       * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+       * to handle all following no-match/no-input events after all numbered
+       * no-match/no-input handlers for the parameter are consumed.
+       * A `sys.invalid-parameter` handler can be defined to handle the case
+       * where the parameter values have been `invalidated` by webhook. For
+       * example, if the user's response fill the parameter, however the
+       * parameter was invalidated by webhook, the fulfillment associated with
+       * the `sys.invalid-parameter` handler (if defined) will be called to
+       * provide a prompt.
+       * If the event handler for the corresponding event can't be found on the
+       * parameter, `initial_prompt_fulfillment` will be re-prompted.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + int getRepromptEventHandlersCount(); + /** + * + * + *
+       * The handlers for parameter-level events, used to provide reprompt for
+       * the parameter or transition to a different page/flow. The supported
+       * events are:
+       * *   `sys.no-match-<N>`, where N can be from 1 to 6
+       * *   `sys.no-match-default`
+       * *   `sys.no-input-<N>`, where N can be from 1 to 6
+       * *   `sys.no-input-default`
+       * *   `sys.invalid-parameter`
+       * `initial_prompt_fulfillment` provides the first prompt for the
+       * parameter.
+       * If the user's response does not fill the parameter, a
+       * no-match/no-input event will be triggered, and the fulfillment
+       * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+       * defined) will be called to provide a prompt. The
+       * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+       * the next no-match/no-input event, and so on.
+       * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+       * to handle all following no-match/no-input events after all numbered
+       * no-match/no-input handlers for the parameter are consumed.
+       * A `sys.invalid-parameter` handler can be defined to handle the case
+       * where the parameter values have been `invalidated` by webhook. For
+       * example, if the user's response fill the parameter, however the
+       * parameter was invalidated by webhook, the fulfillment associated with
+       * the `sys.invalid-parameter` handler (if defined) will be called to
+       * provide a prompt.
+       * If the event handler for the corresponding event can't be found on the
+       * parameter, `initial_prompt_fulfillment` will be re-prompted.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + java.util.List + getRepromptEventHandlersOrBuilderList(); + /** + * + * + *
+       * The handlers for parameter-level events, used to provide reprompt for
+       * the parameter or transition to a different page/flow. The supported
+       * events are:
+       * *   `sys.no-match-<N>`, where N can be from 1 to 6
+       * *   `sys.no-match-default`
+       * *   `sys.no-input-<N>`, where N can be from 1 to 6
+       * *   `sys.no-input-default`
+       * *   `sys.invalid-parameter`
+       * `initial_prompt_fulfillment` provides the first prompt for the
+       * parameter.
+       * If the user's response does not fill the parameter, a
+       * no-match/no-input event will be triggered, and the fulfillment
+       * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+       * defined) will be called to provide a prompt. The
+       * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+       * the next no-match/no-input event, and so on.
+       * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+       * to handle all following no-match/no-input events after all numbered
+       * no-match/no-input handlers for the parameter are consumed.
+       * A `sys.invalid-parameter` handler can be defined to handle the case
+       * where the parameter values have been `invalidated` by webhook. For
+       * example, if the user's response fill the parameter, however the
+       * parameter was invalidated by webhook, the fulfillment associated with
+       * the `sys.invalid-parameter` handler (if defined) will be called to
+       * provide a prompt.
+       * If the event handler for the corresponding event can't be found on the
+       * parameter, `initial_prompt_fulfillment` will be re-prompted.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder + getRepromptEventHandlersOrBuilder(int index); + } + /** + * + * + *
+     * Configuration for how the filling of a parameter should be handled.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior} + */ + public static final class FillBehavior extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior) + FillBehaviorOrBuilder { + private static final long serialVersionUID = 0L; + // Use FillBehavior.newBuilder() to construct. + private FillBehavior(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FillBehavior() { + repromptEventHandlers_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FillBehavior(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FillBehavior( + 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 26: + { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder subBuilder = null; + if (initialPromptFulfillment_ != null) { + subBuilder = initialPromptFulfillment_.toBuilder(); + } + initialPromptFulfillment_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(initialPromptFulfillment_); + initialPromptFulfillment_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + repromptEventHandlers_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.EventHandler>(); + mutable_bitField0_ |= 0x00000001; + } + repromptEventHandlers_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.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)) { + repromptEventHandlers_ = java.util.Collections.unmodifiableList(repromptEventHandlers_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_FillBehavior_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_FillBehavior_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.class, + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.Builder.class); + } + + public static final int INITIAL_PROMPT_FULFILLMENT_FIELD_NUMBER = 3; + private com.google.cloud.dialogflow.cx.v3beta1.Fulfillment initialPromptFulfillment_; + /** + * + * + *
+       * Required. The fulfillment to provide the initial prompt that the agent
+       * can present to the user in order to fill the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the initialPromptFulfillment field is set. + */ + @java.lang.Override + public boolean hasInitialPromptFulfillment() { + return initialPromptFulfillment_ != null; + } + /** + * + * + *
+       * Required. The fulfillment to provide the initial prompt that the agent
+       * can present to the user in order to fill the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The initialPromptFulfillment. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment getInitialPromptFulfillment() { + return initialPromptFulfillment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.getDefaultInstance() + : initialPromptFulfillment_; + } + /** + * + * + *
+       * Required. The fulfillment to provide the initial prompt that the agent
+       * can present to the user in order to fill the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder + getInitialPromptFulfillmentOrBuilder() { + return getInitialPromptFulfillment(); + } + + public static final int REPROMPT_EVENT_HANDLERS_FIELD_NUMBER = 5; + private java.util.List + repromptEventHandlers_; + /** + * + * + *
+       * The handlers for parameter-level events, used to provide reprompt for
+       * the parameter or transition to a different page/flow. The supported
+       * events are:
+       * *   `sys.no-match-<N>`, where N can be from 1 to 6
+       * *   `sys.no-match-default`
+       * *   `sys.no-input-<N>`, where N can be from 1 to 6
+       * *   `sys.no-input-default`
+       * *   `sys.invalid-parameter`
+       * `initial_prompt_fulfillment` provides the first prompt for the
+       * parameter.
+       * If the user's response does not fill the parameter, a
+       * no-match/no-input event will be triggered, and the fulfillment
+       * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+       * defined) will be called to provide a prompt. The
+       * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+       * the next no-match/no-input event, and so on.
+       * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+       * to handle all following no-match/no-input events after all numbered
+       * no-match/no-input handlers for the parameter are consumed.
+       * A `sys.invalid-parameter` handler can be defined to handle the case
+       * where the parameter values have been `invalidated` by webhook. For
+       * example, if the user's response fill the parameter, however the
+       * parameter was invalidated by webhook, the fulfillment associated with
+       * the `sys.invalid-parameter` handler (if defined) will be called to
+       * provide a prompt.
+       * If the event handler for the corresponding event can't be found on the
+       * parameter, `initial_prompt_fulfillment` will be re-prompted.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + @java.lang.Override + public java.util.List + getRepromptEventHandlersList() { + return repromptEventHandlers_; + } + /** + * + * + *
+       * The handlers for parameter-level events, used to provide reprompt for
+       * the parameter or transition to a different page/flow. The supported
+       * events are:
+       * *   `sys.no-match-<N>`, where N can be from 1 to 6
+       * *   `sys.no-match-default`
+       * *   `sys.no-input-<N>`, where N can be from 1 to 6
+       * *   `sys.no-input-default`
+       * *   `sys.invalid-parameter`
+       * `initial_prompt_fulfillment` provides the first prompt for the
+       * parameter.
+       * If the user's response does not fill the parameter, a
+       * no-match/no-input event will be triggered, and the fulfillment
+       * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+       * defined) will be called to provide a prompt. The
+       * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+       * the next no-match/no-input event, and so on.
+       * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+       * to handle all following no-match/no-input events after all numbered
+       * no-match/no-input handlers for the parameter are consumed.
+       * A `sys.invalid-parameter` handler can be defined to handle the case
+       * where the parameter values have been `invalidated` by webhook. For
+       * example, if the user's response fill the parameter, however the
+       * parameter was invalidated by webhook, the fulfillment associated with
+       * the `sys.invalid-parameter` handler (if defined) will be called to
+       * provide a prompt.
+       * If the event handler for the corresponding event can't be found on the
+       * parameter, `initial_prompt_fulfillment` will be re-prompted.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + @java.lang.Override + public java.util.List + getRepromptEventHandlersOrBuilderList() { + return repromptEventHandlers_; + } + /** + * + * + *
+       * The handlers for parameter-level events, used to provide reprompt for
+       * the parameter or transition to a different page/flow. The supported
+       * events are:
+       * *   `sys.no-match-<N>`, where N can be from 1 to 6
+       * *   `sys.no-match-default`
+       * *   `sys.no-input-<N>`, where N can be from 1 to 6
+       * *   `sys.no-input-default`
+       * *   `sys.invalid-parameter`
+       * `initial_prompt_fulfillment` provides the first prompt for the
+       * parameter.
+       * If the user's response does not fill the parameter, a
+       * no-match/no-input event will be triggered, and the fulfillment
+       * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+       * defined) will be called to provide a prompt. The
+       * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+       * the next no-match/no-input event, and so on.
+       * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+       * to handle all following no-match/no-input events after all numbered
+       * no-match/no-input handlers for the parameter are consumed.
+       * A `sys.invalid-parameter` handler can be defined to handle the case
+       * where the parameter values have been `invalidated` by webhook. For
+       * example, if the user's response fill the parameter, however the
+       * parameter was invalidated by webhook, the fulfillment associated with
+       * the `sys.invalid-parameter` handler (if defined) will be called to
+       * provide a prompt.
+       * If the event handler for the corresponding event can't be found on the
+       * parameter, `initial_prompt_fulfillment` will be re-prompted.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + @java.lang.Override + public int getRepromptEventHandlersCount() { + return repromptEventHandlers_.size(); + } + /** + * + * + *
+       * The handlers for parameter-level events, used to provide reprompt for
+       * the parameter or transition to a different page/flow. The supported
+       * events are:
+       * *   `sys.no-match-<N>`, where N can be from 1 to 6
+       * *   `sys.no-match-default`
+       * *   `sys.no-input-<N>`, where N can be from 1 to 6
+       * *   `sys.no-input-default`
+       * *   `sys.invalid-parameter`
+       * `initial_prompt_fulfillment` provides the first prompt for the
+       * parameter.
+       * If the user's response does not fill the parameter, a
+       * no-match/no-input event will be triggered, and the fulfillment
+       * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+       * defined) will be called to provide a prompt. The
+       * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+       * the next no-match/no-input event, and so on.
+       * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+       * to handle all following no-match/no-input events after all numbered
+       * no-match/no-input handlers for the parameter are consumed.
+       * A `sys.invalid-parameter` handler can be defined to handle the case
+       * where the parameter values have been `invalidated` by webhook. For
+       * example, if the user's response fill the parameter, however the
+       * parameter was invalidated by webhook, the fulfillment associated with
+       * the `sys.invalid-parameter` handler (if defined) will be called to
+       * provide a prompt.
+       * If the event handler for the corresponding event can't be found on the
+       * parameter, `initial_prompt_fulfillment` will be re-prompted.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler getRepromptEventHandlers( + int index) { + return repromptEventHandlers_.get(index); + } + /** + * + * + *
+       * The handlers for parameter-level events, used to provide reprompt for
+       * the parameter or transition to a different page/flow. The supported
+       * events are:
+       * *   `sys.no-match-<N>`, where N can be from 1 to 6
+       * *   `sys.no-match-default`
+       * *   `sys.no-input-<N>`, where N can be from 1 to 6
+       * *   `sys.no-input-default`
+       * *   `sys.invalid-parameter`
+       * `initial_prompt_fulfillment` provides the first prompt for the
+       * parameter.
+       * If the user's response does not fill the parameter, a
+       * no-match/no-input event will be triggered, and the fulfillment
+       * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+       * defined) will be called to provide a prompt. The
+       * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+       * the next no-match/no-input event, and so on.
+       * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+       * to handle all following no-match/no-input events after all numbered
+       * no-match/no-input handlers for the parameter are consumed.
+       * A `sys.invalid-parameter` handler can be defined to handle the case
+       * where the parameter values have been `invalidated` by webhook. For
+       * example, if the user's response fill the parameter, however the
+       * parameter was invalidated by webhook, the fulfillment associated with
+       * the `sys.invalid-parameter` handler (if defined) will be called to
+       * provide a prompt.
+       * If the event handler for the corresponding event can't be found on the
+       * parameter, `initial_prompt_fulfillment` will be re-prompted.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder + getRepromptEventHandlersOrBuilder(int index) { + return repromptEventHandlers_.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 (initialPromptFulfillment_ != null) { + output.writeMessage(3, getInitialPromptFulfillment()); + } + for (int i = 0; i < repromptEventHandlers_.size(); i++) { + output.writeMessage(5, repromptEventHandlers_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (initialPromptFulfillment_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, getInitialPromptFulfillment()); + } + for (int i = 0; i < repromptEventHandlers_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, repromptEventHandlers_.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.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior other = + (com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior) obj; + + if (hasInitialPromptFulfillment() != other.hasInitialPromptFulfillment()) return false; + if (hasInitialPromptFulfillment()) { + if (!getInitialPromptFulfillment().equals(other.getInitialPromptFulfillment())) + return false; + } + if (!getRepromptEventHandlersList().equals(other.getRepromptEventHandlersList())) + 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 (hasInitialPromptFulfillment()) { + hash = (37 * hash) + INITIAL_PROMPT_FULFILLMENT_FIELD_NUMBER; + hash = (53 * hash) + getInitialPromptFulfillment().hashCode(); + } + if (getRepromptEventHandlersCount() > 0) { + hash = (37 * hash) + REPROMPT_EVENT_HANDLERS_FIELD_NUMBER; + hash = (53 * hash) + getRepromptEventHandlersList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior 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.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior 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.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior 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.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + 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.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior 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.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior 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 for how the filling of a parameter should be handled.
+       * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior) + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehaviorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_FillBehavior_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_FillBehavior_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.class, + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRepromptEventHandlersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (initialPromptFulfillmentBuilder_ == null) { + initialPromptFulfillment_ = null; + } else { + initialPromptFulfillment_ = null; + initialPromptFulfillmentBuilder_ = null; + } + if (repromptEventHandlersBuilder_ == null) { + repromptEventHandlers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + repromptEventHandlersBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_FillBehavior_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior build() { + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior result = + new com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior(this); + int from_bitField0_ = bitField0_; + if (initialPromptFulfillmentBuilder_ == null) { + result.initialPromptFulfillment_ = initialPromptFulfillment_; + } else { + result.initialPromptFulfillment_ = initialPromptFulfillmentBuilder_.build(); + } + if (repromptEventHandlersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + repromptEventHandlers_ = + java.util.Collections.unmodifiableList(repromptEventHandlers_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.repromptEventHandlers_ = repromptEventHandlers_; + } else { + result.repromptEventHandlers_ = repromptEventHandlersBuilder_.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.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + .getDefaultInstance()) return this; + if (other.hasInitialPromptFulfillment()) { + mergeInitialPromptFulfillment(other.getInitialPromptFulfillment()); + } + if (repromptEventHandlersBuilder_ == null) { + if (!other.repromptEventHandlers_.isEmpty()) { + if (repromptEventHandlers_.isEmpty()) { + repromptEventHandlers_ = other.repromptEventHandlers_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRepromptEventHandlersIsMutable(); + repromptEventHandlers_.addAll(other.repromptEventHandlers_); + } + onChanged(); + } + } else { + if (!other.repromptEventHandlers_.isEmpty()) { + if (repromptEventHandlersBuilder_.isEmpty()) { + repromptEventHandlersBuilder_.dispose(); + repromptEventHandlersBuilder_ = null; + repromptEventHandlers_ = other.repromptEventHandlers_; + bitField0_ = (bitField0_ & ~0x00000001); + repromptEventHandlersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRepromptEventHandlersFieldBuilder() + : null; + } else { + repromptEventHandlersBuilder_.addAllMessages(other.repromptEventHandlers_); + } + } + } + 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.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.dialogflow.cx.v3beta1.Fulfillment initialPromptFulfillment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder> + initialPromptFulfillmentBuilder_; + /** + * + * + *
+         * Required. The fulfillment to provide the initial prompt that the agent
+         * can present to the user in order to fill the parameter.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the initialPromptFulfillment field is set. + */ + public boolean hasInitialPromptFulfillment() { + return initialPromptFulfillmentBuilder_ != null || initialPromptFulfillment_ != null; + } + /** + * + * + *
+         * Required. The fulfillment to provide the initial prompt that the agent
+         * can present to the user in order to fill the parameter.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The initialPromptFulfillment. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment getInitialPromptFulfillment() { + if (initialPromptFulfillmentBuilder_ == null) { + return initialPromptFulfillment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.getDefaultInstance() + : initialPromptFulfillment_; + } else { + return initialPromptFulfillmentBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Required. The fulfillment to provide the initial prompt that the agent
+         * can present to the user in order to fill the parameter.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInitialPromptFulfillment( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment value) { + if (initialPromptFulfillmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + initialPromptFulfillment_ = value; + onChanged(); + } else { + initialPromptFulfillmentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+         * Required. The fulfillment to provide the initial prompt that the agent
+         * can present to the user in order to fill the parameter.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInitialPromptFulfillment( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder builderForValue) { + if (initialPromptFulfillmentBuilder_ == null) { + initialPromptFulfillment_ = builderForValue.build(); + onChanged(); + } else { + initialPromptFulfillmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+         * Required. The fulfillment to provide the initial prompt that the agent
+         * can present to the user in order to fill the parameter.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInitialPromptFulfillment( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment value) { + if (initialPromptFulfillmentBuilder_ == null) { + if (initialPromptFulfillment_ != null) { + initialPromptFulfillment_ = + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.newBuilder( + initialPromptFulfillment_) + .mergeFrom(value) + .buildPartial(); + } else { + initialPromptFulfillment_ = value; + } + onChanged(); + } else { + initialPromptFulfillmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+         * Required. The fulfillment to provide the initial prompt that the agent
+         * can present to the user in order to fill the parameter.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInitialPromptFulfillment() { + if (initialPromptFulfillmentBuilder_ == null) { + initialPromptFulfillment_ = null; + onChanged(); + } else { + initialPromptFulfillment_ = null; + initialPromptFulfillmentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+         * Required. The fulfillment to provide the initial prompt that the agent
+         * can present to the user in order to fill the parameter.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder + getInitialPromptFulfillmentBuilder() { + + onChanged(); + return getInitialPromptFulfillmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Required. The fulfillment to provide the initial prompt that the agent
+         * can present to the user in order to fill the parameter.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder + getInitialPromptFulfillmentOrBuilder() { + if (initialPromptFulfillmentBuilder_ != null) { + return initialPromptFulfillmentBuilder_.getMessageOrBuilder(); + } else { + return initialPromptFulfillment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.getDefaultInstance() + : initialPromptFulfillment_; + } + } + /** + * + * + *
+         * Required. The fulfillment to provide the initial prompt that the agent
+         * can present to the user in order to fill the parameter.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment initial_prompt_fulfillment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder> + getInitialPromptFulfillmentFieldBuilder() { + if (initialPromptFulfillmentBuilder_ == null) { + initialPromptFulfillmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder>( + getInitialPromptFulfillment(), getParentForChildren(), isClean()); + initialPromptFulfillment_ = null; + } + return initialPromptFulfillmentBuilder_; + } + + private java.util.List + repromptEventHandlers_ = java.util.Collections.emptyList(); + + private void ensureRepromptEventHandlersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + repromptEventHandlers_ = + new java.util.ArrayList( + repromptEventHandlers_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EventHandler, + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder> + repromptEventHandlersBuilder_; + + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public java.util.List + getRepromptEventHandlersList() { + if (repromptEventHandlersBuilder_ == null) { + return java.util.Collections.unmodifiableList(repromptEventHandlers_); + } else { + return repromptEventHandlersBuilder_.getMessageList(); + } + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public int getRepromptEventHandlersCount() { + if (repromptEventHandlersBuilder_ == null) { + return repromptEventHandlers_.size(); + } else { + return repromptEventHandlersBuilder_.getCount(); + } + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler getRepromptEventHandlers( + int index) { + if (repromptEventHandlersBuilder_ == null) { + return repromptEventHandlers_.get(index); + } else { + return repromptEventHandlersBuilder_.getMessage(index); + } + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public Builder setRepromptEventHandlers( + int index, com.google.cloud.dialogflow.cx.v3beta1.EventHandler value) { + if (repromptEventHandlersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRepromptEventHandlersIsMutable(); + repromptEventHandlers_.set(index, value); + onChanged(); + } else { + repromptEventHandlersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public Builder setRepromptEventHandlers( + int index, + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder builderForValue) { + if (repromptEventHandlersBuilder_ == null) { + ensureRepromptEventHandlersIsMutable(); + repromptEventHandlers_.set(index, builderForValue.build()); + onChanged(); + } else { + repromptEventHandlersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public Builder addRepromptEventHandlers( + com.google.cloud.dialogflow.cx.v3beta1.EventHandler value) { + if (repromptEventHandlersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRepromptEventHandlersIsMutable(); + repromptEventHandlers_.add(value); + onChanged(); + } else { + repromptEventHandlersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public Builder addRepromptEventHandlers( + int index, com.google.cloud.dialogflow.cx.v3beta1.EventHandler value) { + if (repromptEventHandlersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRepromptEventHandlersIsMutable(); + repromptEventHandlers_.add(index, value); + onChanged(); + } else { + repromptEventHandlersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public Builder addRepromptEventHandlers( + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder builderForValue) { + if (repromptEventHandlersBuilder_ == null) { + ensureRepromptEventHandlersIsMutable(); + repromptEventHandlers_.add(builderForValue.build()); + onChanged(); + } else { + repromptEventHandlersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public Builder addRepromptEventHandlers( + int index, + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder builderForValue) { + if (repromptEventHandlersBuilder_ == null) { + ensureRepromptEventHandlersIsMutable(); + repromptEventHandlers_.add(index, builderForValue.build()); + onChanged(); + } else { + repromptEventHandlersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public Builder addAllRepromptEventHandlers( + java.lang.Iterable + values) { + if (repromptEventHandlersBuilder_ == null) { + ensureRepromptEventHandlersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, repromptEventHandlers_); + onChanged(); + } else { + repromptEventHandlersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public Builder clearRepromptEventHandlers() { + if (repromptEventHandlersBuilder_ == null) { + repromptEventHandlers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + repromptEventHandlersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public Builder removeRepromptEventHandlers(int index) { + if (repromptEventHandlersBuilder_ == null) { + ensureRepromptEventHandlersIsMutable(); + repromptEventHandlers_.remove(index); + onChanged(); + } else { + repromptEventHandlersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder + getRepromptEventHandlersBuilder(int index) { + return getRepromptEventHandlersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder + getRepromptEventHandlersOrBuilder(int index) { + if (repromptEventHandlersBuilder_ == null) { + return repromptEventHandlers_.get(index); + } else { + return repromptEventHandlersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder> + getRepromptEventHandlersOrBuilderList() { + if (repromptEventHandlersBuilder_ != null) { + return repromptEventHandlersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(repromptEventHandlers_); + } + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder + addRepromptEventHandlersBuilder() { + return getRepromptEventHandlersFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.EventHandler.getDefaultInstance()); + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder + addRepromptEventHandlersBuilder(int index) { + return getRepromptEventHandlersFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.EventHandler.getDefaultInstance()); + } + /** + * + * + *
+         * The handlers for parameter-level events, used to provide reprompt for
+         * the parameter or transition to a different page/flow. The supported
+         * events are:
+         * *   `sys.no-match-<N>`, where N can be from 1 to 6
+         * *   `sys.no-match-default`
+         * *   `sys.no-input-<N>`, where N can be from 1 to 6
+         * *   `sys.no-input-default`
+         * *   `sys.invalid-parameter`
+         * `initial_prompt_fulfillment` provides the first prompt for the
+         * parameter.
+         * If the user's response does not fill the parameter, a
+         * no-match/no-input event will be triggered, and the fulfillment
+         * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
+         * defined) will be called to provide a prompt. The
+         * `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
+         * the next no-match/no-input event, and so on.
+         * A `sys.no-match-default` or `sys.no-input-default` handler will be used
+         * to handle all following no-match/no-input events after all numbered
+         * no-match/no-input handlers for the parameter are consumed.
+         * A `sys.invalid-parameter` handler can be defined to handle the case
+         * where the parameter values have been `invalidated` by webhook. For
+         * example, if the user's response fill the parameter, however the
+         * parameter was invalidated by webhook, the fulfillment associated with
+         * the `sys.invalid-parameter` handler (if defined) will be called to
+         * provide a prompt.
+         * If the event handler for the corresponding event can't be found on the
+         * parameter, `initial_prompt_fulfillment` will be re-prompted.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler reprompt_event_handlers = 5; + * + */ + public java.util.List + getRepromptEventHandlersBuilderList() { + return getRepromptEventHandlersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EventHandler, + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder> + getRepromptEventHandlersFieldBuilder() { + if (repromptEventHandlersBuilder_ == null) { + repromptEventHandlersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EventHandler, + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder>( + repromptEventHandlers_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + repromptEventHandlers_ = null; + } + return repromptEventHandlersBuilder_; + } + + @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.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior) + private static final com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FillBehavior parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FillBehavior(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.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object displayName_; + /** + * + * + *
+     * Required. The human-readable name of the parameter, unique within the
+     * form.
+     * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The human-readable name of the parameter, unique within the
+     * form.
+     * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUIRED_FIELD_NUMBER = 2; + private boolean required_; + /** + * + * + *
+     * Indicates whether the parameter is required. Optional parameters will not
+     * trigger prompts; however, they are filled if the user specifies them.
+     * Required parameters must be filled before form filling concludes.
+     * 
+ * + * bool required = 2; + * + * @return The required. + */ + @java.lang.Override + public boolean getRequired() { + return required_; + } + + public static final int ENTITY_TYPE_FIELD_NUMBER = 3; + private volatile java.lang.Object entityType_; + /** + * + * + *
+     * Required. The entity type of the parameter.
+     * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+     * ID>` for system entity types (for example,
+     * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+     * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+     * 
+ * + * + * string entity_type = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The entityType. + */ + @java.lang.Override + public java.lang.String getEntityType() { + java.lang.Object ref = entityType_; + 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(); + entityType_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The entity type of the parameter.
+     * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+     * ID>` for system entity types (for example,
+     * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+     * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+     * 
+ * + * + * string entity_type = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for entityType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntityTypeBytes() { + java.lang.Object ref = entityType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entityType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IS_LIST_FIELD_NUMBER = 4; + private boolean isList_; + /** + * + * + *
+     * Indicates whether the parameter represents a list of values.
+     * 
+ * + * bool is_list = 4; + * + * @return The isList. + */ + @java.lang.Override + public boolean getIsList() { + return isList_; + } + + public static final int FILL_BEHAVIOR_FIELD_NUMBER = 7; + private com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fillBehavior_; + /** + * + * + *
+     * Required. Defines fill behavior for the parameter.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the fillBehavior field is set. + */ + @java.lang.Override + public boolean hasFillBehavior() { + return fillBehavior_ != null; + } + /** + * + * + *
+     * Required. Defines fill behavior for the parameter.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The fillBehavior. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior getFillBehavior() { + return fillBehavior_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.getDefaultInstance() + : fillBehavior_; + } + /** + * + * + *
+     * Required. Defines fill behavior for the parameter.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehaviorOrBuilder + getFillBehaviorOrBuilder() { + return getFillBehavior(); + } + + public static final int DEFAULT_VALUE_FIELD_NUMBER = 9; + private com.google.protobuf.Value defaultValue_; + /** + * + * + *
+     * The default value of an optional parameter. If the parameter is required,
+     * the default value will be ignored.
+     * 
+ * + * .google.protobuf.Value default_value = 9; + * + * @return Whether the defaultValue field is set. + */ + @java.lang.Override + public boolean hasDefaultValue() { + return defaultValue_ != null; + } + /** + * + * + *
+     * The default value of an optional parameter. If the parameter is required,
+     * the default value will be ignored.
+     * 
+ * + * .google.protobuf.Value default_value = 9; + * + * @return The defaultValue. + */ + @java.lang.Override + public com.google.protobuf.Value getDefaultValue() { + return defaultValue_ == null ? com.google.protobuf.Value.getDefaultInstance() : defaultValue_; + } + /** + * + * + *
+     * The default value of an optional parameter. If the parameter is required,
+     * the default value will be ignored.
+     * 
+ * + * .google.protobuf.Value default_value = 9; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getDefaultValueOrBuilder() { + return getDefaultValue(); + } + + 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 (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, displayName_); + } + if (required_ != false) { + output.writeBool(2, required_); + } + if (!getEntityTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, entityType_); + } + if (isList_ != false) { + output.writeBool(4, isList_); + } + if (fillBehavior_ != null) { + output.writeMessage(7, getFillBehavior()); + } + if (defaultValue_ != null) { + output.writeMessage(9, getDefaultValue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, displayName_); + } + if (required_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, required_); + } + if (!getEntityTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, entityType_); + } + if (isList_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, isList_); + } + if (fillBehavior_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getFillBehavior()); + } + if (defaultValue_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getDefaultValue()); + } + 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.dialogflow.cx.v3beta1.Form.Parameter)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter other = + (com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter) obj; + + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (getRequired() != other.getRequired()) return false; + if (!getEntityType().equals(other.getEntityType())) return false; + if (getIsList() != other.getIsList()) return false; + if (hasFillBehavior() != other.hasFillBehavior()) return false; + if (hasFillBehavior()) { + if (!getFillBehavior().equals(other.getFillBehavior())) return false; + } + if (hasDefaultValue() != other.hasDefaultValue()) return false; + if (hasDefaultValue()) { + if (!getDefaultValue().equals(other.getDefaultValue())) 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_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + REQUIRED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequired()); + hash = (37 * hash) + ENTITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEntityType().hashCode(); + hash = (37 * hash) + IS_LIST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsList()); + if (hasFillBehavior()) { + hash = (37 * hash) + FILL_BEHAVIOR_FIELD_NUMBER; + hash = (53 * hash) + getFillBehavior().hashCode(); + } + if (hasDefaultValue()) { + hash = (37 * hash) + DEFAULT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getDefaultValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter 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.dialogflow.cx.v3beta1.Form.Parameter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter 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.dialogflow.cx.v3beta1.Form.Parameter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter 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.dialogflow.cx.v3beta1.Form.Parameter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter 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.dialogflow.cx.v3beta1.Form.Parameter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter 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.dialogflow.cx.v3beta1.Form.Parameter prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Represents a form parameter.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Form.Parameter} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Form.Parameter) + com.google.cloud.dialogflow.cx.v3beta1.Form.ParameterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.class, + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.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(); + displayName_ = ""; + + required_ = false; + + entityType_ = ""; + + isList_ = false; + + if (fillBehaviorBuilder_ == null) { + fillBehavior_ = null; + } else { + fillBehavior_ = null; + fillBehaviorBuilder_ = null; + } + if (defaultValueBuilder_ == null) { + defaultValue_ = null; + } else { + defaultValue_ = null; + defaultValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter build() { + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter result = + new com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter(this); + result.displayName_ = displayName_; + result.required_ = required_; + result.entityType_ = entityType_; + result.isList_ = isList_; + if (fillBehaviorBuilder_ == null) { + result.fillBehavior_ = fillBehavior_; + } else { + result.fillBehavior_ = fillBehaviorBuilder_.build(); + } + if (defaultValueBuilder_ == null) { + result.defaultValue_ = defaultValue_; + } else { + result.defaultValue_ = defaultValueBuilder_.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.dialogflow.cx.v3beta1.Form.Parameter) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.getDefaultInstance()) + return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.getRequired() != false) { + setRequired(other.getRequired()); + } + if (!other.getEntityType().isEmpty()) { + entityType_ = other.entityType_; + onChanged(); + } + if (other.getIsList() != false) { + setIsList(other.getIsList()); + } + if (other.hasFillBehavior()) { + mergeFillBehavior(other.getFillBehavior()); + } + if (other.hasDefaultValue()) { + mergeDefaultValue(other.getDefaultValue()); + } + 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.dialogflow.cx.v3beta1.Form.Parameter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+       * Required. The human-readable name of the parameter, unique within the
+       * form.
+       * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The human-readable name of the parameter, unique within the
+       * form.
+       * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The human-readable name of the parameter, unique within the
+       * form.
+       * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The human-readable name of the parameter, unique within the
+       * form.
+       * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The human-readable name of the parameter, unique within the
+       * form.
+       * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private boolean required_; + /** + * + * + *
+       * Indicates whether the parameter is required. Optional parameters will not
+       * trigger prompts; however, they are filled if the user specifies them.
+       * Required parameters must be filled before form filling concludes.
+       * 
+ * + * bool required = 2; + * + * @return The required. + */ + @java.lang.Override + public boolean getRequired() { + return required_; + } + /** + * + * + *
+       * Indicates whether the parameter is required. Optional parameters will not
+       * trigger prompts; however, they are filled if the user specifies them.
+       * Required parameters must be filled before form filling concludes.
+       * 
+ * + * bool required = 2; + * + * @param value The required to set. + * @return This builder for chaining. + */ + public Builder setRequired(boolean value) { + + required_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Indicates whether the parameter is required. Optional parameters will not
+       * trigger prompts; however, they are filled if the user specifies them.
+       * Required parameters must be filled before form filling concludes.
+       * 
+ * + * bool required = 2; + * + * @return This builder for chaining. + */ + public Builder clearRequired() { + + required_ = false; + onChanged(); + return this; + } + + private java.lang.Object entityType_ = ""; + /** + * + * + *
+       * Required. The entity type of the parameter.
+       * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+       * ID>` for system entity types (for example,
+       * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+       * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+       * 
+ * + * + * string entity_type = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The entityType. + */ + public java.lang.String getEntityType() { + java.lang.Object ref = entityType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entityType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The entity type of the parameter.
+       * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+       * ID>` for system entity types (for example,
+       * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+       * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+       * 
+ * + * + * string entity_type = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for entityType. + */ + public com.google.protobuf.ByteString getEntityTypeBytes() { + java.lang.Object ref = entityType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entityType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The entity type of the parameter.
+       * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+       * ID>` for system entity types (for example,
+       * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+       * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+       * 
+ * + * + * string entity_type = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The entityType to set. + * @return This builder for chaining. + */ + public Builder setEntityType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entityType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The entity type of the parameter.
+       * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+       * ID>` for system entity types (for example,
+       * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+       * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+       * 
+ * + * + * string entity_type = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEntityType() { + + entityType_ = getDefaultInstance().getEntityType(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The entity type of the parameter.
+       * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+       * ID>` for system entity types (for example,
+       * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+       * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+       * 
+ * + * + * string entity_type = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for entityType to set. + * @return This builder for chaining. + */ + public Builder setEntityTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entityType_ = value; + onChanged(); + return this; + } + + private boolean isList_; + /** + * + * + *
+       * Indicates whether the parameter represents a list of values.
+       * 
+ * + * bool is_list = 4; + * + * @return The isList. + */ + @java.lang.Override + public boolean getIsList() { + return isList_; + } + /** + * + * + *
+       * Indicates whether the parameter represents a list of values.
+       * 
+ * + * bool is_list = 4; + * + * @param value The isList to set. + * @return This builder for chaining. + */ + public Builder setIsList(boolean value) { + + isList_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Indicates whether the parameter represents a list of values.
+       * 
+ * + * bool is_list = 4; + * + * @return This builder for chaining. + */ + public Builder clearIsList() { + + isList_ = false; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fillBehavior_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior, + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehaviorOrBuilder> + fillBehaviorBuilder_; + /** + * + * + *
+       * Required. Defines fill behavior for the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the fillBehavior field is set. + */ + public boolean hasFillBehavior() { + return fillBehaviorBuilder_ != null || fillBehavior_ != null; + } + /** + * + * + *
+       * Required. Defines fill behavior for the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The fillBehavior. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior getFillBehavior() { + if (fillBehaviorBuilder_ == null) { + return fillBehavior_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + .getDefaultInstance() + : fillBehavior_; + } else { + return fillBehaviorBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Defines fill behavior for the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFillBehavior( + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior value) { + if (fillBehaviorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fillBehavior_ = value; + onChanged(); + } else { + fillBehaviorBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. Defines fill behavior for the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFillBehavior( + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.Builder + builderForValue) { + if (fillBehaviorBuilder_ == null) { + fillBehavior_ = builderForValue.build(); + onChanged(); + } else { + fillBehaviorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. Defines fill behavior for the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFillBehavior( + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior value) { + if (fillBehaviorBuilder_ == null) { + if (fillBehavior_ != null) { + fillBehavior_ = + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.newBuilder( + fillBehavior_) + .mergeFrom(value) + .buildPartial(); + } else { + fillBehavior_ = value; + } + onChanged(); + } else { + fillBehaviorBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. Defines fill behavior for the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFillBehavior() { + if (fillBehaviorBuilder_ == null) { + fillBehavior_ = null; + onChanged(); + } else { + fillBehavior_ = null; + fillBehaviorBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. Defines fill behavior for the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.Builder + getFillBehaviorBuilder() { + + onChanged(); + return getFillBehaviorFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Defines fill behavior for the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehaviorOrBuilder + getFillBehaviorOrBuilder() { + if (fillBehaviorBuilder_ != null) { + return fillBehaviorBuilder_.getMessageOrBuilder(); + } else { + return fillBehavior_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior + .getDefaultInstance() + : fillBehavior_; + } + } + /** + * + * + *
+       * Required. Defines fill behavior for the parameter.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior fill_behavior = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior, + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehaviorOrBuilder> + getFillBehaviorFieldBuilder() { + if (fillBehaviorBuilder_ == null) { + fillBehaviorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior, + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehaviorOrBuilder>( + getFillBehavior(), getParentForChildren(), isClean()); + fillBehavior_ = null; + } + return fillBehaviorBuilder_; + } + + private com.google.protobuf.Value defaultValue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + defaultValueBuilder_; + /** + * + * + *
+       * The default value of an optional parameter. If the parameter is required,
+       * the default value will be ignored.
+       * 
+ * + * .google.protobuf.Value default_value = 9; + * + * @return Whether the defaultValue field is set. + */ + public boolean hasDefaultValue() { + return defaultValueBuilder_ != null || defaultValue_ != null; + } + /** + * + * + *
+       * The default value of an optional parameter. If the parameter is required,
+       * the default value will be ignored.
+       * 
+ * + * .google.protobuf.Value default_value = 9; + * + * @return The defaultValue. + */ + public com.google.protobuf.Value getDefaultValue() { + if (defaultValueBuilder_ == null) { + return defaultValue_ == null + ? com.google.protobuf.Value.getDefaultInstance() + : defaultValue_; + } else { + return defaultValueBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The default value of an optional parameter. If the parameter is required,
+       * the default value will be ignored.
+       * 
+ * + * .google.protobuf.Value default_value = 9; + */ + public Builder setDefaultValue(com.google.protobuf.Value value) { + if (defaultValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + defaultValue_ = value; + onChanged(); + } else { + defaultValueBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The default value of an optional parameter. If the parameter is required,
+       * the default value will be ignored.
+       * 
+ * + * .google.protobuf.Value default_value = 9; + */ + public Builder setDefaultValue(com.google.protobuf.Value.Builder builderForValue) { + if (defaultValueBuilder_ == null) { + defaultValue_ = builderForValue.build(); + onChanged(); + } else { + defaultValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The default value of an optional parameter. If the parameter is required,
+       * the default value will be ignored.
+       * 
+ * + * .google.protobuf.Value default_value = 9; + */ + public Builder mergeDefaultValue(com.google.protobuf.Value value) { + if (defaultValueBuilder_ == null) { + if (defaultValue_ != null) { + defaultValue_ = + com.google.protobuf.Value.newBuilder(defaultValue_).mergeFrom(value).buildPartial(); + } else { + defaultValue_ = value; + } + onChanged(); + } else { + defaultValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The default value of an optional parameter. If the parameter is required,
+       * the default value will be ignored.
+       * 
+ * + * .google.protobuf.Value default_value = 9; + */ + public Builder clearDefaultValue() { + if (defaultValueBuilder_ == null) { + defaultValue_ = null; + onChanged(); + } else { + defaultValue_ = null; + defaultValueBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The default value of an optional parameter. If the parameter is required,
+       * the default value will be ignored.
+       * 
+ * + * .google.protobuf.Value default_value = 9; + */ + public com.google.protobuf.Value.Builder getDefaultValueBuilder() { + + onChanged(); + return getDefaultValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The default value of an optional parameter. If the parameter is required,
+       * the default value will be ignored.
+       * 
+ * + * .google.protobuf.Value default_value = 9; + */ + public com.google.protobuf.ValueOrBuilder getDefaultValueOrBuilder() { + if (defaultValueBuilder_ != null) { + return defaultValueBuilder_.getMessageOrBuilder(); + } else { + return defaultValue_ == null + ? com.google.protobuf.Value.getDefaultInstance() + : defaultValue_; + } + } + /** + * + * + *
+       * The default value of an optional parameter. If the parameter is required,
+       * the default value will be ignored.
+       * 
+ * + * .google.protobuf.Value default_value = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getDefaultValueFieldBuilder() { + if (defaultValueBuilder_ == null) { + defaultValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getDefaultValue(), getParentForChildren(), isClean()); + defaultValue_ = null; + } + return defaultValueBuilder_; + } + + @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.dialogflow.cx.v3beta1.Form.Parameter) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Form.Parameter) + private static final com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Parameter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Parameter(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.dialogflow.cx.v3beta1.Form.Parameter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int PARAMETERS_FIELD_NUMBER = 1; + private java.util.List parameters_; + /** + * + * + *
+   * Parameters to collect from the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + @java.lang.Override + public java.util.List getParametersList() { + return parameters_; + } + /** + * + * + *
+   * Parameters to collect from the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + @java.lang.Override + public java.util.List + getParametersOrBuilderList() { + return parameters_; + } + /** + * + * + *
+   * Parameters to collect from the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + @java.lang.Override + public int getParametersCount() { + return parameters_.size(); + } + /** + * + * + *
+   * Parameters to collect from the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter getParameters(int index) { + return parameters_.get(index); + } + /** + * + * + *
+   * Parameters to collect from the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Form.ParameterOrBuilder getParametersOrBuilder( + int index) { + return parameters_.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 < parameters_.size(); i++) { + output.writeMessage(1, parameters_.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 < parameters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, parameters_.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.dialogflow.cx.v3beta1.Form)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Form other = + (com.google.cloud.dialogflow.cx.v3beta1.Form) obj; + + if (!getParametersList().equals(other.getParametersList())) 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 (getParametersCount() > 0) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParametersList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form 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.dialogflow.cx.v3beta1.Form parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form 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.dialogflow.cx.v3beta1.Form parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form 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.dialogflow.cx.v3beta1.Form parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form 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.dialogflow.cx.v3beta1.Form parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form 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.dialogflow.cx.v3beta1.Form 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 form is a data model that groups related parameters that can be collected
+   * from the user. The process in which the agent prompts the user and collects
+   * parameter values from the user is called form filling. A form can be added to
+   * a [page][google.cloud.dialogflow.cx.v3beta1.Page]. When form filling is done, the filled parameters will be
+   * written to the [session][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Form} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Form) + com.google.cloud.dialogflow.cx.v3beta1.FormOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Form.class, + com.google.cloud.dialogflow.cx.v3beta1.Form.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.Form.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getParametersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (parametersBuilder_ == null) { + parameters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + parametersBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Form_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Form getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Form.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Form build() { + com.google.cloud.dialogflow.cx.v3beta1.Form result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Form buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Form result = + new com.google.cloud.dialogflow.cx.v3beta1.Form(this); + int from_bitField0_ = bitField0_; + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + parameters_ = java.util.Collections.unmodifiableList(parameters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.parameters_ = parameters_; + } else { + result.parameters_ = parametersBuilder_.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.dialogflow.cx.v3beta1.Form) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.Form) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Form other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.Form.getDefaultInstance()) return this; + if (parametersBuilder_ == null) { + if (!other.parameters_.isEmpty()) { + if (parameters_.isEmpty()) { + parameters_ = other.parameters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureParametersIsMutable(); + parameters_.addAll(other.parameters_); + } + onChanged(); + } + } else { + if (!other.parameters_.isEmpty()) { + if (parametersBuilder_.isEmpty()) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + parameters_ = other.parameters_; + bitField0_ = (bitField0_ & ~0x00000001); + parametersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getParametersFieldBuilder() + : null; + } else { + parametersBuilder_.addAllMessages(other.parameters_); + } + } + } + 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.dialogflow.cx.v3beta1.Form parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.dialogflow.cx.v3beta1.Form) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List parameters_ = + java.util.Collections.emptyList(); + + private void ensureParametersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + parameters_ = + new java.util.ArrayList( + parameters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter, + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Form.ParameterOrBuilder> + parametersBuilder_; + + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public java.util.List + getParametersList() { + if (parametersBuilder_ == null) { + return java.util.Collections.unmodifiableList(parameters_); + } else { + return parametersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public int getParametersCount() { + if (parametersBuilder_ == null) { + return parameters_.size(); + } else { + return parametersBuilder_.getCount(); + } + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter getParameters(int index) { + if (parametersBuilder_ == null) { + return parameters_.get(index); + } else { + return parametersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public Builder setParameters( + int index, com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.set(index, value); + onChanged(); + } else { + parametersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public Builder setParameters( + int index, com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.set(index, builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public Builder addParameters(com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.add(value); + onChanged(); + } else { + parametersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public Builder addParameters( + int index, com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.add(index, value); + onChanged(); + } else { + parametersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public Builder addParameters( + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.add(builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public Builder addParameters( + int index, com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.add(index, builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public Builder addAllParameters( + java.lang.Iterable + values) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, parameters_); + onChanged(); + } else { + parametersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public Builder clearParameters() { + if (parametersBuilder_ == null) { + parameters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + parametersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public Builder removeParameters(int index) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.remove(index); + onChanged(); + } else { + parametersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.Builder getParametersBuilder( + int index) { + return getParametersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Form.ParameterOrBuilder getParametersOrBuilder( + int index) { + if (parametersBuilder_ == null) { + return parameters_.get(index); + } else { + return parametersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public java.util.List + getParametersOrBuilderList() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(parameters_); + } + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.Builder addParametersBuilder() { + return getParametersFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.getDefaultInstance()); + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.Builder addParametersBuilder( + int index) { + return getParametersFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.getDefaultInstance()); + } + /** + * + * + *
+     * Parameters to collect from the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + public java.util.List + getParametersBuilderList() { + return getParametersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter, + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Form.ParameterOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter, + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Form.ParameterOrBuilder>( + parameters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + @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.dialogflow.cx.v3beta1.Form) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Form) + private static final com.google.cloud.dialogflow.cx.v3beta1.Form DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Form(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Form getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Form parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Form(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.dialogflow.cx.v3beta1.Form getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FormOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FormOrBuilder.java new file mode 100644 index 000000000..de3516d56 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FormOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface FormOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Form) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Parameters to collect from the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + java.util.List getParametersList(); + /** + * + * + *
+   * Parameters to collect from the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter getParameters(int index); + /** + * + * + *
+   * Parameters to collect from the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + int getParametersCount(); + /** + * + * + *
+   * Parameters to collect from the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + java.util.List + getParametersOrBuilderList(); + /** + * + * + *
+   * Parameters to collect from the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Form.Parameter parameters = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.Form.ParameterOrBuilder getParametersOrBuilder(int index); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillIntentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillIntentRequest.java new file mode 100644 index 000000000..9b03940cd --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillIntentRequest.java @@ -0,0 +1,1316 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Request of [FulfillIntent][]
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest} + */ +public final class FulfillIntentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest) + FulfillIntentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use FulfillIntentRequest.newBuilder() to construct. + private FulfillIntentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FulfillIntentRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FulfillIntentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FulfillIntentRequest( + 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.dialogflow.cx.v3beta1.MatchIntentRequest.Builder subBuilder = null; + if (matchIntentRequest_ != null) { + subBuilder = matchIntentRequest_.toBuilder(); + } + matchIntentRequest_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(matchIntentRequest_); + matchIntentRequest_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.dialogflow.cx.v3beta1.Match.Builder subBuilder = null; + if (match_ != null) { + subBuilder = match_.toBuilder(); + } + match_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Match.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(match_); + match_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder subBuilder = null; + if (outputAudioConfig_ != null) { + subBuilder = outputAudioConfig_.toBuilder(); + } + outputAudioConfig_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputAudioConfig_); + outputAudioConfig_ = 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.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.Builder.class); + } + + public static final int MATCH_INTENT_REQUEST_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest matchIntentRequest_; + /** + * + * + *
+   * Must be same as the corresponding MatchIntent request, otherwise the
+   * behavior is undefined.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + * + * @return Whether the matchIntentRequest field is set. + */ + @java.lang.Override + public boolean hasMatchIntentRequest() { + return matchIntentRequest_ != null; + } + /** + * + * + *
+   * Must be same as the corresponding MatchIntent request, otherwise the
+   * behavior is undefined.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + * + * @return The matchIntentRequest. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest getMatchIntentRequest() { + return matchIntentRequest_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.getDefaultInstance() + : matchIntentRequest_; + } + /** + * + * + *
+   * Must be same as the corresponding MatchIntent request, otherwise the
+   * behavior is undefined.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequestOrBuilder + getMatchIntentRequestOrBuilder() { + return getMatchIntentRequest(); + } + + public static final int MATCH_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.Match match_; + /** + * + * + *
+   * The matched intent/event to fulfill.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + * + * @return Whether the match field is set. + */ + @java.lang.Override + public boolean hasMatch() { + return match_ != null; + } + /** + * + * + *
+   * The matched intent/event to fulfill.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + * + * @return The match. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Match getMatch() { + return match_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Match.getDefaultInstance() + : match_; + } + /** + * + * + *
+   * The matched intent/event to fulfill.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder getMatchOrBuilder() { + return getMatch(); + } + + public static final int OUTPUT_AUDIO_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig outputAudioConfig_; + /** + * + * + *
+   * Instructs the speech synthesizer how to generate output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + * + * @return Whether the outputAudioConfig field is set. + */ + @java.lang.Override + public boolean hasOutputAudioConfig() { + return outputAudioConfig_ != null; + } + /** + * + * + *
+   * Instructs the speech synthesizer how to generate output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + * + * @return The outputAudioConfig. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig() { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } + /** + * + * + *
+   * Instructs the speech synthesizer how to generate output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder + getOutputAudioConfigOrBuilder() { + return getOutputAudioConfig(); + } + + 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 (matchIntentRequest_ != null) { + output.writeMessage(1, getMatchIntentRequest()); + } + if (match_ != null) { + output.writeMessage(2, getMatch()); + } + if (outputAudioConfig_ != null) { + output.writeMessage(3, getOutputAudioConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (matchIntentRequest_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMatchIntentRequest()); + } + if (match_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMatch()); + } + if (outputAudioConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getOutputAudioConfig()); + } + 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.dialogflow.cx.v3beta1.FulfillIntentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest) obj; + + if (hasMatchIntentRequest() != other.hasMatchIntentRequest()) return false; + if (hasMatchIntentRequest()) { + if (!getMatchIntentRequest().equals(other.getMatchIntentRequest())) return false; + } + if (hasMatch() != other.hasMatch()) return false; + if (hasMatch()) { + if (!getMatch().equals(other.getMatch())) return false; + } + if (hasOutputAudioConfig() != other.hasOutputAudioConfig()) return false; + if (hasOutputAudioConfig()) { + if (!getOutputAudioConfig().equals(other.getOutputAudioConfig())) 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 (hasMatchIntentRequest()) { + hash = (37 * hash) + MATCH_INTENT_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getMatchIntentRequest().hashCode(); + } + if (hasMatch()) { + hash = (37 * hash) + MATCH_FIELD_NUMBER; + hash = (53 * hash) + getMatch().hashCode(); + } + if (hasOutputAudioConfig()) { + hash = (37 * hash) + OUTPUT_AUDIO_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputAudioConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest 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.dialogflow.cx.v3beta1.FulfillIntentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest 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.dialogflow.cx.v3beta1.FulfillIntentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest 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.dialogflow.cx.v3beta1.FulfillIntentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest 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.dialogflow.cx.v3beta1.FulfillIntentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest 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.dialogflow.cx.v3beta1.FulfillIntentRequest 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 of [FulfillIntent][]
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest) + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (matchIntentRequestBuilder_ == null) { + matchIntentRequest_ = null; + } else { + matchIntentRequest_ = null; + matchIntentRequestBuilder_ = null; + } + if (matchBuilder_ == null) { + match_ = null; + } else { + match_ = null; + matchBuilder_ = null; + } + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = null; + } else { + outputAudioConfig_ = null; + outputAudioConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest(this); + if (matchIntentRequestBuilder_ == null) { + result.matchIntentRequest_ = matchIntentRequest_; + } else { + result.matchIntentRequest_ = matchIntentRequestBuilder_.build(); + } + if (matchBuilder_ == null) { + result.match_ = match_; + } else { + result.match_ = matchBuilder_.build(); + } + if (outputAudioConfigBuilder_ == null) { + result.outputAudioConfig_ = outputAudioConfig_; + } else { + result.outputAudioConfig_ = outputAudioConfigBuilder_.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.dialogflow.cx.v3beta1.FulfillIntentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest.getDefaultInstance()) + return this; + if (other.hasMatchIntentRequest()) { + mergeMatchIntentRequest(other.getMatchIntentRequest()); + } + if (other.hasMatch()) { + mergeMatch(other.getMatch()); + } + if (other.hasOutputAudioConfig()) { + mergeOutputAudioConfig(other.getOutputAudioConfig()); + } + 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.dialogflow.cx.v3beta1.FulfillIntentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest matchIntentRequest_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.Builder, + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequestOrBuilder> + matchIntentRequestBuilder_; + /** + * + * + *
+     * Must be same as the corresponding MatchIntent request, otherwise the
+     * behavior is undefined.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + * + * @return Whether the matchIntentRequest field is set. + */ + public boolean hasMatchIntentRequest() { + return matchIntentRequestBuilder_ != null || matchIntentRequest_ != null; + } + /** + * + * + *
+     * Must be same as the corresponding MatchIntent request, otherwise the
+     * behavior is undefined.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + * + * @return The matchIntentRequest. + */ + public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest getMatchIntentRequest() { + if (matchIntentRequestBuilder_ == null) { + return matchIntentRequest_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.getDefaultInstance() + : matchIntentRequest_; + } else { + return matchIntentRequestBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Must be same as the corresponding MatchIntent request, otherwise the
+     * behavior is undefined.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + */ + public Builder setMatchIntentRequest( + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest value) { + if (matchIntentRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + matchIntentRequest_ = value; + onChanged(); + } else { + matchIntentRequestBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Must be same as the corresponding MatchIntent request, otherwise the
+     * behavior is undefined.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + */ + public Builder setMatchIntentRequest( + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.Builder builderForValue) { + if (matchIntentRequestBuilder_ == null) { + matchIntentRequest_ = builderForValue.build(); + onChanged(); + } else { + matchIntentRequestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Must be same as the corresponding MatchIntent request, otherwise the
+     * behavior is undefined.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + */ + public Builder mergeMatchIntentRequest( + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest value) { + if (matchIntentRequestBuilder_ == null) { + if (matchIntentRequest_ != null) { + matchIntentRequest_ = + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.newBuilder( + matchIntentRequest_) + .mergeFrom(value) + .buildPartial(); + } else { + matchIntentRequest_ = value; + } + onChanged(); + } else { + matchIntentRequestBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Must be same as the corresponding MatchIntent request, otherwise the
+     * behavior is undefined.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + */ + public Builder clearMatchIntentRequest() { + if (matchIntentRequestBuilder_ == null) { + matchIntentRequest_ = null; + onChanged(); + } else { + matchIntentRequest_ = null; + matchIntentRequestBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Must be same as the corresponding MatchIntent request, otherwise the
+     * behavior is undefined.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.Builder + getMatchIntentRequestBuilder() { + + onChanged(); + return getMatchIntentRequestFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Must be same as the corresponding MatchIntent request, otherwise the
+     * behavior is undefined.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequestOrBuilder + getMatchIntentRequestOrBuilder() { + if (matchIntentRequestBuilder_ != null) { + return matchIntentRequestBuilder_.getMessageOrBuilder(); + } else { + return matchIntentRequest_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.getDefaultInstance() + : matchIntentRequest_; + } + } + /** + * + * + *
+     * Must be same as the corresponding MatchIntent request, otherwise the
+     * behavior is undefined.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.Builder, + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequestOrBuilder> + getMatchIntentRequestFieldBuilder() { + if (matchIntentRequestBuilder_ == null) { + matchIntentRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest, + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.Builder, + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequestOrBuilder>( + getMatchIntentRequest(), getParentForChildren(), isClean()); + matchIntentRequest_ = null; + } + return matchIntentRequestBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Match match_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Match, + com.google.cloud.dialogflow.cx.v3beta1.Match.Builder, + com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder> + matchBuilder_; + /** + * + * + *
+     * The matched intent/event to fulfill.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + * + * @return Whether the match field is set. + */ + public boolean hasMatch() { + return matchBuilder_ != null || match_ != null; + } + /** + * + * + *
+     * The matched intent/event to fulfill.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + * + * @return The match. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Match getMatch() { + if (matchBuilder_ == null) { + return match_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Match.getDefaultInstance() + : match_; + } else { + return matchBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The matched intent/event to fulfill.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + */ + public Builder setMatch(com.google.cloud.dialogflow.cx.v3beta1.Match value) { + if (matchBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + match_ = value; + onChanged(); + } else { + matchBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The matched intent/event to fulfill.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + */ + public Builder setMatch(com.google.cloud.dialogflow.cx.v3beta1.Match.Builder builderForValue) { + if (matchBuilder_ == null) { + match_ = builderForValue.build(); + onChanged(); + } else { + matchBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The matched intent/event to fulfill.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + */ + public Builder mergeMatch(com.google.cloud.dialogflow.cx.v3beta1.Match value) { + if (matchBuilder_ == null) { + if (match_ != null) { + match_ = + com.google.cloud.dialogflow.cx.v3beta1.Match.newBuilder(match_) + .mergeFrom(value) + .buildPartial(); + } else { + match_ = value; + } + onChanged(); + } else { + matchBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The matched intent/event to fulfill.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + */ + public Builder clearMatch() { + if (matchBuilder_ == null) { + match_ = null; + onChanged(); + } else { + match_ = null; + matchBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The matched intent/event to fulfill.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Match.Builder getMatchBuilder() { + + onChanged(); + return getMatchFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The matched intent/event to fulfill.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder getMatchOrBuilder() { + if (matchBuilder_ != null) { + return matchBuilder_.getMessageOrBuilder(); + } else { + return match_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Match.getDefaultInstance() + : match_; + } + } + /** + * + * + *
+     * The matched intent/event to fulfill.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Match, + com.google.cloud.dialogflow.cx.v3beta1.Match.Builder, + com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder> + getMatchFieldBuilder() { + if (matchBuilder_ == null) { + matchBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Match, + com.google.cloud.dialogflow.cx.v3beta1.Match.Builder, + com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder>( + getMatch(), getParentForChildren(), isClean()); + match_ = null; + } + return matchBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig outputAudioConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder> + outputAudioConfigBuilder_; + /** + * + * + *
+     * Instructs the speech synthesizer how to generate output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + * + * @return Whether the outputAudioConfig field is set. + */ + public boolean hasOutputAudioConfig() { + return outputAudioConfigBuilder_ != null || outputAudioConfig_ != null; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + * + * @return The outputAudioConfig. + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig() { + if (outputAudioConfigBuilder_ == null) { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } else { + return outputAudioConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + */ + public Builder setOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig value) { + if (outputAudioConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputAudioConfig_ = value; + onChanged(); + } else { + outputAudioConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + */ + public Builder setOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder builderForValue) { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = builderForValue.build(); + onChanged(); + } else { + outputAudioConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + */ + public Builder mergeOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig value) { + if (outputAudioConfigBuilder_ == null) { + if (outputAudioConfig_ != null) { + outputAudioConfig_ = + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.newBuilder( + outputAudioConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + outputAudioConfig_ = value; + } + onChanged(); + } else { + outputAudioConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + */ + public Builder clearOutputAudioConfig() { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = null; + onChanged(); + } else { + outputAudioConfig_ = null; + outputAudioConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder + getOutputAudioConfigBuilder() { + + onChanged(); + return getOutputAudioConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder + getOutputAudioConfigOrBuilder() { + if (outputAudioConfigBuilder_ != null) { + return outputAudioConfigBuilder_.getMessageOrBuilder(); + } else { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder> + getOutputAudioConfigFieldBuilder() { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder>( + getOutputAudioConfig(), getParentForChildren(), isClean()); + outputAudioConfig_ = null; + } + return outputAudioConfigBuilder_; + } + + @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.dialogflow.cx.v3beta1.FulfillIntentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FulfillIntentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FulfillIntentRequest(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.dialogflow.cx.v3beta1.FulfillIntentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillIntentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillIntentRequestOrBuilder.java new file mode 100644 index 000000000..14825011d --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillIntentRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface FulfillIntentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Must be same as the corresponding MatchIntent request, otherwise the
+   * behavior is undefined.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + * + * @return Whether the matchIntentRequest field is set. + */ + boolean hasMatchIntentRequest(); + /** + * + * + *
+   * Must be same as the corresponding MatchIntent request, otherwise the
+   * behavior is undefined.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + * + * @return The matchIntentRequest. + */ + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest getMatchIntentRequest(); + /** + * + * + *
+   * Must be same as the corresponding MatchIntent request, otherwise the
+   * behavior is undefined.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest match_intent_request = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequestOrBuilder + getMatchIntentRequestOrBuilder(); + + /** + * + * + *
+   * The matched intent/event to fulfill.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + * + * @return Whether the match field is set. + */ + boolean hasMatch(); + /** + * + * + *
+   * The matched intent/event to fulfill.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + * + * @return The match. + */ + com.google.cloud.dialogflow.cx.v3beta1.Match getMatch(); + /** + * + * + *
+   * The matched intent/event to fulfill.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 2; + */ + com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder getMatchOrBuilder(); + + /** + * + * + *
+   * Instructs the speech synthesizer how to generate output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + * + * @return Whether the outputAudioConfig field is set. + */ + boolean hasOutputAudioConfig(); + /** + * + * + *
+   * Instructs the speech synthesizer how to generate output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + * + * @return The outputAudioConfig. + */ + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig(); + /** + * + * + *
+   * Instructs the speech synthesizer how to generate output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 3; + */ + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder getOutputAudioConfigOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillIntentResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillIntentResponse.java new file mode 100644 index 000000000..e602ce21f --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillIntentResponse.java @@ -0,0 +1,1341 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Response of [FulfillIntent][]
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse} + */ +public final class FulfillIntentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse) + FulfillIntentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use FulfillIntentResponse.newBuilder() to construct. + private FulfillIntentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FulfillIntentResponse() { + responseId_ = ""; + outputAudio_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FulfillIntentResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FulfillIntentResponse( + 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(); + + responseId_ = s; + break; + } + case 18: + { + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.Builder subBuilder = null; + if (queryResult_ != null) { + subBuilder = queryResult_.toBuilder(); + } + queryResult_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryResult_); + queryResult_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + outputAudio_ = input.readBytes(); + break; + } + case 34: + { + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder subBuilder = null; + if (outputAudioConfig_ != null) { + subBuilder = outputAudioConfig_.toBuilder(); + } + outputAudioConfig_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputAudioConfig_); + outputAudioConfig_ = 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.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse.Builder.class); + } + + public static final int RESPONSE_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object responseId_; + /** + * + * + *
+   * Output only. The unique identifier of the response. It can be used to
+   * locate a response in the training example set or for reporting issues.
+   * 
+ * + * string response_id = 1; + * + * @return The responseId. + */ + @java.lang.Override + public java.lang.String getResponseId() { + java.lang.Object ref = responseId_; + 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(); + responseId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The unique identifier of the response. It can be used to
+   * locate a response in the training example set or for reporting issues.
+   * 
+ * + * string response_id = 1; + * + * @return The bytes for responseId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResponseIdBytes() { + java.lang.Object ref = responseId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + responseId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_RESULT_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.QueryResult queryResult_; + /** + * + * + *
+   * The result of the conversational query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + * + * @return Whether the queryResult field is set. + */ + @java.lang.Override + public boolean hasQueryResult() { + return queryResult_ != null; + } + /** + * + * + *
+   * The result of the conversational query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + * + * @return The queryResult. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryResult getQueryResult() { + return queryResult_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryResult.getDefaultInstance() + : queryResult_; + } + /** + * + * + *
+   * The result of the conversational query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryResultOrBuilder getQueryResultOrBuilder() { + return getQueryResult(); + } + + public static final int OUTPUT_AUDIO_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString outputAudio_; + /** + * + * + *
+   * The audio data bytes encoded as specified in the request.
+   * Note: The output audio is generated based on the values of default platform
+   * text responses found in the
+   * [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] field. If
+   * multiple default text responses exist, they will be concatenated when
+   * generating audio. If no default platform text responses exist, the
+   * generated audio content will be empty.
+   * In some scenarios, multiple output audio fields may be present in the
+   * response structure. In these cases, only the top-most-level audio output
+   * has content.
+   * 
+ * + * bytes output_audio = 3; + * + * @return The outputAudio. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputAudio() { + return outputAudio_; + } + + public static final int OUTPUT_AUDIO_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig outputAudioConfig_; + /** + * + * + *
+   * The config used by the speech synthesizer to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return Whether the outputAudioConfig field is set. + */ + @java.lang.Override + public boolean hasOutputAudioConfig() { + return outputAudioConfig_ != null; + } + /** + * + * + *
+   * The config used by the speech synthesizer to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return The outputAudioConfig. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig() { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } + /** + * + * + *
+   * The config used by the speech synthesizer to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder + getOutputAudioConfigOrBuilder() { + return getOutputAudioConfig(); + } + + 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 (!getResponseIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, responseId_); + } + if (queryResult_ != null) { + output.writeMessage(2, getQueryResult()); + } + if (!outputAudio_.isEmpty()) { + output.writeBytes(3, outputAudio_); + } + if (outputAudioConfig_ != null) { + output.writeMessage(4, getOutputAudioConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getResponseIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, responseId_); + } + if (queryResult_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQueryResult()); + } + if (!outputAudio_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, outputAudio_); + } + if (outputAudioConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getOutputAudioConfig()); + } + 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.dialogflow.cx.v3beta1.FulfillIntentResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse) obj; + + if (!getResponseId().equals(other.getResponseId())) return false; + if (hasQueryResult() != other.hasQueryResult()) return false; + if (hasQueryResult()) { + if (!getQueryResult().equals(other.getQueryResult())) return false; + } + if (!getOutputAudio().equals(other.getOutputAudio())) return false; + if (hasOutputAudioConfig() != other.hasOutputAudioConfig()) return false; + if (hasOutputAudioConfig()) { + if (!getOutputAudioConfig().equals(other.getOutputAudioConfig())) 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) + RESPONSE_ID_FIELD_NUMBER; + hash = (53 * hash) + getResponseId().hashCode(); + if (hasQueryResult()) { + hash = (37 * hash) + QUERY_RESULT_FIELD_NUMBER; + hash = (53 * hash) + getQueryResult().hashCode(); + } + hash = (37 * hash) + OUTPUT_AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getOutputAudio().hashCode(); + if (hasOutputAudioConfig()) { + hash = (37 * hash) + OUTPUT_AUDIO_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputAudioConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse 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.dialogflow.cx.v3beta1.FulfillIntentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse 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.dialogflow.cx.v3beta1.FulfillIntentResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse 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.dialogflow.cx.v3beta1.FulfillIntentResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse 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.dialogflow.cx.v3beta1.FulfillIntentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse 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.dialogflow.cx.v3beta1.FulfillIntentResponse 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 [FulfillIntent][]
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse) + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse.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(); + responseId_ = ""; + + if (queryResultBuilder_ == null) { + queryResult_ = null; + } else { + queryResult_ = null; + queryResultBuilder_ = null; + } + outputAudio_ = com.google.protobuf.ByteString.EMPTY; + + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = null; + } else { + outputAudioConfig_ = null; + outputAudioConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse(this); + result.responseId_ = responseId_; + if (queryResultBuilder_ == null) { + result.queryResult_ = queryResult_; + } else { + result.queryResult_ = queryResultBuilder_.build(); + } + result.outputAudio_ = outputAudio_; + if (outputAudioConfigBuilder_ == null) { + result.outputAudioConfig_ = outputAudioConfig_; + } else { + result.outputAudioConfig_ = outputAudioConfigBuilder_.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.dialogflow.cx.v3beta1.FulfillIntentResponse) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse.getDefaultInstance()) + return this; + if (!other.getResponseId().isEmpty()) { + responseId_ = other.responseId_; + onChanged(); + } + if (other.hasQueryResult()) { + mergeQueryResult(other.getQueryResult()); + } + if (other.getOutputAudio() != com.google.protobuf.ByteString.EMPTY) { + setOutputAudio(other.getOutputAudio()); + } + if (other.hasOutputAudioConfig()) { + mergeOutputAudioConfig(other.getOutputAudioConfig()); + } + 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.dialogflow.cx.v3beta1.FulfillIntentResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object responseId_ = ""; + /** + * + * + *
+     * Output only. The unique identifier of the response. It can be used to
+     * locate a response in the training example set or for reporting issues.
+     * 
+ * + * string response_id = 1; + * + * @return The responseId. + */ + public java.lang.String getResponseId() { + java.lang.Object ref = responseId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + responseId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The unique identifier of the response. It can be used to
+     * locate a response in the training example set or for reporting issues.
+     * 
+ * + * string response_id = 1; + * + * @return The bytes for responseId. + */ + public com.google.protobuf.ByteString getResponseIdBytes() { + java.lang.Object ref = responseId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + responseId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The unique identifier of the response. It can be used to
+     * locate a response in the training example set or for reporting issues.
+     * 
+ * + * string response_id = 1; + * + * @param value The responseId to set. + * @return This builder for chaining. + */ + public Builder setResponseId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + responseId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique identifier of the response. It can be used to
+     * locate a response in the training example set or for reporting issues.
+     * 
+ * + * string response_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearResponseId() { + + responseId_ = getDefaultInstance().getResponseId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique identifier of the response. It can be used to
+     * locate a response in the training example set or for reporting issues.
+     * 
+ * + * string response_id = 1; + * + * @param value The bytes for responseId to set. + * @return This builder for chaining. + */ + public Builder setResponseIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + responseId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.QueryResult queryResult_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryResult, + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryResultOrBuilder> + queryResultBuilder_; + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + * + * @return Whether the queryResult field is set. + */ + public boolean hasQueryResult() { + return queryResultBuilder_ != null || queryResult_ != null; + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + * + * @return The queryResult. + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryResult getQueryResult() { + if (queryResultBuilder_ == null) { + return queryResult_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryResult.getDefaultInstance() + : queryResult_; + } else { + return queryResultBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + public Builder setQueryResult(com.google.cloud.dialogflow.cx.v3beta1.QueryResult value) { + if (queryResultBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryResult_ = value; + onChanged(); + } else { + queryResultBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + public Builder setQueryResult( + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.Builder builderForValue) { + if (queryResultBuilder_ == null) { + queryResult_ = builderForValue.build(); + onChanged(); + } else { + queryResultBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + public Builder mergeQueryResult(com.google.cloud.dialogflow.cx.v3beta1.QueryResult value) { + if (queryResultBuilder_ == null) { + if (queryResult_ != null) { + queryResult_ = + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.newBuilder(queryResult_) + .mergeFrom(value) + .buildPartial(); + } else { + queryResult_ = value; + } + onChanged(); + } else { + queryResultBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + public Builder clearQueryResult() { + if (queryResultBuilder_ == null) { + queryResult_ = null; + onChanged(); + } else { + queryResult_ = null; + queryResultBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryResult.Builder getQueryResultBuilder() { + + onChanged(); + return getQueryResultFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryResultOrBuilder getQueryResultOrBuilder() { + if (queryResultBuilder_ != null) { + return queryResultBuilder_.getMessageOrBuilder(); + } else { + return queryResult_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryResult.getDefaultInstance() + : queryResult_; + } + } + /** + * + * + *
+     * The result of the conversational query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryResult, + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryResultOrBuilder> + getQueryResultFieldBuilder() { + if (queryResultBuilder_ == null) { + queryResultBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryResult, + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryResultOrBuilder>( + getQueryResult(), getParentForChildren(), isClean()); + queryResult_ = null; + } + return queryResultBuilder_; + } + + private com.google.protobuf.ByteString outputAudio_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * Note: The output audio is generated based on the values of default platform
+     * text responses found in the
+     * [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] field. If
+     * multiple default text responses exist, they will be concatenated when
+     * generating audio. If no default platform text responses exist, the
+     * generated audio content will be empty.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * bytes output_audio = 3; + * + * @return The outputAudio. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputAudio() { + return outputAudio_; + } + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * Note: The output audio is generated based on the values of default platform
+     * text responses found in the
+     * [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] field. If
+     * multiple default text responses exist, they will be concatenated when
+     * generating audio. If no default platform text responses exist, the
+     * generated audio content will be empty.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * bytes output_audio = 3; + * + * @param value The outputAudio to set. + * @return This builder for chaining. + */ + public Builder setOutputAudio(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + outputAudio_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * Note: The output audio is generated based on the values of default platform
+     * text responses found in the
+     * [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] field. If
+     * multiple default text responses exist, they will be concatenated when
+     * generating audio. If no default platform text responses exist, the
+     * generated audio content will be empty.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * bytes output_audio = 3; + * + * @return This builder for chaining. + */ + public Builder clearOutputAudio() { + + outputAudio_ = getDefaultInstance().getOutputAudio(); + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig outputAudioConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder> + outputAudioConfigBuilder_; + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return Whether the outputAudioConfig field is set. + */ + public boolean hasOutputAudioConfig() { + return outputAudioConfigBuilder_ != null || outputAudioConfig_ != null; + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return The outputAudioConfig. + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig() { + if (outputAudioConfigBuilder_ == null) { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } else { + return outputAudioConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public Builder setOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig value) { + if (outputAudioConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputAudioConfig_ = value; + onChanged(); + } else { + outputAudioConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public Builder setOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder builderForValue) { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = builderForValue.build(); + onChanged(); + } else { + outputAudioConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public Builder mergeOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig value) { + if (outputAudioConfigBuilder_ == null) { + if (outputAudioConfig_ != null) { + outputAudioConfig_ = + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.newBuilder( + outputAudioConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + outputAudioConfig_ = value; + } + onChanged(); + } else { + outputAudioConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public Builder clearOutputAudioConfig() { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = null; + onChanged(); + } else { + outputAudioConfig_ = null; + outputAudioConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder + getOutputAudioConfigBuilder() { + + onChanged(); + return getOutputAudioConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder + getOutputAudioConfigOrBuilder() { + if (outputAudioConfigBuilder_ != null) { + return outputAudioConfigBuilder_.getMessageOrBuilder(); + } else { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } + } + /** + * + * + *
+     * The config used by the speech synthesizer to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder> + getOutputAudioConfigFieldBuilder() { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder>( + getOutputAudioConfig(), getParentForChildren(), isClean()); + outputAudioConfig_ = null; + } + return outputAudioConfigBuilder_; + } + + @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.dialogflow.cx.v3beta1.FulfillIntentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FulfillIntentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FulfillIntentResponse(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.dialogflow.cx.v3beta1.FulfillIntentResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillIntentResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillIntentResponseOrBuilder.java new file mode 100644 index 000000000..7c9a92b54 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillIntentResponseOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface FulfillIntentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The unique identifier of the response. It can be used to
+   * locate a response in the training example set or for reporting issues.
+   * 
+ * + * string response_id = 1; + * + * @return The responseId. + */ + java.lang.String getResponseId(); + /** + * + * + *
+   * Output only. The unique identifier of the response. It can be used to
+   * locate a response in the training example set or for reporting issues.
+   * 
+ * + * string response_id = 1; + * + * @return The bytes for responseId. + */ + com.google.protobuf.ByteString getResponseIdBytes(); + + /** + * + * + *
+   * The result of the conversational query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + * + * @return Whether the queryResult field is set. + */ + boolean hasQueryResult(); + /** + * + * + *
+   * The result of the conversational query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + * + * @return The queryResult. + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryResult getQueryResult(); + /** + * + * + *
+   * The result of the conversational query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryResult query_result = 2; + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryResultOrBuilder getQueryResultOrBuilder(); + + /** + * + * + *
+   * The audio data bytes encoded as specified in the request.
+   * Note: The output audio is generated based on the values of default platform
+   * text responses found in the
+   * [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] field. If
+   * multiple default text responses exist, they will be concatenated when
+   * generating audio. If no default platform text responses exist, the
+   * generated audio content will be empty.
+   * In some scenarios, multiple output audio fields may be present in the
+   * response structure. In these cases, only the top-most-level audio output
+   * has content.
+   * 
+ * + * bytes output_audio = 3; + * + * @return The outputAudio. + */ + com.google.protobuf.ByteString getOutputAudio(); + + /** + * + * + *
+   * The config used by the speech synthesizer to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return Whether the outputAudioConfig field is set. + */ + boolean hasOutputAudioConfig(); + /** + * + * + *
+   * The config used by the speech synthesizer to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return The outputAudioConfig. + */ + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig(); + /** + * + * + *
+   * The config used by the speech synthesizer to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder getOutputAudioConfigOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Fulfillment.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Fulfillment.java new file mode 100644 index 000000000..f45b0543c --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Fulfillment.java @@ -0,0 +1,7348 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/fulfillment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * A fulfillment can do one or more of the following actions at the same time:
+ *   * Generate rich message responses.
+ *   * Set parameter values.
+ *   * Call the webhook.
+ * Fulfillments can be called at various stages in the [Page][google.cloud.dialogflow.cx.v3beta1.Page] or
+ * [Form][google.cloud.dialogflow.cx.v3beta1.Form] lifecycle. For example, when a [DetectIntentRequest][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest] drives a
+ * session to enter a new page, the page's entry fulfillment can add a static
+ * response to the [QueryResult][google.cloud.dialogflow.cx.v3beta1.QueryResult] in the returning [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse],
+ * call the webhook (for example, to load user data from a database), or both.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Fulfillment} + */ +public final class Fulfillment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Fulfillment) + FulfillmentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Fulfillment.newBuilder() to construct. + private Fulfillment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Fulfillment() { + messages_ = java.util.Collections.emptyList(); + webhook_ = ""; + tag_ = ""; + setParameterActions_ = java.util.Collections.emptyList(); + conditionalCases_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Fulfillment(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Fulfillment( + 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)) { + messages_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage>(); + mutable_bitField0_ |= 0x00000001; + } + messages_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + webhook_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + tag_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + setParameterActions_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction>(); + mutable_bitField0_ |= 0x00000002; + } + setParameterActions_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + .parser(), + extensionRegistry)); + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + conditionalCases_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases>(); + mutable_bitField0_ |= 0x00000004; + } + conditionalCases_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.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)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + setParameterActions_ = java.util.Collections.unmodifiableList(setParameterActions_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + conditionalCases_ = java.util.Collections.unmodifiableList(conditionalCases_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.class, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder.class); + } + + public interface SetParameterActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Display name of the parameter.
+     * 
+ * + * string parameter = 1; + * + * @return The parameter. + */ + java.lang.String getParameter(); + /** + * + * + *
+     * Display name of the parameter.
+     * 
+ * + * string parameter = 1; + * + * @return The bytes for parameter. + */ + com.google.protobuf.ByteString getParameterBytes(); + + /** + * + * + *
+     * The new value of the parameter. A null value clears the parameter.
+     * 
+ * + * .google.protobuf.Value value = 2; + * + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * + * + *
+     * The new value of the parameter. A null value clears the parameter.
+     * 
+ * + * .google.protobuf.Value value = 2; + * + * @return The value. + */ + com.google.protobuf.Value getValue(); + /** + * + * + *
+     * The new value of the parameter. A null value clears the parameter.
+     * 
+ * + * .google.protobuf.Value value = 2; + */ + com.google.protobuf.ValueOrBuilder getValueOrBuilder(); + } + /** + * + * + *
+   * Setting a parameter value.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction} + */ + public static final class SetParameterAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction) + SetParameterActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetParameterAction.newBuilder() to construct. + private SetParameterAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetParameterAction() { + parameter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetParameterAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetParameterAction( + 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(); + + parameter_ = s; + break; + } + case 18: + { + com.google.protobuf.Value.Builder subBuilder = null; + if (value_ != null) { + subBuilder = value_.toBuilder(); + } + value_ = input.readMessage(com.google.protobuf.Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(value_); + value_ = 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.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_SetParameterAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_SetParameterAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.class, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.Builder.class); + } + + public static final int PARAMETER_FIELD_NUMBER = 1; + private volatile java.lang.Object parameter_; + /** + * + * + *
+     * Display name of the parameter.
+     * 
+ * + * string parameter = 1; + * + * @return The parameter. + */ + @java.lang.Override + public java.lang.String getParameter() { + java.lang.Object ref = parameter_; + 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(); + parameter_ = s; + return s; + } + } + /** + * + * + *
+     * Display name of the parameter.
+     * 
+ * + * string parameter = 1; + * + * @return The bytes for parameter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParameterBytes() { + java.lang.Object ref = parameter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parameter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.Value value_; + /** + * + * + *
+     * The new value of the parameter. A null value clears the parameter.
+     * 
+ * + * .google.protobuf.Value value = 2; + * + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return value_ != null; + } + /** + * + * + *
+     * The new value of the parameter. A null value clears the parameter.
+     * 
+ * + * .google.protobuf.Value value = 2; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.Value getValue() { + return value_ == null ? com.google.protobuf.Value.getDefaultInstance() : value_; + } + /** + * + * + *
+     * The new value of the parameter. A null value clears the parameter.
+     * 
+ * + * .google.protobuf.Value value = 2; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getValueOrBuilder() { + return getValue(); + } + + 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 (!getParameterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parameter_); + } + if (value_ != null) { + output.writeMessage(2, getValue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParameterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parameter_); + } + if (value_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getValue()); + } + 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.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction other = + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction) obj; + + if (!getParameter().equals(other.getParameter())) return false; + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (!getValue().equals(other.getValue())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARAMETER_FIELD_NUMBER; + hash = (53 * hash) + getParameter().hashCode(); + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction 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.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction 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.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction 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.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + 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.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction 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.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction 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; + } + /** + * + * + *
+     * Setting a parameter value.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction) + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_SetParameterAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_SetParameterAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.class, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.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(); + parameter_ = ""; + + if (valueBuilder_ == null) { + value_ = null; + } else { + value_ = null; + valueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_SetParameterAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction build() { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction result = + new com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction(this); + result.parameter_ = parameter_; + if (valueBuilder_ == null) { + result.value_ = value_; + } else { + result.value_ = valueBuilder_.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.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + .getDefaultInstance()) return this; + if (!other.getParameter().isEmpty()) { + parameter_ = other.parameter_; + onChanged(); + } + if (other.hasValue()) { + mergeValue(other.getValue()); + } + 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.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parameter_ = ""; + /** + * + * + *
+       * Display name of the parameter.
+       * 
+ * + * string parameter = 1; + * + * @return The parameter. + */ + public java.lang.String getParameter() { + java.lang.Object ref = parameter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parameter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Display name of the parameter.
+       * 
+ * + * string parameter = 1; + * + * @return The bytes for parameter. + */ + public com.google.protobuf.ByteString getParameterBytes() { + java.lang.Object ref = parameter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parameter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Display name of the parameter.
+       * 
+ * + * string parameter = 1; + * + * @param value The parameter to set. + * @return This builder for chaining. + */ + public Builder setParameter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parameter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Display name of the parameter.
+       * 
+ * + * string parameter = 1; + * + * @return This builder for chaining. + */ + public Builder clearParameter() { + + parameter_ = getDefaultInstance().getParameter(); + onChanged(); + return this; + } + /** + * + * + *
+       * Display name of the parameter.
+       * 
+ * + * string parameter = 1; + * + * @param value The bytes for parameter to set. + * @return This builder for chaining. + */ + public Builder setParameterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parameter_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Value value_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + valueBuilder_; + /** + * + * + *
+       * The new value of the parameter. A null value clears the parameter.
+       * 
+ * + * .google.protobuf.Value value = 2; + * + * @return Whether the value field is set. + */ + public boolean hasValue() { + return valueBuilder_ != null || value_ != null; + } + /** + * + * + *
+       * The new value of the parameter. A null value clears the parameter.
+       * 
+ * + * .google.protobuf.Value value = 2; + * + * @return The value. + */ + public com.google.protobuf.Value getValue() { + if (valueBuilder_ == null) { + return value_ == null ? com.google.protobuf.Value.getDefaultInstance() : value_; + } else { + return valueBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The new value of the parameter. A null value clears the parameter.
+       * 
+ * + * .google.protobuf.Value value = 2; + */ + public Builder setValue(com.google.protobuf.Value value) { + if (valueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + valueBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The new value of the parameter. A null value clears the parameter.
+       * 
+ * + * .google.protobuf.Value value = 2; + */ + public Builder setValue(com.google.protobuf.Value.Builder builderForValue) { + if (valueBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + valueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The new value of the parameter. A null value clears the parameter.
+       * 
+ * + * .google.protobuf.Value value = 2; + */ + public Builder mergeValue(com.google.protobuf.Value value) { + if (valueBuilder_ == null) { + if (value_ != null) { + value_ = com.google.protobuf.Value.newBuilder(value_).mergeFrom(value).buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + valueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The new value of the parameter. A null value clears the parameter.
+       * 
+ * + * .google.protobuf.Value value = 2; + */ + public Builder clearValue() { + if (valueBuilder_ == null) { + value_ = null; + onChanged(); + } else { + value_ = null; + valueBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The new value of the parameter. A null value clears the parameter.
+       * 
+ * + * .google.protobuf.Value value = 2; + */ + public com.google.protobuf.Value.Builder getValueBuilder() { + + onChanged(); + return getValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The new value of the parameter. A null value clears the parameter.
+       * 
+ * + * .google.protobuf.Value value = 2; + */ + public com.google.protobuf.ValueOrBuilder getValueOrBuilder() { + if (valueBuilder_ != null) { + return valueBuilder_.getMessageOrBuilder(); + } else { + return value_ == null ? com.google.protobuf.Value.getDefaultInstance() : value_; + } + } + /** + * + * + *
+       * The new value of the parameter. A null value clears the parameter.
+       * 
+ * + * .google.protobuf.Value value = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getValueFieldBuilder() { + if (valueBuilder_ == null) { + valueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getValue(), getParentForChildren(), isClean()); + value_ = null; + } + return valueBuilder_; + } + + @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.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction) + private static final com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetParameterAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetParameterAction(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.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConditionalCasesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A list of cascading if-else conditions.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + java.util.List + getCasesList(); + /** + * + * + *
+     * A list of cascading if-else conditions.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case getCases(int index); + /** + * + * + *
+     * A list of cascading if-else conditions.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + int getCasesCount(); + /** + * + * + *
+     * A list of cascading if-else conditions.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.CaseOrBuilder> + getCasesOrBuilderList(); + /** + * + * + *
+     * A list of cascading if-else conditions.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.CaseOrBuilder + getCasesOrBuilder(int index); + } + /** + * + * + *
+   * A list of cascading if-else conditions. Cases are mutually exclusive.
+   * The first one with a matching condition is selected, all the rest ignored.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases} + */ + public static final class ConditionalCases extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + ConditionalCasesOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConditionalCases.newBuilder() to construct. + private ConditionalCases(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConditionalCases() { + cases_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConditionalCases(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ConditionalCases( + 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)) { + cases_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .Case>(); + mutable_bitField0_ |= 0x00000001; + } + cases_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .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)) { + cases_ = java.util.Collections.unmodifiableList(cases_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.class, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder.class); + } + + public interface CaseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The condition to activate and select this case. Empty means the
+       * condition is always true. The condition is evaluated against [form
+       * parameters][Form.parameters] or [session
+       * parameters][SessionInfo.parameters].
+       * See the [conditions
+       * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+       * 
+ * + * string condition = 1; + * + * @return The condition. + */ + java.lang.String getCondition(); + /** + * + * + *
+       * The condition to activate and select this case. Empty means the
+       * condition is always true. The condition is evaluated against [form
+       * parameters][Form.parameters] or [session
+       * parameters][SessionInfo.parameters].
+       * See the [conditions
+       * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+       * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + com.google.protobuf.ByteString getConditionBytes(); + + /** + * + * + *
+       * A list of case content.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent> + getCaseContentList(); + /** + * + * + *
+       * A list of case content.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + getCaseContent(int index); + /** + * + * + *
+       * A list of case content.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + int getCaseContentCount(); + /** + * + * + *
+       * A list of case content.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContentOrBuilder> + getCaseContentOrBuilderList(); + /** + * + * + *
+       * A list of case content.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContentOrBuilder + getCaseContentOrBuilder(int index); + } + /** + * + * + *
+     * Each case has a Boolean condition. When it is evaluated to be True, the
+     * corresponding messages will be selected and evaluated recursively.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case} + */ + public static final class Case extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case) + CaseOrBuilder { + private static final long serialVersionUID = 0L; + // Use Case.newBuilder() to construct. + private Case(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Case() { + condition_ = ""; + caseContent_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Case(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Case( + 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(); + + condition_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + caseContent_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent>(); + mutable_bitField0_ |= 0x00000001; + } + caseContent_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent.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)) { + caseContent_ = java.util.Collections.unmodifiableList(caseContent_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.class, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.Builder + .class); + } + + public interface CaseContentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Returned message.
+         * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + * + * @return Whether the message field is set. + */ + boolean hasMessage(); + /** + * + * + *
+         * Returned message.
+         * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + * + * @return The message. + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessage(); + /** + * + * + *
+         * Returned message.
+         * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder getMessageOrBuilder(); + + /** + * + * + *
+         * Additional cases to be evaluated.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + * + * @return Whether the additionalCases field is set. + */ + boolean hasAdditionalCases(); + /** + * + * + *
+         * Additional cases to be evaluated.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + * + * @return The additionalCases. + */ + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases getAdditionalCases(); + /** + * + * + *
+         * Additional cases to be evaluated.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder + getAdditionalCasesOrBuilder(); + + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + .CasesOrMessageCase + getCasesOrMessageCase(); + } + /** + * + * + *
+       * The list of messages or conditional cases to activate for this case.
+       * 
+ * + * Protobuf type {@code + * google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent} + */ + public static final class CaseContent extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent) + CaseContentOrBuilder { + private static final long serialVersionUID = 0L; + // Use CaseContent.newBuilder() to construct. + private CaseContent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CaseContent() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CaseContent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CaseContent( + 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.dialogflow.cx.v3beta1.ResponseMessage.Builder subBuilder = + null; + if (casesOrMessageCase_ == 1) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage) casesOrMessage_) + .toBuilder(); + } + casesOrMessage_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage) casesOrMessage_); + casesOrMessage_ = subBuilder.buildPartial(); + } + casesOrMessageCase_ = 1; + break; + } + case 18: + { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder + subBuilder = null; + if (casesOrMessageCase_ == 2) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + casesOrMessage_) + .toBuilder(); + } + casesOrMessage_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + casesOrMessage_); + casesOrMessage_ = subBuilder.buildPartial(); + } + casesOrMessageCase_ = 2; + 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.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_CaseContent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_CaseContent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent.class, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent.Builder.class); + } + + private int casesOrMessageCase_ = 0; + private java.lang.Object casesOrMessage_; + + public enum CasesOrMessageCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MESSAGE(1), + ADDITIONAL_CASES(2), + CASESORMESSAGE_NOT_SET(0); + private final int value; + + private CasesOrMessageCase(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 CasesOrMessageCase valueOf(int value) { + return forNumber(value); + } + + public static CasesOrMessageCase forNumber(int value) { + switch (value) { + case 1: + return MESSAGE; + case 2: + return ADDITIONAL_CASES; + case 0: + return CASESORMESSAGE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public CasesOrMessageCase getCasesOrMessageCase() { + return CasesOrMessageCase.forNumber(casesOrMessageCase_); + } + + public static final int MESSAGE_FIELD_NUMBER = 1; + /** + * + * + *
+         * Returned message.
+         * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + * + * @return Whether the message field is set. + */ + @java.lang.Override + public boolean hasMessage() { + return casesOrMessageCase_ == 1; + } + /** + * + * + *
+         * Returned message.
+         * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + * + * @return The message. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessage() { + if (casesOrMessageCase_ == 1) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage) casesOrMessage_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance(); + } + /** + * + * + *
+         * Returned message.
+         * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder + getMessageOrBuilder() { + if (casesOrMessageCase_ == 1) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage) casesOrMessage_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance(); + } + + public static final int ADDITIONAL_CASES_FIELD_NUMBER = 2; + /** + * + * + *
+         * Additional cases to be evaluated.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + * + * @return Whether the additionalCases field is set. + */ + @java.lang.Override + public boolean hasAdditionalCases() { + return casesOrMessageCase_ == 2; + } + /** + * + * + *
+         * Additional cases to be evaluated.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + * + * @return The additionalCases. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + getAdditionalCases() { + if (casesOrMessageCase_ == 2) { + return (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + casesOrMessage_; + } + return com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .getDefaultInstance(); + } + /** + * + * + *
+         * Additional cases to be evaluated.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder + getAdditionalCasesOrBuilder() { + if (casesOrMessageCase_ == 2) { + return (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + casesOrMessage_; + } + return com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .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 (casesOrMessageCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage) casesOrMessage_); + } + if (casesOrMessageCase_ == 2) { + output.writeMessage( + 2, + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + casesOrMessage_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (casesOrMessageCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage) casesOrMessage_); + } + if (casesOrMessageCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + casesOrMessage_); + } + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + other = + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent) + obj; + + if (!getCasesOrMessageCase().equals(other.getCasesOrMessageCase())) return false; + switch (casesOrMessageCase_) { + case 1: + if (!getMessage().equals(other.getMessage())) return false; + break; + case 2: + if (!getAdditionalCases().equals(other.getAdditionalCases())) 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 (casesOrMessageCase_) { + case 1: + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + break; + case 2: + hash = (37 * hash) + ADDITIONAL_CASES_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalCases().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + 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 list of messages or conditional cases to activate for this case.
+         * 
+ * + * Protobuf type {@code + * google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent) + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_CaseContent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_CaseContent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent.class, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent.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(); + casesOrMessageCase_ = 0; + casesOrMessage_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_CaseContent_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + build() { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + result = + new com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent(this); + if (casesOrMessageCase_ == 1) { + if (messageBuilder_ == null) { + result.casesOrMessage_ = casesOrMessage_; + } else { + result.casesOrMessage_ = messageBuilder_.build(); + } + } + if (casesOrMessageCase_ == 2) { + if (additionalCasesBuilder_ == null) { + result.casesOrMessage_ = casesOrMessage_; + } else { + result.casesOrMessage_ = additionalCasesBuilder_.build(); + } + } + result.casesOrMessageCase_ = casesOrMessageCase_; + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent.getDefaultInstance()) return this; + switch (other.getCasesOrMessageCase()) { + case MESSAGE: + { + mergeMessage(other.getMessage()); + break; + } + case ADDITIONAL_CASES: + { + mergeAdditionalCases(other.getAdditionalCases()); + break; + } + case CASESORMESSAGE_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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int casesOrMessageCase_ = 0; + private java.lang.Object casesOrMessage_; + + public CasesOrMessageCase getCasesOrMessageCase() { + return CasesOrMessageCase.forNumber(casesOrMessageCase_); + } + + public Builder clearCasesOrMessage() { + casesOrMessageCase_ = 0; + casesOrMessage_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder> + messageBuilder_; + /** + * + * + *
+           * Returned message.
+           * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + * + * @return Whether the message field is set. + */ + @java.lang.Override + public boolean hasMessage() { + return casesOrMessageCase_ == 1; + } + /** + * + * + *
+           * Returned message.
+           * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + * + * @return The message. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessage() { + if (messageBuilder_ == null) { + if (casesOrMessageCase_ == 1) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage) casesOrMessage_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance(); + } else { + if (casesOrMessageCase_ == 1) { + return messageBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance(); + } + } + /** + * + * + *
+           * Returned message.
+           * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + */ + public Builder setMessage(com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) { + if (messageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + casesOrMessage_ = value; + onChanged(); + } else { + messageBuilder_.setMessage(value); + } + casesOrMessageCase_ = 1; + return this; + } + /** + * + * + *
+           * Returned message.
+           * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + */ + public Builder setMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) { + if (messageBuilder_ == null) { + casesOrMessage_ = builderForValue.build(); + onChanged(); + } else { + messageBuilder_.setMessage(builderForValue.build()); + } + casesOrMessageCase_ = 1; + return this; + } + /** + * + * + *
+           * Returned message.
+           * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + */ + public Builder mergeMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) { + if (messageBuilder_ == null) { + if (casesOrMessageCase_ == 1 + && casesOrMessage_ + != com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage + .getDefaultInstance()) { + casesOrMessage_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage) + casesOrMessage_) + .mergeFrom(value) + .buildPartial(); + } else { + casesOrMessage_ = value; + } + onChanged(); + } else { + if (casesOrMessageCase_ == 1) { + messageBuilder_.mergeFrom(value); + } + messageBuilder_.setMessage(value); + } + casesOrMessageCase_ = 1; + return this; + } + /** + * + * + *
+           * Returned message.
+           * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + */ + public Builder clearMessage() { + if (messageBuilder_ == null) { + if (casesOrMessageCase_ == 1) { + casesOrMessageCase_ = 0; + casesOrMessage_ = null; + onChanged(); + } + } else { + if (casesOrMessageCase_ == 1) { + casesOrMessageCase_ = 0; + casesOrMessage_ = null; + } + messageBuilder_.clear(); + } + return this; + } + /** + * + * + *
+           * Returned message.
+           * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder + getMessageBuilder() { + return getMessageFieldBuilder().getBuilder(); + } + /** + * + * + *
+           * Returned message.
+           * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder + getMessageOrBuilder() { + if ((casesOrMessageCase_ == 1) && (messageBuilder_ != null)) { + return messageBuilder_.getMessageOrBuilder(); + } else { + if (casesOrMessageCase_ == 1) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage) casesOrMessage_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance(); + } + } + /** + * + * + *
+           * Returned message.
+           * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage message = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder> + getMessageFieldBuilder() { + if (messageBuilder_ == null) { + if (!(casesOrMessageCase_ == 1)) { + casesOrMessage_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance(); + } + messageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage) casesOrMessage_, + getParentForChildren(), + isClean()); + casesOrMessage_ = null; + } + casesOrMessageCase_ = 1; + onChanged(); + ; + return messageBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder> + additionalCasesBuilder_; + /** + * + * + *
+           * Additional cases to be evaluated.
+           * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + * + * @return Whether the additionalCases field is set. + */ + @java.lang.Override + public boolean hasAdditionalCases() { + return casesOrMessageCase_ == 2; + } + /** + * + * + *
+           * Additional cases to be evaluated.
+           * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + * + * @return The additionalCases. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + getAdditionalCases() { + if (additionalCasesBuilder_ == null) { + if (casesOrMessageCase_ == 2) { + return (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + casesOrMessage_; + } + return com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .getDefaultInstance(); + } else { + if (casesOrMessageCase_ == 2) { + return additionalCasesBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .getDefaultInstance(); + } + } + /** + * + * + *
+           * Additional cases to be evaluated.
+           * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + */ + public Builder setAdditionalCases( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases value) { + if (additionalCasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + casesOrMessage_ = value; + onChanged(); + } else { + additionalCasesBuilder_.setMessage(value); + } + casesOrMessageCase_ = 2; + return this; + } + /** + * + * + *
+           * Additional cases to be evaluated.
+           * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + */ + public Builder setAdditionalCases( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder + builderForValue) { + if (additionalCasesBuilder_ == null) { + casesOrMessage_ = builderForValue.build(); + onChanged(); + } else { + additionalCasesBuilder_.setMessage(builderForValue.build()); + } + casesOrMessageCase_ = 2; + return this; + } + /** + * + * + *
+           * Additional cases to be evaluated.
+           * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + */ + public Builder mergeAdditionalCases( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases value) { + if (additionalCasesBuilder_ == null) { + if (casesOrMessageCase_ == 2 + && casesOrMessage_ + != com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .getDefaultInstance()) { + casesOrMessage_ = + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + casesOrMessage_) + .mergeFrom(value) + .buildPartial(); + } else { + casesOrMessage_ = value; + } + onChanged(); + } else { + if (casesOrMessageCase_ == 2) { + additionalCasesBuilder_.mergeFrom(value); + } + additionalCasesBuilder_.setMessage(value); + } + casesOrMessageCase_ = 2; + return this; + } + /** + * + * + *
+           * Additional cases to be evaluated.
+           * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + */ + public Builder clearAdditionalCases() { + if (additionalCasesBuilder_ == null) { + if (casesOrMessageCase_ == 2) { + casesOrMessageCase_ = 0; + casesOrMessage_ = null; + onChanged(); + } + } else { + if (casesOrMessageCase_ == 2) { + casesOrMessageCase_ = 0; + casesOrMessage_ = null; + } + additionalCasesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+           * Additional cases to be evaluated.
+           * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder + getAdditionalCasesBuilder() { + return getAdditionalCasesFieldBuilder().getBuilder(); + } + /** + * + * + *
+           * Additional cases to be evaluated.
+           * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder + getAdditionalCasesOrBuilder() { + if ((casesOrMessageCase_ == 2) && (additionalCasesBuilder_ != null)) { + return additionalCasesBuilder_.getMessageOrBuilder(); + } else { + if (casesOrMessageCase_ == 2) { + return (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + casesOrMessage_; + } + return com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .getDefaultInstance(); + } + } + /** + * + * + *
+           * Additional cases to be evaluated.
+           * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases additional_cases = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder> + getAdditionalCasesFieldBuilder() { + if (additionalCasesBuilder_ == null) { + if (!(casesOrMessageCase_ == 2)) { + casesOrMessage_ = + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .getDefaultInstance(); + } + additionalCasesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + casesOrMessage_, + getParentForChildren(), + isClean()); + casesOrMessage_ = null; + } + casesOrMessageCase_ = 2; + onChanged(); + ; + return additionalCasesBuilder_; + } + + @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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent) + private static final com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .Case.CaseContent + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CaseContent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CaseContent(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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CONDITION_FIELD_NUMBER = 1; + private volatile java.lang.Object condition_; + /** + * + * + *
+       * The condition to activate and select this case. Empty means the
+       * condition is always true. The condition is evaluated against [form
+       * parameters][Form.parameters] or [session
+       * parameters][SessionInfo.parameters].
+       * See the [conditions
+       * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+       * 
+ * + * string condition = 1; + * + * @return The condition. + */ + @java.lang.Override + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + 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(); + condition_ = s; + return s; + } + } + /** + * + * + *
+       * The condition to activate and select this case. Empty means the
+       * condition is always true. The condition is evaluated against [form
+       * parameters][Form.parameters] or [session
+       * parameters][SessionInfo.parameters].
+       * See the [conditions
+       * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+       * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CASE_CONTENT_FIELD_NUMBER = 2; + private java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent> + caseContent_; + /** + * + * + *
+       * A list of case content.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent> + getCaseContentList() { + return caseContent_; + } + /** + * + * + *
+       * A list of case content.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContentOrBuilder> + getCaseContentOrBuilderList() { + return caseContent_; + } + /** + * + * + *
+       * A list of case content.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + @java.lang.Override + public int getCaseContentCount() { + return caseContent_.size(); + } + /** + * + * + *
+       * A list of case content.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + getCaseContent(int index) { + return caseContent_.get(index); + } + /** + * + * + *
+       * A list of case content.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContentOrBuilder + getCaseContentOrBuilder(int index) { + return caseContent_.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 (!getConditionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, condition_); + } + for (int i = 0; i < caseContent_.size(); i++) { + output.writeMessage(2, caseContent_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getConditionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, condition_); + } + for (int i = 0; i < caseContent_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, caseContent_.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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case other = + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case) obj; + + if (!getCondition().equals(other.getCondition())) return false; + if (!getCaseContentList().equals(other.getCaseContentList())) 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) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().hashCode(); + if (getCaseContentCount() > 0) { + hash = (37 * hash) + CASE_CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getCaseContentList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case 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; + } + /** + * + * + *
+       * Each case has a Boolean condition. When it is evaluated to be True, the
+       * corresponding messages will be selected and evaluated recursively.
+       * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case) + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.CaseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.class, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCaseContentFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + condition_ = ""; + + if (caseContentBuilder_ == null) { + caseContent_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + caseContentBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case build() { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case result = + new com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case(this); + int from_bitField0_ = bitField0_; + result.condition_ = condition_; + if (caseContentBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + caseContent_ = java.util.Collections.unmodifiableList(caseContent_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.caseContent_ = caseContent_; + } else { + result.caseContent_ = caseContentBuilder_.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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .getDefaultInstance()) return this; + if (!other.getCondition().isEmpty()) { + condition_ = other.condition_; + onChanged(); + } + if (caseContentBuilder_ == null) { + if (!other.caseContent_.isEmpty()) { + if (caseContent_.isEmpty()) { + caseContent_ = other.caseContent_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCaseContentIsMutable(); + caseContent_.addAll(other.caseContent_); + } + onChanged(); + } + } else { + if (!other.caseContent_.isEmpty()) { + if (caseContentBuilder_.isEmpty()) { + caseContentBuilder_.dispose(); + caseContentBuilder_ = null; + caseContent_ = other.caseContent_; + bitField0_ = (bitField0_ & ~0x00000001); + caseContentBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCaseContentFieldBuilder() + : null; + } else { + caseContentBuilder_.addAllMessages(other.caseContent_); + } + } + } + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object condition_ = ""; + /** + * + * + *
+         * The condition to activate and select this case. Empty means the
+         * condition is always true. The condition is evaluated against [form
+         * parameters][Form.parameters] or [session
+         * parameters][SessionInfo.parameters].
+         * See the [conditions
+         * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+         * 
+ * + * string condition = 1; + * + * @return The condition. + */ + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + condition_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The condition to activate and select this case. Empty means the
+         * condition is always true. The condition is evaluated against [form
+         * parameters][Form.parameters] or [session
+         * parameters][SessionInfo.parameters].
+         * See the [conditions
+         * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+         * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The condition to activate and select this case. Empty means the
+         * condition is always true. The condition is evaluated against [form
+         * parameters][Form.parameters] or [session
+         * parameters][SessionInfo.parameters].
+         * See the [conditions
+         * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+         * 
+ * + * string condition = 1; + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + condition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The condition to activate and select this case. Empty means the
+         * condition is always true. The condition is evaluated against [form
+         * parameters][Form.parameters] or [session
+         * parameters][SessionInfo.parameters].
+         * See the [conditions
+         * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+         * 
+ * + * string condition = 1; + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + + condition_ = getDefaultInstance().getCondition(); + onChanged(); + return this; + } + /** + * + * + *
+         * The condition to activate and select this case. Empty means the
+         * condition is always true. The condition is evaluated against [form
+         * parameters][Form.parameters] or [session
+         * parameters][SessionInfo.parameters].
+         * See the [conditions
+         * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+         * 
+ * + * string condition = 1; + * + * @param value The bytes for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + condition_ = value; + onChanged(); + return this; + } + + private java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent> + caseContent_ = java.util.Collections.emptyList(); + + private void ensureCaseContentIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + caseContent_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent>(caseContent_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + .Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContentOrBuilder> + caseContentBuilder_; + + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent> + getCaseContentList() { + if (caseContentBuilder_ == null) { + return java.util.Collections.unmodifiableList(caseContent_); + } else { + return caseContentBuilder_.getMessageList(); + } + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public int getCaseContentCount() { + if (caseContentBuilder_ == null) { + return caseContent_.size(); + } else { + return caseContentBuilder_.getCount(); + } + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + getCaseContent(int index) { + if (caseContentBuilder_ == null) { + return caseContent_.get(index); + } else { + return caseContentBuilder_.getMessage(index); + } + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public Builder setCaseContent( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + value) { + if (caseContentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaseContentIsMutable(); + caseContent_.set(index, value); + onChanged(); + } else { + caseContentBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public Builder setCaseContent( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + .Builder + builderForValue) { + if (caseContentBuilder_ == null) { + ensureCaseContentIsMutable(); + caseContent_.set(index, builderForValue.build()); + onChanged(); + } else { + caseContentBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public Builder addCaseContent( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + value) { + if (caseContentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaseContentIsMutable(); + caseContent_.add(value); + onChanged(); + } else { + caseContentBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public Builder addCaseContent( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + value) { + if (caseContentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaseContentIsMutable(); + caseContent_.add(index, value); + onChanged(); + } else { + caseContentBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public Builder addCaseContent( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + .Builder + builderForValue) { + if (caseContentBuilder_ == null) { + ensureCaseContentIsMutable(); + caseContent_.add(builderForValue.build()); + onChanged(); + } else { + caseContentBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public Builder addCaseContent( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + .Builder + builderForValue) { + if (caseContentBuilder_ == null) { + ensureCaseContentIsMutable(); + caseContent_.add(index, builderForValue.build()); + onChanged(); + } else { + caseContentBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public Builder addAllCaseContent( + java.lang.Iterable< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent> + values) { + if (caseContentBuilder_ == null) { + ensureCaseContentIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, caseContent_); + onChanged(); + } else { + caseContentBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public Builder clearCaseContent() { + if (caseContentBuilder_ == null) { + caseContent_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + caseContentBuilder_.clear(); + } + return this; + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public Builder removeCaseContent(int index) { + if (caseContentBuilder_ == null) { + ensureCaseContentIsMutable(); + caseContent_.remove(index); + onChanged(); + } else { + caseContentBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + .Builder + getCaseContentBuilder(int index) { + return getCaseContentFieldBuilder().getBuilder(index); + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContentOrBuilder + getCaseContentOrBuilder(int index) { + if (caseContentBuilder_ == null) { + return caseContent_.get(index); + } else { + return caseContentBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContentOrBuilder> + getCaseContentOrBuilderList() { + if (caseContentBuilder_ != null) { + return caseContentBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(caseContent_); + } + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + .Builder + addCaseContentBuilder() { + return getCaseContentFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent.getDefaultInstance()); + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + .Builder + addCaseContentBuilder(int index) { + return getCaseContentFieldBuilder() + .addBuilder( + index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent.getDefaultInstance()); + } + /** + * + * + *
+         * A list of case content.
+         * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent case_content = 2; + * + */ + public java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + .Builder> + getCaseContentBuilderList() { + return getCaseContentFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.CaseContent + .Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContentOrBuilder> + getCaseContentFieldBuilder() { + if (caseContentBuilder_ == null) { + caseContentBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .CaseContentOrBuilder>( + caseContent_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + caseContent_ = null; + } + return caseContentBuilder_; + } + + @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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case) + private static final com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Case parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Case(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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CASES_FIELD_NUMBER = 1; + private java.util.List + cases_; + /** + * + * + *
+     * A list of cascading if-else conditions.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + @java.lang.Override + public java.util.List + getCasesList() { + return cases_; + } + /** + * + * + *
+     * A list of cascading if-else conditions.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.CaseOrBuilder> + getCasesOrBuilderList() { + return cases_; + } + /** + * + * + *
+     * A list of cascading if-else conditions.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + @java.lang.Override + public int getCasesCount() { + return cases_.size(); + } + /** + * + * + *
+     * A list of cascading if-else conditions.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case getCases( + int index) { + return cases_.get(index); + } + /** + * + * + *
+     * A list of cascading if-else conditions.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.CaseOrBuilder + getCasesOrBuilder(int index) { + return cases_.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 < cases_.size(); i++) { + output.writeMessage(1, cases_.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 < cases_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, cases_.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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases other = + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) obj; + + if (!getCasesList().equals(other.getCasesList())) 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 (getCasesCount() > 0) { + hash = (37 * hash) + CASES_FIELD_NUMBER; + hash = (53 * hash) + getCasesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases 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 cascading if-else conditions. Cases are mutually exclusive.
+     * The first one with a matching condition is selected, all the rest ignored.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.class, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCasesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (casesBuilder_ == null) { + cases_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + casesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases build() { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases result = + new com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases(this); + int from_bitField0_ = bitField0_; + if (casesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + cases_ = java.util.Collections.unmodifiableList(cases_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.cases_ = cases_; + } else { + result.cases_ = casesBuilder_.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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .getDefaultInstance()) return this; + if (casesBuilder_ == null) { + if (!other.cases_.isEmpty()) { + if (cases_.isEmpty()) { + cases_ = other.cases_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCasesIsMutable(); + cases_.addAll(other.cases_); + } + onChanged(); + } + } else { + if (!other.cases_.isEmpty()) { + if (casesBuilder_.isEmpty()) { + casesBuilder_.dispose(); + casesBuilder_ = null; + cases_ = other.cases_; + bitField0_ = (bitField0_ & ~0x00000001); + casesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCasesFieldBuilder() + : null; + } else { + casesBuilder_.addAllMessages(other.cases_); + } + } + } + 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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case> + cases_ = java.util.Collections.emptyList(); + + private void ensureCasesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + cases_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case>(cases_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.CaseOrBuilder> + casesBuilder_; + + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case> + getCasesList() { + if (casesBuilder_ == null) { + return java.util.Collections.unmodifiableList(cases_); + } else { + return casesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public int getCasesCount() { + if (casesBuilder_ == null) { + return cases_.size(); + } else { + return casesBuilder_.getCount(); + } + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case getCases( + int index) { + if (casesBuilder_ == null) { + return cases_.get(index); + } else { + return casesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public Builder setCases( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case value) { + if (casesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCasesIsMutable(); + cases_.set(index, value); + onChanged(); + } else { + casesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public Builder setCases( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.Builder + builderForValue) { + if (casesBuilder_ == null) { + ensureCasesIsMutable(); + cases_.set(index, builderForValue.build()); + onChanged(); + } else { + casesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public Builder addCases( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case value) { + if (casesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCasesIsMutable(); + cases_.add(value); + onChanged(); + } else { + casesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public Builder addCases( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case value) { + if (casesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCasesIsMutable(); + cases_.add(index, value); + onChanged(); + } else { + casesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public Builder addCases( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.Builder + builderForValue) { + if (casesBuilder_ == null) { + ensureCasesIsMutable(); + cases_.add(builderForValue.build()); + onChanged(); + } else { + casesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public Builder addCases( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.Builder + builderForValue) { + if (casesBuilder_ == null) { + ensureCasesIsMutable(); + cases_.add(index, builderForValue.build()); + onChanged(); + } else { + casesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public Builder addAllCases( + java.lang.Iterable< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case> + values) { + if (casesBuilder_ == null) { + ensureCasesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, cases_); + onChanged(); + } else { + casesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public Builder clearCases() { + if (casesBuilder_ == null) { + cases_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + casesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public Builder removeCases(int index) { + if (casesBuilder_ == null) { + ensureCasesIsMutable(); + cases_.remove(index); + onChanged(); + } else { + casesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.Builder + getCasesBuilder(int index) { + return getCasesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.CaseOrBuilder + getCasesOrBuilder(int index) { + if (casesBuilder_ == null) { + return cases_.get(index); + } else { + return casesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.CaseOrBuilder> + getCasesOrBuilderList() { + if (casesBuilder_ != null) { + return casesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(cases_); + } + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.Builder + addCasesBuilder() { + return getCasesFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .getDefaultInstance()); + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.Builder + addCasesBuilder(int index) { + return getCasesFieldBuilder() + .addBuilder( + index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case + .getDefaultInstance()); + } + /** + * + * + *
+       * A list of cascading if-else conditions.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case cases = 1; + * + */ + public java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.Builder> + getCasesBuilderList() { + return getCasesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.CaseOrBuilder> + getCasesFieldBuilder() { + if (casesBuilder_ == null) { + casesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Case.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .CaseOrBuilder>( + cases_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + cases_ = null; + } + return casesBuilder_; + } + + @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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases) + private static final com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConditionalCases parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConditionalCases(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.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int MESSAGES_FIELD_NUMBER = 1; + private java.util.List messages_; + /** + * + * + *
+   * The list of rich message responses to present to the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + @java.lang.Override + public java.util.List getMessagesList() { + return messages_; + } + /** + * + * + *
+   * The list of rich message responses to present to the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + @java.lang.Override + public java.util.List + getMessagesOrBuilderList() { + return messages_; + } + /** + * + * + *
+   * The list of rich message responses to present to the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + @java.lang.Override + public int getMessagesCount() { + return messages_.size(); + } + /** + * + * + *
+   * The list of rich message responses to present to the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessages(int index) { + return messages_.get(index); + } + /** + * + * + *
+   * The list of rich message responses to present to the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder getMessagesOrBuilder( + int index) { + return messages_.get(index); + } + + public static final int WEBHOOK_FIELD_NUMBER = 2; + private volatile java.lang.Object webhook_; + /** + * + * + *
+   * The webhook to call.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * string webhook = 2 [(.google.api.resource_reference) = { ... } + * + * @return The webhook. + */ + @java.lang.Override + public java.lang.String getWebhook() { + java.lang.Object ref = webhook_; + 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(); + webhook_ = s; + return s; + } + } + /** + * + * + *
+   * The webhook to call.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * string webhook = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for webhook. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWebhookBytes() { + java.lang.Object ref = webhook_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + webhook_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TAG_FIELD_NUMBER = 3; + private volatile java.lang.Object tag_; + /** + * + * + *
+   * The tag used by the webhook to identify which fulfillment is being called.
+   * This field is required if `webhook` is specified.
+   * 
+ * + * string tag = 3; + * + * @return The tag. + */ + @java.lang.Override + public java.lang.String getTag() { + java.lang.Object ref = tag_; + 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(); + tag_ = s; + return s; + } + } + /** + * + * + *
+   * The tag used by the webhook to identify which fulfillment is being called.
+   * This field is required if `webhook` is specified.
+   * 
+ * + * string tag = 3; + * + * @return The bytes for tag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTagBytes() { + java.lang.Object ref = tag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SET_PARAMETER_ACTIONS_FIELD_NUMBER = 4; + private java.util.List + setParameterActions_; + /** + * + * + *
+   * Set parameter values before executing the webhook.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + @java.lang.Override + public java.util.List + getSetParameterActionsList() { + return setParameterActions_; + } + /** + * + * + *
+   * Set parameter values before executing the webhook.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterActionOrBuilder> + getSetParameterActionsOrBuilderList() { + return setParameterActions_; + } + /** + * + * + *
+   * Set parameter values before executing the webhook.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + @java.lang.Override + public int getSetParameterActionsCount() { + return setParameterActions_.size(); + } + /** + * + * + *
+   * Set parameter values before executing the webhook.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + getSetParameterActions(int index) { + return setParameterActions_.get(index); + } + /** + * + * + *
+   * Set parameter values before executing the webhook.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterActionOrBuilder + getSetParameterActionsOrBuilder(int index) { + return setParameterActions_.get(index); + } + + public static final int CONDITIONAL_CASES_FIELD_NUMBER = 5; + private java.util.List + conditionalCases_; + /** + * + * + *
+   * Conditional cases for this fulfillment.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + @java.lang.Override + public java.util.List + getConditionalCasesList() { + return conditionalCases_; + } + /** + * + * + *
+   * Conditional cases for this fulfillment.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder> + getConditionalCasesOrBuilderList() { + return conditionalCases_; + } + /** + * + * + *
+   * Conditional cases for this fulfillment.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + @java.lang.Override + public int getConditionalCasesCount() { + return conditionalCases_.size(); + } + /** + * + * + *
+   * Conditional cases for this fulfillment.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases getConditionalCases( + int index) { + return conditionalCases_.get(index); + } + /** + * + * + *
+   * Conditional cases for this fulfillment.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder + getConditionalCasesOrBuilder(int index) { + return conditionalCases_.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 < messages_.size(); i++) { + output.writeMessage(1, messages_.get(i)); + } + if (!getWebhookBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, webhook_); + } + if (!getTagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, tag_); + } + for (int i = 0; i < setParameterActions_.size(); i++) { + output.writeMessage(4, setParameterActions_.get(i)); + } + for (int i = 0; i < conditionalCases_.size(); i++) { + output.writeMessage(5, conditionalCases_.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 < messages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, messages_.get(i)); + } + if (!getWebhookBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, webhook_); + } + if (!getTagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, tag_); + } + for (int i = 0; i < setParameterActions_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, setParameterActions_.get(i)); + } + for (int i = 0; i < conditionalCases_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, conditionalCases_.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.dialogflow.cx.v3beta1.Fulfillment)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment other = + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment) obj; + + if (!getMessagesList().equals(other.getMessagesList())) return false; + if (!getWebhook().equals(other.getWebhook())) return false; + if (!getTag().equals(other.getTag())) return false; + if (!getSetParameterActionsList().equals(other.getSetParameterActionsList())) return false; + if (!getConditionalCasesList().equals(other.getConditionalCasesList())) 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 (getMessagesCount() > 0) { + hash = (37 * hash) + MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getMessagesList().hashCode(); + } + hash = (37 * hash) + WEBHOOK_FIELD_NUMBER; + hash = (53 * hash) + getWebhook().hashCode(); + hash = (37 * hash) + TAG_FIELD_NUMBER; + hash = (53 * hash) + getTag().hashCode(); + if (getSetParameterActionsCount() > 0) { + hash = (37 * hash) + SET_PARAMETER_ACTIONS_FIELD_NUMBER; + hash = (53 * hash) + getSetParameterActionsList().hashCode(); + } + if (getConditionalCasesCount() > 0) { + hash = (37 * hash) + CONDITIONAL_CASES_FIELD_NUMBER; + hash = (53 * hash) + getConditionalCasesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment 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.dialogflow.cx.v3beta1.Fulfillment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment 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.dialogflow.cx.v3beta1.Fulfillment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment 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.dialogflow.cx.v3beta1.Fulfillment parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment 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.dialogflow.cx.v3beta1.Fulfillment parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment 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.dialogflow.cx.v3beta1.Fulfillment 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 fulfillment can do one or more of the following actions at the same time:
+   *   * Generate rich message responses.
+   *   * Set parameter values.
+   *   * Call the webhook.
+   * Fulfillments can be called at various stages in the [Page][google.cloud.dialogflow.cx.v3beta1.Page] or
+   * [Form][google.cloud.dialogflow.cx.v3beta1.Form] lifecycle. For example, when a [DetectIntentRequest][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest] drives a
+   * session to enter a new page, the page's entry fulfillment can add a static
+   * response to the [QueryResult][google.cloud.dialogflow.cx.v3beta1.QueryResult] in the returning [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse],
+   * call the webhook (for example, to load user data from a database), or both.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Fulfillment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Fulfillment) + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.class, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMessagesFieldBuilder(); + getSetParameterActionsFieldBuilder(); + getConditionalCasesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + messagesBuilder_.clear(); + } + webhook_ = ""; + + tag_ = ""; + + if (setParameterActionsBuilder_ == null) { + setParameterActions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + setParameterActionsBuilder_.clear(); + } + if (conditionalCasesBuilder_ == null) { + conditionalCases_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + conditionalCasesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment build() { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment result = + new com.google.cloud.dialogflow.cx.v3beta1.Fulfillment(this); + int from_bitField0_ = bitField0_; + if (messagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.messages_ = messages_; + } else { + result.messages_ = messagesBuilder_.build(); + } + result.webhook_ = webhook_; + result.tag_ = tag_; + if (setParameterActionsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + setParameterActions_ = java.util.Collections.unmodifiableList(setParameterActions_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.setParameterActions_ = setParameterActions_; + } else { + result.setParameterActions_ = setParameterActionsBuilder_.build(); + } + if (conditionalCasesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + conditionalCases_ = java.util.Collections.unmodifiableList(conditionalCases_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.conditionalCases_ = conditionalCases_; + } else { + result.conditionalCases_ = conditionalCasesBuilder_.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.dialogflow.cx.v3beta1.Fulfillment) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.Fulfillment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Fulfillment other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.getDefaultInstance()) + return this; + if (messagesBuilder_ == null) { + if (!other.messages_.isEmpty()) { + if (messages_.isEmpty()) { + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMessagesIsMutable(); + messages_.addAll(other.messages_); + } + onChanged(); + } + } else { + if (!other.messages_.isEmpty()) { + if (messagesBuilder_.isEmpty()) { + messagesBuilder_.dispose(); + messagesBuilder_ = null; + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000001); + messagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMessagesFieldBuilder() + : null; + } else { + messagesBuilder_.addAllMessages(other.messages_); + } + } + } + if (!other.getWebhook().isEmpty()) { + webhook_ = other.webhook_; + onChanged(); + } + if (!other.getTag().isEmpty()) { + tag_ = other.tag_; + onChanged(); + } + if (setParameterActionsBuilder_ == null) { + if (!other.setParameterActions_.isEmpty()) { + if (setParameterActions_.isEmpty()) { + setParameterActions_ = other.setParameterActions_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSetParameterActionsIsMutable(); + setParameterActions_.addAll(other.setParameterActions_); + } + onChanged(); + } + } else { + if (!other.setParameterActions_.isEmpty()) { + if (setParameterActionsBuilder_.isEmpty()) { + setParameterActionsBuilder_.dispose(); + setParameterActionsBuilder_ = null; + setParameterActions_ = other.setParameterActions_; + bitField0_ = (bitField0_ & ~0x00000002); + setParameterActionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSetParameterActionsFieldBuilder() + : null; + } else { + setParameterActionsBuilder_.addAllMessages(other.setParameterActions_); + } + } + } + if (conditionalCasesBuilder_ == null) { + if (!other.conditionalCases_.isEmpty()) { + if (conditionalCases_.isEmpty()) { + conditionalCases_ = other.conditionalCases_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureConditionalCasesIsMutable(); + conditionalCases_.addAll(other.conditionalCases_); + } + onChanged(); + } + } else { + if (!other.conditionalCases_.isEmpty()) { + if (conditionalCasesBuilder_.isEmpty()) { + conditionalCasesBuilder_.dispose(); + conditionalCasesBuilder_ = null; + conditionalCases_ = other.conditionalCases_; + bitField0_ = (bitField0_ & ~0x00000004); + conditionalCasesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConditionalCasesFieldBuilder() + : null; + } else { + conditionalCasesBuilder_.addAllMessages(other.conditionalCases_); + } + } + } + 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.dialogflow.cx.v3beta1.Fulfillment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.Fulfillment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List messages_ = + java.util.Collections.emptyList(); + + private void ensureMessagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + messages_ = + new java.util.ArrayList( + messages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder> + messagesBuilder_; + + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public java.util.List + getMessagesList() { + if (messagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(messages_); + } else { + return messagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public int getMessagesCount() { + if (messagesBuilder_ == null) { + return messages_.size(); + } else { + return messagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessages(int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder setMessages( + int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.set(index, value); + onChanged(); + } else { + messagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder setMessages( + int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.set(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder addMessages(com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(value); + onChanged(); + } else { + messagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder addMessages( + int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(index, value); + onChanged(); + } else { + messagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder addMessages( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder addMessages( + int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder addAllMessages( + java.lang.Iterable + values) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, messages_); + onChanged(); + } else { + messagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder clearMessages() { + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + messagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder removeMessages(int index) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.remove(index); + onChanged(); + } else { + messagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder getMessagesBuilder( + int index) { + return getMessagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder getMessagesOrBuilder( + int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public java.util.List + getMessagesOrBuilderList() { + if (messagesBuilder_ != null) { + return messagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(messages_); + } + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder addMessagesBuilder() { + return getMessagesFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance()); + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder addMessagesBuilder( + int index) { + return getMessagesFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance()); + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public java.util.List + getMessagesBuilderList() { + return getMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder> + getMessagesFieldBuilder() { + if (messagesBuilder_ == null) { + messagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder>( + messages_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + messages_ = null; + } + return messagesBuilder_; + } + + private java.lang.Object webhook_ = ""; + /** + * + * + *
+     * The webhook to call.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * string webhook = 2 [(.google.api.resource_reference) = { ... } + * + * @return The webhook. + */ + public java.lang.String getWebhook() { + java.lang.Object ref = webhook_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + webhook_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The webhook to call.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * string webhook = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for webhook. + */ + public com.google.protobuf.ByteString getWebhookBytes() { + java.lang.Object ref = webhook_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + webhook_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The webhook to call.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * string webhook = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The webhook to set. + * @return This builder for chaining. + */ + public Builder setWebhook(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + webhook_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The webhook to call.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * string webhook = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearWebhook() { + + webhook_ = getDefaultInstance().getWebhook(); + onChanged(); + return this; + } + /** + * + * + *
+     * The webhook to call.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * string webhook = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for webhook to set. + * @return This builder for chaining. + */ + public Builder setWebhookBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + webhook_ = value; + onChanged(); + return this; + } + + private java.lang.Object tag_ = ""; + /** + * + * + *
+     * The tag used by the webhook to identify which fulfillment is being called.
+     * This field is required if `webhook` is specified.
+     * 
+ * + * string tag = 3; + * + * @return The tag. + */ + public java.lang.String getTag() { + java.lang.Object ref = tag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The tag used by the webhook to identify which fulfillment is being called.
+     * This field is required if `webhook` is specified.
+     * 
+ * + * string tag = 3; + * + * @return The bytes for tag. + */ + public com.google.protobuf.ByteString getTagBytes() { + java.lang.Object ref = tag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The tag used by the webhook to identify which fulfillment is being called.
+     * This field is required if `webhook` is specified.
+     * 
+ * + * string tag = 3; + * + * @param value The tag to set. + * @return This builder for chaining. + */ + public Builder setTag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + tag_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The tag used by the webhook to identify which fulfillment is being called.
+     * This field is required if `webhook` is specified.
+     * 
+ * + * string tag = 3; + * + * @return This builder for chaining. + */ + public Builder clearTag() { + + tag_ = getDefaultInstance().getTag(); + onChanged(); + return this; + } + /** + * + * + *
+     * The tag used by the webhook to identify which fulfillment is being called.
+     * This field is required if `webhook` is specified.
+     * 
+ * + * string tag = 3; + * + * @param value The bytes for tag to set. + * @return This builder for chaining. + */ + public Builder setTagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + tag_ = value; + onChanged(); + return this; + } + + private java.util.List + setParameterActions_ = java.util.Collections.emptyList(); + + private void ensureSetParameterActionsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + setParameterActions_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction>( + setParameterActions_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterActionOrBuilder> + setParameterActionsBuilder_; + + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public java.util.List + getSetParameterActionsList() { + if (setParameterActionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(setParameterActions_); + } else { + return setParameterActionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public int getSetParameterActionsCount() { + if (setParameterActionsBuilder_ == null) { + return setParameterActions_.size(); + } else { + return setParameterActionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + getSetParameterActions(int index) { + if (setParameterActionsBuilder_ == null) { + return setParameterActions_.get(index); + } else { + return setParameterActionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public Builder setSetParameterActions( + int index, com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction value) { + if (setParameterActionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSetParameterActionsIsMutable(); + setParameterActions_.set(index, value); + onChanged(); + } else { + setParameterActionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public Builder setSetParameterActions( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.Builder + builderForValue) { + if (setParameterActionsBuilder_ == null) { + ensureSetParameterActionsIsMutable(); + setParameterActions_.set(index, builderForValue.build()); + onChanged(); + } else { + setParameterActionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public Builder addSetParameterActions( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction value) { + if (setParameterActionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSetParameterActionsIsMutable(); + setParameterActions_.add(value); + onChanged(); + } else { + setParameterActionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public Builder addSetParameterActions( + int index, com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction value) { + if (setParameterActionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSetParameterActionsIsMutable(); + setParameterActions_.add(index, value); + onChanged(); + } else { + setParameterActionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public Builder addSetParameterActions( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.Builder + builderForValue) { + if (setParameterActionsBuilder_ == null) { + ensureSetParameterActionsIsMutable(); + setParameterActions_.add(builderForValue.build()); + onChanged(); + } else { + setParameterActionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public Builder addSetParameterActions( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.Builder + builderForValue) { + if (setParameterActionsBuilder_ == null) { + ensureSetParameterActionsIsMutable(); + setParameterActions_.add(index, builderForValue.build()); + onChanged(); + } else { + setParameterActionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public Builder addAllSetParameterActions( + java.lang.Iterable< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction> + values) { + if (setParameterActionsBuilder_ == null) { + ensureSetParameterActionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, setParameterActions_); + onChanged(); + } else { + setParameterActionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public Builder clearSetParameterActions() { + if (setParameterActionsBuilder_ == null) { + setParameterActions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + setParameterActionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public Builder removeSetParameterActions(int index) { + if (setParameterActionsBuilder_ == null) { + ensureSetParameterActionsIsMutable(); + setParameterActions_.remove(index); + onChanged(); + } else { + setParameterActionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.Builder + getSetParameterActionsBuilder(int index) { + return getSetParameterActionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterActionOrBuilder + getSetParameterActionsOrBuilder(int index) { + if (setParameterActionsBuilder_ == null) { + return setParameterActions_.get(index); + } else { + return setParameterActionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterActionOrBuilder> + getSetParameterActionsOrBuilderList() { + if (setParameterActionsBuilder_ != null) { + return setParameterActionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(setParameterActions_); + } + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.Builder + addSetParameterActionsBuilder() { + return getSetParameterActionsFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + .getDefaultInstance()); + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.Builder + addSetParameterActionsBuilder(int index) { + return getSetParameterActionsFieldBuilder() + .addBuilder( + index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction + .getDefaultInstance()); + } + /** + * + * + *
+     * Set parameter values before executing the webhook.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + public java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.Builder> + getSetParameterActionsBuilderList() { + return getSetParameterActionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterActionOrBuilder> + getSetParameterActionsFieldBuilder() { + if (setParameterActionsBuilder_ == null) { + setParameterActionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterActionOrBuilder>( + setParameterActions_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + setParameterActions_ = null; + } + return setParameterActionsBuilder_; + } + + private java.util.List + conditionalCases_ = java.util.Collections.emptyList(); + + private void ensureConditionalCasesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + conditionalCases_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases>( + conditionalCases_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder> + conditionalCasesBuilder_; + + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public java.util.List + getConditionalCasesList() { + if (conditionalCasesBuilder_ == null) { + return java.util.Collections.unmodifiableList(conditionalCases_); + } else { + return conditionalCasesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public int getConditionalCasesCount() { + if (conditionalCasesBuilder_ == null) { + return conditionalCases_.size(); + } else { + return conditionalCasesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases getConditionalCases( + int index) { + if (conditionalCasesBuilder_ == null) { + return conditionalCases_.get(index); + } else { + return conditionalCasesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public Builder setConditionalCases( + int index, com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases value) { + if (conditionalCasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionalCasesIsMutable(); + conditionalCases_.set(index, value); + onChanged(); + } else { + conditionalCasesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public Builder setConditionalCases( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder + builderForValue) { + if (conditionalCasesBuilder_ == null) { + ensureConditionalCasesIsMutable(); + conditionalCases_.set(index, builderForValue.build()); + onChanged(); + } else { + conditionalCasesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public Builder addConditionalCases( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases value) { + if (conditionalCasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionalCasesIsMutable(); + conditionalCases_.add(value); + onChanged(); + } else { + conditionalCasesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public Builder addConditionalCases( + int index, com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases value) { + if (conditionalCasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionalCasesIsMutable(); + conditionalCases_.add(index, value); + onChanged(); + } else { + conditionalCasesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public Builder addConditionalCases( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder + builderForValue) { + if (conditionalCasesBuilder_ == null) { + ensureConditionalCasesIsMutable(); + conditionalCases_.add(builderForValue.build()); + onChanged(); + } else { + conditionalCasesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public Builder addConditionalCases( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder + builderForValue) { + if (conditionalCasesBuilder_ == null) { + ensureConditionalCasesIsMutable(); + conditionalCases_.add(index, builderForValue.build()); + onChanged(); + } else { + conditionalCasesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public Builder addAllConditionalCases( + java.lang.Iterable< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases> + values) { + if (conditionalCasesBuilder_ == null) { + ensureConditionalCasesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conditionalCases_); + onChanged(); + } else { + conditionalCasesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public Builder clearConditionalCases() { + if (conditionalCasesBuilder_ == null) { + conditionalCases_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + conditionalCasesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public Builder removeConditionalCases(int index) { + if (conditionalCasesBuilder_ == null) { + ensureConditionalCasesIsMutable(); + conditionalCases_.remove(index); + onChanged(); + } else { + conditionalCasesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder + getConditionalCasesBuilder(int index) { + return getConditionalCasesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder + getConditionalCasesOrBuilder(int index) { + if (conditionalCasesBuilder_ == null) { + return conditionalCases_.get(index); + } else { + return conditionalCasesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder> + getConditionalCasesOrBuilderList() { + if (conditionalCasesBuilder_ != null) { + return conditionalCasesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conditionalCases_); + } + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder + addConditionalCasesBuilder() { + return getConditionalCasesFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .getDefaultInstance()); + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder + addConditionalCasesBuilder(int index) { + return getConditionalCasesFieldBuilder() + .addBuilder( + index, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases + .getDefaultInstance()); + } + /** + * + * + *
+     * Conditional cases for this fulfillment.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + public java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder> + getConditionalCasesBuilderList() { + return getConditionalCasesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder> + getConditionalCasesFieldBuilder() { + if (conditionalCasesBuilder_ == null) { + conditionalCasesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder>( + conditionalCases_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + conditionalCases_ = null; + } + return conditionalCasesBuilder_; + } + + @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.dialogflow.cx.v3beta1.Fulfillment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Fulfillment) + private static final com.google.cloud.dialogflow.cx.v3beta1.Fulfillment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Fulfillment(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Fulfillment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Fulfillment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Fulfillment(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.dialogflow.cx.v3beta1.Fulfillment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillmentOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillmentOrBuilder.java new file mode 100644 index 000000000..82858d573 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillmentOrBuilder.java @@ -0,0 +1,265 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/fulfillment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface FulfillmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Fulfillment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of rich message responses to present to the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + java.util.List getMessagesList(); + /** + * + * + *
+   * The list of rich message responses to present to the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessages(int index); + /** + * + * + *
+   * The list of rich message responses to present to the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + int getMessagesCount(); + /** + * + * + *
+   * The list of rich message responses to present to the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + java.util.List + getMessagesOrBuilderList(); + /** + * + * + *
+   * The list of rich message responses to present to the user.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder getMessagesOrBuilder(int index); + + /** + * + * + *
+   * The webhook to call.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * string webhook = 2 [(.google.api.resource_reference) = { ... } + * + * @return The webhook. + */ + java.lang.String getWebhook(); + /** + * + * + *
+   * The webhook to call.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * string webhook = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for webhook. + */ + com.google.protobuf.ByteString getWebhookBytes(); + + /** + * + * + *
+   * The tag used by the webhook to identify which fulfillment is being called.
+   * This field is required if `webhook` is specified.
+   * 
+ * + * string tag = 3; + * + * @return The tag. + */ + java.lang.String getTag(); + /** + * + * + *
+   * The tag used by the webhook to identify which fulfillment is being called.
+   * This field is required if `webhook` is specified.
+   * 
+ * + * string tag = 3; + * + * @return The bytes for tag. + */ + com.google.protobuf.ByteString getTagBytes(); + + /** + * + * + *
+   * Set parameter values before executing the webhook.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + java.util.List + getSetParameterActionsList(); + /** + * + * + *
+   * Set parameter values before executing the webhook.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction getSetParameterActions( + int index); + /** + * + * + *
+   * Set parameter values before executing the webhook.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + int getSetParameterActionsCount(); + /** + * + * + *
+   * Set parameter values before executing the webhook.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterActionOrBuilder> + getSetParameterActionsOrBuilderList(); + /** + * + * + *
+   * Set parameter values before executing the webhook.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterActionOrBuilder + getSetParameterActionsOrBuilder(int index); + + /** + * + * + *
+   * Conditional cases for this fulfillment.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + java.util.List + getConditionalCasesList(); + /** + * + * + *
+   * Conditional cases for this fulfillment.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases getConditionalCases( + int index); + /** + * + * + *
+   * Conditional cases for this fulfillment.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + int getConditionalCasesCount(); + /** + * + * + *
+   * Conditional cases for this fulfillment.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder> + getConditionalCasesOrBuilderList(); + /** + * + * + *
+   * Conditional cases for this fulfillment.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCasesOrBuilder + getConditionalCasesOrBuilder(int index); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillmentProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillmentProto.java new file mode 100644 index 000000000..da558718b --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FulfillmentProto.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/fulfillment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class FulfillmentProto { + private FulfillmentProto() {} + + 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_dialogflow_cx_v3beta1_Fulfillment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_SetParameterAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_SetParameterAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_CaseContent_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_CaseContent_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n4google/cloud/dialogflow/cx/v3beta1/ful" + + "fillment.proto\022\"google.cloud.dialogflow." + + "cx.v3beta1\032\031google/api/resource.proto\0329g" + + "oogle/cloud/dialogflow/cx/v3beta1/respon" + + "se_message.proto\032\034google/protobuf/struct" + + ".proto\032\034google/api/annotations.proto\"\344\006\n" + + "\013Fulfillment\022E\n\010messages\030\001 \003(\01323.google." + + "cloud.dialogflow.cx.v3beta1.ResponseMess" + + "age\0227\n\007webhook\030\002 \001(\tB&\372A#\n!dialogflow.go" + + "ogleapis.com/Webhook\022\013\n\003tag\030\003 \001(\t\022a\n\025set" + + "_parameter_actions\030\004 \003(\0132B.google.cloud." + + "dialogflow.cx.v3beta1.Fulfillment.SetPar" + + "ameterAction\022[\n\021conditional_cases\030\005 \003(\0132" + + "@.google.cloud.dialogflow.cx.v3beta1.Ful" + + "fillment.ConditionalCases\032N\n\022SetParamete" + + "rAction\022\021\n\tparameter\030\001 \001(\t\022%\n\005value\030\002 \001(" + + "\0132\026.google.protobuf.Value\032\267\003\n\020Conditiona" + + "lCases\022T\n\005cases\030\001 \003(\0132E.google.cloud.dia" + + "logflow.cx.v3beta1.Fulfillment.Condition" + + "alCases.Case\032\314\002\n\004Case\022\021\n\tcondition\030\001 \001(\t" + + "\022g\n\014case_content\030\002 \003(\0132Q.google.cloud.di" + + "alogflow.cx.v3beta1.Fulfillment.Conditio" + + "nalCases.Case.CaseContent\032\307\001\n\013CaseConten" + + "t\022F\n\007message\030\001 \001(\01323.google.cloud.dialog" + + "flow.cx.v3beta1.ResponseMessageH\000\022\\\n\020add" + + "itional_cases\030\002 \001(\0132@.google.cloud.dialo" + + "gflow.cx.v3beta1.Fulfillment.Conditional" + + "CasesH\000B\022\n\020cases_or_messageB\257\001\n&com.goog" + + "le.cloud.dialogflow.cx.v3beta1B\020Fulfillm" + + "entProtoP\001ZDgoogle.golang.org/genproto/g" + + "oogleapis/cloud/dialogflow/cx/v3beta1;cx" + + "\370\001\001\242\002\002DF\252\002\"Google.Cloud.Dialogflow.Cx.V3" + + "Beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_descriptor, + new java.lang.String[] { + "Messages", "Webhook", "Tag", "SetParameterActions", "ConditionalCases", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_SetParameterAction_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_SetParameterAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_SetParameterAction_descriptor, + new java.lang.String[] { + "Parameter", "Value", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_descriptor, + new java.lang.String[] { + "Cases", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_descriptor, + new java.lang.String[] { + "Condition", "CaseContent", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_CaseContent_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_CaseContent_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Fulfillment_ConditionalCases_Case_CaseContent_descriptor, + new java.lang.String[] { + "Message", "AdditionalCases", "CasesOrMessage", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GcsProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GcsProto.java new file mode 100644 index 000000000..6c2e87203 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GcsProto.java @@ -0,0 +1,60 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/gcs.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class GcsProto { + private GcsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + 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/dialogflow/cx/v3beta1/gcs" + + ".proto\022\"google.cloud.dialogflow.cx.v3bet" + + "a1\032\037google/api/field_behavior.proto\032\034goo" + + "gle/api/annotations.protoB\247\001\n&com.google" + + ".cloud.dialogflow.cx.v3beta1B\010GcsProtoP\001" + + "ZDgoogle.golang.org/genproto/googleapis/" + + "cloud/dialogflow/cx/v3beta1;cx\370\001\001\242\002\002DF\252\002" + + "\"Google.Cloud.Dialogflow.Cx.V3Beta1b\006pro" + + "to3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetAgentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetAgentRequest.java new file mode 100644 index 000000000..222abad8b --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetAgentRequest.java @@ -0,0 +1,658 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Agents.GetAgent][google.cloud.dialogflow.cx.v3beta1.Agents.GetAgent].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetAgentRequest} + */ +public final class GetAgentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.GetAgentRequest) + GetAgentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetAgentRequest.newBuilder() to construct. + private GetAgentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetAgentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetAgentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetAgentRequest( + 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.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetAgentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetAgentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the agent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the agent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.dialogflow.cx.v3beta1.GetAgentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest) 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.dialogflow.cx.v3beta1.GetAgentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest 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.dialogflow.cx.v3beta1.GetAgentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest 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.dialogflow.cx.v3beta1.GetAgentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest 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.dialogflow.cx.v3beta1.GetAgentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest 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.dialogflow.cx.v3beta1.GetAgentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest 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.dialogflow.cx.v3beta1.GetAgentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Agents.GetAgent][google.cloud.dialogflow.cx.v3beta1.Agents.GetAgent].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetAgentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.GetAgentRequest) + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetAgentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetAgentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest.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.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetAgentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest(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.dialogflow.cx.v3beta1.GetAgentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest.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.dialogflow.cx.v3beta1.GetAgentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the agent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the agent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the agent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the agent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the agent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.GetAgentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.GetAgentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAgentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetAgentRequest(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.dialogflow.cx.v3beta1.GetAgentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetAgentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetAgentRequestOrBuilder.java new file mode 100644 index 000000000..384a1eb6c --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetAgentRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface GetAgentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.GetAgentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the agent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the agent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetEntityTypeRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetEntityTypeRequest.java new file mode 100644 index 000000000..cfe896b79 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetEntityTypeRequest.java @@ -0,0 +1,907 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityType].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest} + */ +public final class GetEntityTypeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest) + GetEntityTypeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetEntityTypeRequest.newBuilder() to construct. + private GetEntityTypeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetEntityTypeRequest() { + name_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetEntityTypeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetEntityTypeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the entity type.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the entity type.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language to retrieve the entity type for. The following fields are
+   * language dependent:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language to retrieve the entity type for. The following fields are
+   * language dependent:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + 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 (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest 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.dialogflow.cx.v3beta1.GetEntityTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest 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.dialogflow.cx.v3beta1.GetEntityTypeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest 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.dialogflow.cx.v3beta1.GetEntityTypeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest 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.dialogflow.cx.v3beta1.GetEntityTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest 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.dialogflow.cx.v3beta1.GetEntityTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityType].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest) + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest.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_ = ""; + + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetEntityTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest(this); + result.name_ = name_; + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the entity type.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the entity type.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the entity type.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the entity type.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the entity type.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language to retrieve the entity type for. The following fields are
+     * language dependent:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language to retrieve the entity type for. The following fields are
+     * language dependent:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language to retrieve the entity type for. The following fields are
+     * language dependent:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language to retrieve the entity type for. The following fields are
+     * language dependent:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language to retrieve the entity type for. The following fields are
+     * language dependent:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetEntityTypeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetEntityTypeRequest(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.dialogflow.cx.v3beta1.GetEntityTypeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetEntityTypeRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetEntityTypeRequestOrBuilder.java new file mode 100644 index 000000000..b5a372ff0 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetEntityTypeRequestOrBuilder.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/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface GetEntityTypeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the entity type.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the entity type.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The language to retrieve the entity type for. The following fields are
+   * language dependent:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language to retrieve the entity type for. The following fields are
+   * language dependent:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetEnvironmentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetEnvironmentRequest.java new file mode 100644 index 000000000..891cb9903 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetEnvironmentRequest.java @@ -0,0 +1,668 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Environments.GetEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.GetEnvironment].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest} + */ +public final class GetEnvironmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest) + GetEnvironmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetEnvironmentRequest.newBuilder() to construct. + private GetEnvironmentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetEnvironmentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetEnvironmentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetEnvironmentRequest( + 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.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetEnvironmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetEnvironmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.dialogflow.cx.v3beta1.GetEnvironmentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest) 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.dialogflow.cx.v3beta1.GetEnvironmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest 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.dialogflow.cx.v3beta1.GetEnvironmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest 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.dialogflow.cx.v3beta1.GetEnvironmentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest 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.dialogflow.cx.v3beta1.GetEnvironmentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest 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.dialogflow.cx.v3beta1.GetEnvironmentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest 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.dialogflow.cx.v3beta1.GetEnvironmentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Environments.GetEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.GetEnvironment].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest) + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetEnvironmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetEnvironmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest.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.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetEnvironmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest(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.dialogflow.cx.v3beta1.GetEnvironmentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest.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.dialogflow.cx.v3beta1.GetEnvironmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.GetEnvironmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetEnvironmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetEnvironmentRequest(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.dialogflow.cx.v3beta1.GetEnvironmentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetEnvironmentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetEnvironmentRequestOrBuilder.java new file mode 100644 index 000000000..5fe79ed64 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetEnvironmentRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface GetEnvironmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetFlowRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetFlowRequest.java new file mode 100644 index 000000000..c2595d2ff --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetFlowRequest.java @@ -0,0 +1,900 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The response message for [Flows.GetFlow][google.cloud.dialogflow.cx.v3beta1.Flows.GetFlow].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetFlowRequest} + */ +public final class GetFlowRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.GetFlowRequest) + GetFlowRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetFlowRequest.newBuilder() to construct. + private GetFlowRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetFlowRequest() { + name_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetFlowRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetFlowRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetFlowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetFlowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the flow to get.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the flow to get.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language to retrieve the flow for. The following fields are language
+   * dependent:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language to retrieve the flow for. The following fields are language
+   * dependent:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + 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 (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest 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.dialogflow.cx.v3beta1.GetFlowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest 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.dialogflow.cx.v3beta1.GetFlowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest 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.dialogflow.cx.v3beta1.GetFlowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest 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.dialogflow.cx.v3beta1.GetFlowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest 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.dialogflow.cx.v3beta1.GetFlowRequest 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 response message for [Flows.GetFlow][google.cloud.dialogflow.cx.v3beta1.Flows.GetFlow].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetFlowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.GetFlowRequest) + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetFlowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetFlowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest.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_ = ""; + + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetFlowRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest(this); + result.name_ = name_; + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the flow to get.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the flow to get.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the flow to get.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the flow to get.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the flow to get.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language to retrieve the flow for. The following fields are language
+     * dependent:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language to retrieve the flow for. The following fields are language
+     * dependent:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language to retrieve the flow for. The following fields are language
+     * dependent:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language to retrieve the flow for. The following fields are language
+     * dependent:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language to retrieve the flow for. The following fields are language
+     * dependent:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.GetFlowRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.GetFlowRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetFlowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetFlowRequest(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.dialogflow.cx.v3beta1.GetFlowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetFlowRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetFlowRequestOrBuilder.java new file mode 100644 index 000000000..be6669976 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetFlowRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface GetFlowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.GetFlowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the flow to get.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the flow to get.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The language to retrieve the flow for. The following fields are language
+   * dependent:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language to retrieve the flow for. The following fields are language
+   * dependent:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetIntentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetIntentRequest.java new file mode 100644 index 000000000..ab6929d58 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetIntentRequest.java @@ -0,0 +1,893 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Intents.GetIntent][google.cloud.dialogflow.cx.v3beta1.Intents.GetIntent].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetIntentRequest} + */ +public final class GetIntentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.GetIntentRequest) + GetIntentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetIntentRequest.newBuilder() to construct. + private GetIntentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetIntentRequest() { + name_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetIntentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetIntentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the intent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the intent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language to retrieve the intent for. The following fields are language
+   * dependent:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language to retrieve the intent for. The following fields are language
+   * dependent:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + 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 (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest 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.dialogflow.cx.v3beta1.GetIntentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest 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.dialogflow.cx.v3beta1.GetIntentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest 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.dialogflow.cx.v3beta1.GetIntentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest 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.dialogflow.cx.v3beta1.GetIntentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest 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.dialogflow.cx.v3beta1.GetIntentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Intents.GetIntent][google.cloud.dialogflow.cx.v3beta1.Intents.GetIntent].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetIntentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.GetIntentRequest) + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest.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_ = ""; + + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetIntentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest(this); + result.name_ = name_; + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the intent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the intent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the intent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the intent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the intent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language to retrieve the intent for. The following fields are language
+     * dependent:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language to retrieve the intent for. The following fields are language
+     * dependent:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language to retrieve the intent for. The following fields are language
+     * dependent:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language to retrieve the intent for. The following fields are language
+     * dependent:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language to retrieve the intent for. The following fields are language
+     * dependent:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.GetIntentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.GetIntentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetIntentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetIntentRequest(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.dialogflow.cx.v3beta1.GetIntentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetIntentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetIntentRequestOrBuilder.java new file mode 100644 index 000000000..e962020ff --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetIntentRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface GetIntentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.GetIntentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the intent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the intent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The language to retrieve the intent for. The following fields are language
+   * dependent:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language to retrieve the intent for. The following fields are language
+   * dependent:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetPageRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetPageRequest.java new file mode 100644 index 000000000..5c86aabd1 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetPageRequest.java @@ -0,0 +1,928 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Pages.GetPage][google.cloud.dialogflow.cx.v3beta1.Pages.GetPage].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetPageRequest} + */ +public final class GetPageRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.GetPageRequest) + GetPageRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetPageRequest.newBuilder() to construct. + private GetPageRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetPageRequest() { + name_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetPageRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetPageRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetPageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetPageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the page.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the page.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language to retrieve the page for. The following fields are language
+   * dependent:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language to retrieve the page for. The following fields are language
+   * dependent:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + 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 (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest 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.dialogflow.cx.v3beta1.GetPageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest 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.dialogflow.cx.v3beta1.GetPageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest 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.dialogflow.cx.v3beta1.GetPageRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest 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.dialogflow.cx.v3beta1.GetPageRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest 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.dialogflow.cx.v3beta1.GetPageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Pages.GetPage][google.cloud.dialogflow.cx.v3beta1.Pages.GetPage].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetPageRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.GetPageRequest) + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetPageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetPageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest.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_ = ""; + + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetPageRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest(this); + result.name_ = name_; + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the page.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the page.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the page.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the page.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the page.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language to retrieve the page for. The following fields are language
+     * dependent:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language to retrieve the page for. The following fields are language
+     * dependent:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language to retrieve the page for. The following fields are language
+     * dependent:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language to retrieve the page for. The following fields are language
+     * dependent:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language to retrieve the page for. The following fields are language
+     * dependent:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.GetPageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.GetPageRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPageRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetPageRequest(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.dialogflow.cx.v3beta1.GetPageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetPageRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetPageRequestOrBuilder.java new file mode 100644 index 000000000..28ae2bf8d --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetPageRequestOrBuilder.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface GetPageRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.GetPageRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the page.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the page.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The language to retrieve the page for. The following fields are language
+   * dependent:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language to retrieve the page for. The following fields are language
+   * dependent:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetSessionEntityTypeRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetSessionEntityTypeRequest.java new file mode 100644 index 000000000..a7b4433e1 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetSessionEntityTypeRequest.java @@ -0,0 +1,676 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.GetSessionEntityType].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest} + */ +public final class GetSessionEntityTypeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest) + GetSessionEntityTypeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetSessionEntityTypeRequest.newBuilder() to construct. + private GetSessionEntityTypeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSessionEntityTypeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSessionEntityTypeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetSessionEntityTypeRequest( + 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.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetSessionEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetSessionEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the session entity type.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the session entity type.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest) 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.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + 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.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.GetSessionEntityType].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest) + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetSessionEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetSessionEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest.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.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetSessionEntityTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest(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.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + .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.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the session entity type.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the session entity type.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the session entity type.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the session entity type.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the session entity type.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSessionEntityTypeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetSessionEntityTypeRequest(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.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetSessionEntityTypeRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetSessionEntityTypeRequestOrBuilder.java new file mode 100644 index 000000000..d02e20f56 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetSessionEntityTypeRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface GetSessionEntityTypeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the session entity type.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the session entity type.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetTransitionRouteGroupRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetTransitionRouteGroupRequest.java new file mode 100644 index 000000000..9c5ca089c --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetTransitionRouteGroupRequest.java @@ -0,0 +1,905 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [TransitionRouteGroups.GetTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.GetTransitionRouteGroup].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest} + */ +public final class GetTransitionRouteGroupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest) + GetTransitionRouteGroupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetTransitionRouteGroupRequest.newBuilder() to construct. + private GetTransitionRouteGroupRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetTransitionRouteGroupRequest() { + name_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetTransitionRouteGroupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetTransitionRouteGroupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetTransitionRouteGroupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetTransitionRouteGroupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + 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 (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + 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.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [TransitionRouteGroups.GetTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.GetTransitionRouteGroup].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest) + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetTransitionRouteGroupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetTransitionRouteGroupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest.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_ = ""; + + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetTransitionRouteGroupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest(this); + result.name_ = name_; + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetTransitionRouteGroupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetTransitionRouteGroupRequest(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.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetTransitionRouteGroupRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetTransitionRouteGroupRequestOrBuilder.java new file mode 100644 index 000000000..ac18f7ec6 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetTransitionRouteGroupRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface GetTransitionRouteGroupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetVersionRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetVersionRequest.java new file mode 100644 index 000000000..a7593ad28 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetVersionRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Versions.GetVersion][google.cloud.dialogflow.cx.v3beta1.Versions.GetVersion].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetVersionRequest} + */ +public final class GetVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.GetVersionRequest) + GetVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetVersionRequest.newBuilder() to construct. + private GetVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetVersionRequest( + 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.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.dialogflow.cx.v3beta1.GetVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest) 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.dialogflow.cx.v3beta1.GetVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest 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.dialogflow.cx.v3beta1.GetVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest 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.dialogflow.cx.v3beta1.GetVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest 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.dialogflow.cx.v3beta1.GetVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest 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.dialogflow.cx.v3beta1.GetVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest 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.dialogflow.cx.v3beta1.GetVersionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Versions.GetVersion][google.cloud.dialogflow.cx.v3beta1.Versions.GetVersion].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.GetVersionRequest) + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest.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.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest(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.dialogflow.cx.v3beta1.GetVersionRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest.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.dialogflow.cx.v3beta1.GetVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.GetVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.GetVersionRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetVersionRequest(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.dialogflow.cx.v3beta1.GetVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetVersionRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetVersionRequestOrBuilder.java new file mode 100644 index 000000000..26e34869c --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetVersionRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface GetVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.GetVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetWebhookRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetWebhookRequest.java new file mode 100644 index 000000000..fad0e1648 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetWebhookRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Webhooks.GetWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.GetWebhook].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest} + */ +public final class GetWebhookRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest) + GetWebhookRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetWebhookRequest.newBuilder() to construct. + private GetWebhookRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetWebhookRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetWebhookRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetWebhookRequest( + 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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetWebhookRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetWebhookRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the webhook.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the webhook.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.dialogflow.cx.v3beta1.GetWebhookRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest) 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.dialogflow.cx.v3beta1.GetWebhookRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest 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.dialogflow.cx.v3beta1.GetWebhookRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest 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.dialogflow.cx.v3beta1.GetWebhookRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest 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.dialogflow.cx.v3beta1.GetWebhookRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest 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.dialogflow.cx.v3beta1.GetWebhookRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest 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.dialogflow.cx.v3beta1.GetWebhookRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Webhooks.GetWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.GetWebhook].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest) + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetWebhookRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetWebhookRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest.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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_GetWebhookRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest(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.dialogflow.cx.v3beta1.GetWebhookRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest.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.dialogflow.cx.v3beta1.GetWebhookRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the webhook.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the webhook.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the webhook.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the webhook.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the webhook.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.GetWebhookRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetWebhookRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetWebhookRequest(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.dialogflow.cx.v3beta1.GetWebhookRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetWebhookRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetWebhookRequestOrBuilder.java new file mode 100644 index 000000000..08ce1b755 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/GetWebhookRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface GetWebhookRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the webhook.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the webhook.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/InputAudioConfig.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/InputAudioConfig.java new file mode 100644 index 000000000..40c7cb901 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/InputAudioConfig.java @@ -0,0 +1,1698 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Instructs the speech recognizer on how to process the audio content.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.InputAudioConfig} + */ +public final class InputAudioConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.InputAudioConfig) + InputAudioConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use InputAudioConfig.newBuilder() to construct. + private InputAudioConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InputAudioConfig() { + audioEncoding_ = 0; + phraseHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + model_ = ""; + modelVariant_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InputAudioConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private InputAudioConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + audioEncoding_ = rawValue; + break; + } + case 16: + { + sampleRateHertz_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + phraseHints_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + phraseHints_.add(s); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + model_ = s; + break; + } + case 64: + { + singleUtterance_ = input.readBool(); + break; + } + case 80: + { + int rawValue = input.readEnum(); + + modelVariant_ = rawValue; + break; + } + case 104: + { + enableWordInfo_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + phraseHints_ = phraseHints_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_InputAudioConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_InputAudioConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.class, + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.Builder.class); + } + + public static final int AUDIO_ENCODING_FIELD_NUMBER = 1; + private int audioEncoding_; + /** + * + * + *
+   * Required. Audio encoding of the audio content to process.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for audioEncoding. + */ + @java.lang.Override + public int getAudioEncodingValue() { + return audioEncoding_; + } + /** + * + * + *
+   * Required. Audio encoding of the audio content to process.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The audioEncoding. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.AudioEncoding getAudioEncoding() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.AudioEncoding result = + com.google.cloud.dialogflow.cx.v3beta1.AudioEncoding.valueOf(audioEncoding_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.AudioEncoding.UNRECOGNIZED + : result; + } + + public static final int SAMPLE_RATE_HERTZ_FIELD_NUMBER = 2; + private int sampleRateHertz_; + /** + * + * + *
+   * Sample rate (in Hertz) of the audio content sent in the query.
+   * Refer to
+   * [Cloud Speech API
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics) for
+   * more details.
+   * 
+ * + * int32 sample_rate_hertz = 2; + * + * @return The sampleRateHertz. + */ + @java.lang.Override + public int getSampleRateHertz() { + return sampleRateHertz_; + } + + public static final int ENABLE_WORD_INFO_FIELD_NUMBER = 13; + private boolean enableWordInfo_; + /** + * + * + *
+   * Optional. If `true`, Dialogflow returns [SpeechWordInfo][google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo] in
+   * [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult] with information about the recognized speech
+   * words, e.g. start and end time offsets. If false or unspecified, Speech
+   * doesn't return any word-level information.
+   * 
+ * + * bool enable_word_info = 13; + * + * @return The enableWordInfo. + */ + @java.lang.Override + public boolean getEnableWordInfo() { + return enableWordInfo_; + } + + public static final int PHRASE_HINTS_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList phraseHints_; + /** + * + * + *
+   * Optional. A list of strings containing words and phrases that the speech
+   * recognizer should recognize with higher likelihood.
+   * See [the Cloud Speech
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+   * for more details.
+   * 
+ * + * repeated string phrase_hints = 4; + * + * @return A list containing the phraseHints. + */ + public com.google.protobuf.ProtocolStringList getPhraseHintsList() { + return phraseHints_; + } + /** + * + * + *
+   * Optional. A list of strings containing words and phrases that the speech
+   * recognizer should recognize with higher likelihood.
+   * See [the Cloud Speech
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+   * for more details.
+   * 
+ * + * repeated string phrase_hints = 4; + * + * @return The count of phraseHints. + */ + public int getPhraseHintsCount() { + return phraseHints_.size(); + } + /** + * + * + *
+   * Optional. A list of strings containing words and phrases that the speech
+   * recognizer should recognize with higher likelihood.
+   * See [the Cloud Speech
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+   * for more details.
+   * 
+ * + * repeated string phrase_hints = 4; + * + * @param index The index of the element to return. + * @return The phraseHints at the given index. + */ + public java.lang.String getPhraseHints(int index) { + return phraseHints_.get(index); + } + /** + * + * + *
+   * Optional. A list of strings containing words and phrases that the speech
+   * recognizer should recognize with higher likelihood.
+   * See [the Cloud Speech
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+   * for more details.
+   * 
+ * + * repeated string phrase_hints = 4; + * + * @param index The index of the value to return. + * @return The bytes of the phraseHints at the given index. + */ + public com.google.protobuf.ByteString getPhraseHintsBytes(int index) { + return phraseHints_.getByteString(index); + } + + public static final int MODEL_FIELD_NUMBER = 7; + private volatile java.lang.Object model_; + /** + * + * + *
+   * Optional. Which Speech model to select for the given request. Select the
+   * model best suited to your domain to get best results. If a model is not
+   * explicitly specified, then we auto-select a model based on the parameters
+   * in the InputAudioConfig.
+   * If enhanced speech model is enabled for the agent and an enhanced
+   * version of the specified model for the language does not exist, then the
+   * speech is recognized using the standard version of the specified model.
+   * Refer to
+   * [Cloud Speech API
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+   * for more details.
+   * 
+ * + * string model = 7; + * + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Which Speech model to select for the given request. Select the
+   * model best suited to your domain to get best results. If a model is not
+   * explicitly specified, then we auto-select a model based on the parameters
+   * in the InputAudioConfig.
+   * If enhanced speech model is enabled for the agent and an enhanced
+   * version of the specified model for the language does not exist, then the
+   * speech is recognized using the standard version of the specified model.
+   * Refer to
+   * [Cloud Speech API
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+   * for more details.
+   * 
+ * + * string model = 7; + * + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODEL_VARIANT_FIELD_NUMBER = 10; + private int modelVariant_; + /** + * + * + *
+   * Optional. Which variant of the [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant model_variant = 10; + * + * @return The enum numeric value on the wire for modelVariant. + */ + @java.lang.Override + public int getModelVariantValue() { + return modelVariant_; + } + /** + * + * + *
+   * Optional. Which variant of the [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant model_variant = 10; + * + * @return The modelVariant. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant getModelVariant() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant result = + com.google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant.valueOf(modelVariant_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant.UNRECOGNIZED + : result; + } + + public static final int SINGLE_UTTERANCE_FIELD_NUMBER = 8; + private boolean singleUtterance_; + /** + * + * + *
+   * Optional. If `false` (default), recognition does not cease until the
+   * client closes the stream.
+   * If `true`, the recognizer will detect a single spoken utterance in input
+   * audio. Recognition ceases when it detects the audio's voice has
+   * stopped or paused. In this case, once a detected intent is received, the
+   * client should close the stream and start a new request with a new stream as
+   * needed.
+   * Note: This setting is relevant only for streaming methods.
+   * 
+ * + * bool single_utterance = 8; + * + * @return The singleUtterance. + */ + @java.lang.Override + public boolean getSingleUtterance() { + return singleUtterance_; + } + + 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 (audioEncoding_ + != com.google.cloud.dialogflow.cx.v3beta1.AudioEncoding.AUDIO_ENCODING_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, audioEncoding_); + } + if (sampleRateHertz_ != 0) { + output.writeInt32(2, sampleRateHertz_); + } + for (int i = 0; i < phraseHints_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, phraseHints_.getRaw(i)); + } + if (!getModelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, model_); + } + if (singleUtterance_ != false) { + output.writeBool(8, singleUtterance_); + } + if (modelVariant_ + != com.google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant + .SPEECH_MODEL_VARIANT_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, modelVariant_); + } + if (enableWordInfo_ != false) { + output.writeBool(13, enableWordInfo_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (audioEncoding_ + != com.google.cloud.dialogflow.cx.v3beta1.AudioEncoding.AUDIO_ENCODING_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, audioEncoding_); + } + if (sampleRateHertz_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, sampleRateHertz_); + } + { + int dataSize = 0; + for (int i = 0; i < phraseHints_.size(); i++) { + dataSize += computeStringSizeNoTag(phraseHints_.getRaw(i)); + } + size += dataSize; + size += 1 * getPhraseHintsList().size(); + } + if (!getModelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, model_); + } + if (singleUtterance_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(8, singleUtterance_); + } + if (modelVariant_ + != com.google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant + .SPEECH_MODEL_VARIANT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, modelVariant_); + } + if (enableWordInfo_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, enableWordInfo_); + } + 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.dialogflow.cx.v3beta1.InputAudioConfig)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig other = + (com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig) obj; + + if (audioEncoding_ != other.audioEncoding_) return false; + if (getSampleRateHertz() != other.getSampleRateHertz()) return false; + if (getEnableWordInfo() != other.getEnableWordInfo()) return false; + if (!getPhraseHintsList().equals(other.getPhraseHintsList())) return false; + if (!getModel().equals(other.getModel())) return false; + if (modelVariant_ != other.modelVariant_) return false; + if (getSingleUtterance() != other.getSingleUtterance()) 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) + AUDIO_ENCODING_FIELD_NUMBER; + hash = (53 * hash) + audioEncoding_; + hash = (37 * hash) + SAMPLE_RATE_HERTZ_FIELD_NUMBER; + hash = (53 * hash) + getSampleRateHertz(); + hash = (37 * hash) + ENABLE_WORD_INFO_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableWordInfo()); + if (getPhraseHintsCount() > 0) { + hash = (37 * hash) + PHRASE_HINTS_FIELD_NUMBER; + hash = (53 * hash) + getPhraseHintsList().hashCode(); + } + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + hash = (37 * hash) + MODEL_VARIANT_FIELD_NUMBER; + hash = (53 * hash) + modelVariant_; + hash = (37 * hash) + SINGLE_UTTERANCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSingleUtterance()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig 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.dialogflow.cx.v3beta1.InputAudioConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig 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.dialogflow.cx.v3beta1.InputAudioConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig 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.dialogflow.cx.v3beta1.InputAudioConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig 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.dialogflow.cx.v3beta1.InputAudioConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig 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.dialogflow.cx.v3beta1.InputAudioConfig 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; + } + /** + * + * + *
+   * Instructs the speech recognizer on how to process the audio content.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.InputAudioConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.InputAudioConfig) + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_InputAudioConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_InputAudioConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.class, + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.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(); + audioEncoding_ = 0; + + sampleRateHertz_ = 0; + + enableWordInfo_ = false; + + phraseHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + model_ = ""; + + modelVariant_ = 0; + + singleUtterance_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_InputAudioConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig build() { + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig result = + new com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig(this); + int from_bitField0_ = bitField0_; + result.audioEncoding_ = audioEncoding_; + result.sampleRateHertz_ = sampleRateHertz_; + result.enableWordInfo_ = enableWordInfo_; + if (((bitField0_ & 0x00000001) != 0)) { + phraseHints_ = phraseHints_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.phraseHints_ = phraseHints_; + result.model_ = model_; + result.modelVariant_ = modelVariant_; + result.singleUtterance_ = singleUtterance_; + 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.dialogflow.cx.v3beta1.InputAudioConfig) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.getDefaultInstance()) + return this; + if (other.audioEncoding_ != 0) { + setAudioEncodingValue(other.getAudioEncodingValue()); + } + if (other.getSampleRateHertz() != 0) { + setSampleRateHertz(other.getSampleRateHertz()); + } + if (other.getEnableWordInfo() != false) { + setEnableWordInfo(other.getEnableWordInfo()); + } + if (!other.phraseHints_.isEmpty()) { + if (phraseHints_.isEmpty()) { + phraseHints_ = other.phraseHints_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePhraseHintsIsMutable(); + phraseHints_.addAll(other.phraseHints_); + } + onChanged(); + } + if (!other.getModel().isEmpty()) { + model_ = other.model_; + onChanged(); + } + if (other.modelVariant_ != 0) { + setModelVariantValue(other.getModelVariantValue()); + } + if (other.getSingleUtterance() != false) { + setSingleUtterance(other.getSingleUtterance()); + } + 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.dialogflow.cx.v3beta1.InputAudioConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int audioEncoding_ = 0; + /** + * + * + *
+     * Required. Audio encoding of the audio content to process.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for audioEncoding. + */ + @java.lang.Override + public int getAudioEncodingValue() { + return audioEncoding_; + } + /** + * + * + *
+     * Required. Audio encoding of the audio content to process.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for audioEncoding to set. + * @return This builder for chaining. + */ + public Builder setAudioEncodingValue(int value) { + + audioEncoding_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Audio encoding of the audio content to process.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The audioEncoding. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.AudioEncoding getAudioEncoding() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.AudioEncoding result = + com.google.cloud.dialogflow.cx.v3beta1.AudioEncoding.valueOf(audioEncoding_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.AudioEncoding.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. Audio encoding of the audio content to process.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The audioEncoding to set. + * @return This builder for chaining. + */ + public Builder setAudioEncoding(com.google.cloud.dialogflow.cx.v3beta1.AudioEncoding value) { + if (value == null) { + throw new NullPointerException(); + } + + audioEncoding_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Audio encoding of the audio content to process.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearAudioEncoding() { + + audioEncoding_ = 0; + onChanged(); + return this; + } + + private int sampleRateHertz_; + /** + * + * + *
+     * Sample rate (in Hertz) of the audio content sent in the query.
+     * Refer to
+     * [Cloud Speech API
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics) for
+     * more details.
+     * 
+ * + * int32 sample_rate_hertz = 2; + * + * @return The sampleRateHertz. + */ + @java.lang.Override + public int getSampleRateHertz() { + return sampleRateHertz_; + } + /** + * + * + *
+     * Sample rate (in Hertz) of the audio content sent in the query.
+     * Refer to
+     * [Cloud Speech API
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics) for
+     * more details.
+     * 
+ * + * int32 sample_rate_hertz = 2; + * + * @param value The sampleRateHertz to set. + * @return This builder for chaining. + */ + public Builder setSampleRateHertz(int value) { + + sampleRateHertz_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Sample rate (in Hertz) of the audio content sent in the query.
+     * Refer to
+     * [Cloud Speech API
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics) for
+     * more details.
+     * 
+ * + * int32 sample_rate_hertz = 2; + * + * @return This builder for chaining. + */ + public Builder clearSampleRateHertz() { + + sampleRateHertz_ = 0; + onChanged(); + return this; + } + + private boolean enableWordInfo_; + /** + * + * + *
+     * Optional. If `true`, Dialogflow returns [SpeechWordInfo][google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo] in
+     * [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult] with information about the recognized speech
+     * words, e.g. start and end time offsets. If false or unspecified, Speech
+     * doesn't return any word-level information.
+     * 
+ * + * bool enable_word_info = 13; + * + * @return The enableWordInfo. + */ + @java.lang.Override + public boolean getEnableWordInfo() { + return enableWordInfo_; + } + /** + * + * + *
+     * Optional. If `true`, Dialogflow returns [SpeechWordInfo][google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo] in
+     * [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult] with information about the recognized speech
+     * words, e.g. start and end time offsets. If false or unspecified, Speech
+     * doesn't return any word-level information.
+     * 
+ * + * bool enable_word_info = 13; + * + * @param value The enableWordInfo to set. + * @return This builder for chaining. + */ + public Builder setEnableWordInfo(boolean value) { + + enableWordInfo_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If `true`, Dialogflow returns [SpeechWordInfo][google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo] in
+     * [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult] with information about the recognized speech
+     * words, e.g. start and end time offsets. If false or unspecified, Speech
+     * doesn't return any word-level information.
+     * 
+ * + * bool enable_word_info = 13; + * + * @return This builder for chaining. + */ + public Builder clearEnableWordInfo() { + + enableWordInfo_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList phraseHints_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePhraseHintsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + phraseHints_ = new com.google.protobuf.LazyStringArrayList(phraseHints_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Optional. A list of strings containing words and phrases that the speech
+     * recognizer should recognize with higher likelihood.
+     * See [the Cloud Speech
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+     * for more details.
+     * 
+ * + * repeated string phrase_hints = 4; + * + * @return A list containing the phraseHints. + */ + public com.google.protobuf.ProtocolStringList getPhraseHintsList() { + return phraseHints_.getUnmodifiableView(); + } + /** + * + * + *
+     * Optional. A list of strings containing words and phrases that the speech
+     * recognizer should recognize with higher likelihood.
+     * See [the Cloud Speech
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+     * for more details.
+     * 
+ * + * repeated string phrase_hints = 4; + * + * @return The count of phraseHints. + */ + public int getPhraseHintsCount() { + return phraseHints_.size(); + } + /** + * + * + *
+     * Optional. A list of strings containing words and phrases that the speech
+     * recognizer should recognize with higher likelihood.
+     * See [the Cloud Speech
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+     * for more details.
+     * 
+ * + * repeated string phrase_hints = 4; + * + * @param index The index of the element to return. + * @return The phraseHints at the given index. + */ + public java.lang.String getPhraseHints(int index) { + return phraseHints_.get(index); + } + /** + * + * + *
+     * Optional. A list of strings containing words and phrases that the speech
+     * recognizer should recognize with higher likelihood.
+     * See [the Cloud Speech
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+     * for more details.
+     * 
+ * + * repeated string phrase_hints = 4; + * + * @param index The index of the value to return. + * @return The bytes of the phraseHints at the given index. + */ + public com.google.protobuf.ByteString getPhraseHintsBytes(int index) { + return phraseHints_.getByteString(index); + } + /** + * + * + *
+     * Optional. A list of strings containing words and phrases that the speech
+     * recognizer should recognize with higher likelihood.
+     * See [the Cloud Speech
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+     * for more details.
+     * 
+ * + * repeated string phrase_hints = 4; + * + * @param index The index to set the value at. + * @param value The phraseHints to set. + * @return This builder for chaining. + */ + public Builder setPhraseHints(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseHintsIsMutable(); + phraseHints_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A list of strings containing words and phrases that the speech
+     * recognizer should recognize with higher likelihood.
+     * See [the Cloud Speech
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+     * for more details.
+     * 
+ * + * repeated string phrase_hints = 4; + * + * @param value The phraseHints to add. + * @return This builder for chaining. + */ + public Builder addPhraseHints(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseHintsIsMutable(); + phraseHints_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A list of strings containing words and phrases that the speech
+     * recognizer should recognize with higher likelihood.
+     * See [the Cloud Speech
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+     * for more details.
+     * 
+ * + * repeated string phrase_hints = 4; + * + * @param values The phraseHints to add. + * @return This builder for chaining. + */ + public Builder addAllPhraseHints(java.lang.Iterable values) { + ensurePhraseHintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, phraseHints_); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A list of strings containing words and phrases that the speech
+     * recognizer should recognize with higher likelihood.
+     * See [the Cloud Speech
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+     * for more details.
+     * 
+ * + * repeated string phrase_hints = 4; + * + * @return This builder for chaining. + */ + public Builder clearPhraseHints() { + phraseHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A list of strings containing words and phrases that the speech
+     * recognizer should recognize with higher likelihood.
+     * See [the Cloud Speech
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+     * for more details.
+     * 
+ * + * repeated string phrase_hints = 4; + * + * @param value The bytes of the phraseHints to add. + * @return This builder for chaining. + */ + public Builder addPhraseHintsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePhraseHintsIsMutable(); + phraseHints_.add(value); + onChanged(); + return this; + } + + private java.lang.Object model_ = ""; + /** + * + * + *
+     * Optional. Which Speech model to select for the given request. Select the
+     * model best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the InputAudioConfig.
+     * If enhanced speech model is enabled for the agent and an enhanced
+     * version of the specified model for the language does not exist, then the
+     * speech is recognized using the standard version of the specified model.
+     * Refer to
+     * [Cloud Speech API
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+     * for more details.
+     * 
+ * + * string model = 7; + * + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Which Speech model to select for the given request. Select the
+     * model best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the InputAudioConfig.
+     * If enhanced speech model is enabled for the agent and an enhanced
+     * version of the specified model for the language does not exist, then the
+     * speech is recognized using the standard version of the specified model.
+     * Refer to
+     * [Cloud Speech API
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+     * for more details.
+     * 
+ * + * string model = 7; + * + * @return The bytes for model. + */ + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Which Speech model to select for the given request. Select the
+     * model best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the InputAudioConfig.
+     * If enhanced speech model is enabled for the agent and an enhanced
+     * version of the specified model for the language does not exist, then the
+     * speech is recognized using the standard version of the specified model.
+     * Refer to
+     * [Cloud Speech API
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+     * for more details.
+     * 
+ * + * string model = 7; + * + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + model_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Which Speech model to select for the given request. Select the
+     * model best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the InputAudioConfig.
+     * If enhanced speech model is enabled for the agent and an enhanced
+     * version of the specified model for the language does not exist, then the
+     * speech is recognized using the standard version of the specified model.
+     * Refer to
+     * [Cloud Speech API
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+     * for more details.
+     * 
+ * + * string model = 7; + * + * @return This builder for chaining. + */ + public Builder clearModel() { + + model_ = getDefaultInstance().getModel(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Which Speech model to select for the given request. Select the
+     * model best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the InputAudioConfig.
+     * If enhanced speech model is enabled for the agent and an enhanced
+     * version of the specified model for the language does not exist, then the
+     * speech is recognized using the standard version of the specified model.
+     * Refer to
+     * [Cloud Speech API
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+     * for more details.
+     * 
+ * + * string model = 7; + * + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + model_ = value; + onChanged(); + return this; + } + + private int modelVariant_ = 0; + /** + * + * + *
+     * Optional. Which variant of the [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant model_variant = 10; + * + * @return The enum numeric value on the wire for modelVariant. + */ + @java.lang.Override + public int getModelVariantValue() { + return modelVariant_; + } + /** + * + * + *
+     * Optional. Which variant of the [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant model_variant = 10; + * + * @param value The enum numeric value on the wire for modelVariant to set. + * @return This builder for chaining. + */ + public Builder setModelVariantValue(int value) { + + modelVariant_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Which variant of the [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant model_variant = 10; + * + * @return The modelVariant. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant getModelVariant() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant result = + com.google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant.valueOf(modelVariant_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Which variant of the [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant model_variant = 10; + * + * @param value The modelVariant to set. + * @return This builder for chaining. + */ + public Builder setModelVariant( + com.google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant value) { + if (value == null) { + throw new NullPointerException(); + } + + modelVariant_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Which variant of the [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant model_variant = 10; + * + * @return This builder for chaining. + */ + public Builder clearModelVariant() { + + modelVariant_ = 0; + onChanged(); + return this; + } + + private boolean singleUtterance_; + /** + * + * + *
+     * Optional. If `false` (default), recognition does not cease until the
+     * client closes the stream.
+     * If `true`, the recognizer will detect a single spoken utterance in input
+     * audio. Recognition ceases when it detects the audio's voice has
+     * stopped or paused. In this case, once a detected intent is received, the
+     * client should close the stream and start a new request with a new stream as
+     * needed.
+     * Note: This setting is relevant only for streaming methods.
+     * 
+ * + * bool single_utterance = 8; + * + * @return The singleUtterance. + */ + @java.lang.Override + public boolean getSingleUtterance() { + return singleUtterance_; + } + /** + * + * + *
+     * Optional. If `false` (default), recognition does not cease until the
+     * client closes the stream.
+     * If `true`, the recognizer will detect a single spoken utterance in input
+     * audio. Recognition ceases when it detects the audio's voice has
+     * stopped or paused. In this case, once a detected intent is received, the
+     * client should close the stream and start a new request with a new stream as
+     * needed.
+     * Note: This setting is relevant only for streaming methods.
+     * 
+ * + * bool single_utterance = 8; + * + * @param value The singleUtterance to set. + * @return This builder for chaining. + */ + public Builder setSingleUtterance(boolean value) { + + singleUtterance_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If `false` (default), recognition does not cease until the
+     * client closes the stream.
+     * If `true`, the recognizer will detect a single spoken utterance in input
+     * audio. Recognition ceases when it detects the audio's voice has
+     * stopped or paused. In this case, once a detected intent is received, the
+     * client should close the stream and start a new request with a new stream as
+     * needed.
+     * Note: This setting is relevant only for streaming methods.
+     * 
+ * + * bool single_utterance = 8; + * + * @return This builder for chaining. + */ + public Builder clearSingleUtterance() { + + singleUtterance_ = 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.dialogflow.cx.v3beta1.InputAudioConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.InputAudioConfig) + private static final com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InputAudioConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InputAudioConfig(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.dialogflow.cx.v3beta1.InputAudioConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/InputAudioConfigOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/InputAudioConfigOrBuilder.java new file mode 100644 index 000000000..c01a08850 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/InputAudioConfigOrBuilder.java @@ -0,0 +1,244 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface InputAudioConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.InputAudioConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Audio encoding of the audio content to process.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for audioEncoding. + */ + int getAudioEncodingValue(); + /** + * + * + *
+   * Required. Audio encoding of the audio content to process.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The audioEncoding. + */ + com.google.cloud.dialogflow.cx.v3beta1.AudioEncoding getAudioEncoding(); + + /** + * + * + *
+   * Sample rate (in Hertz) of the audio content sent in the query.
+   * Refer to
+   * [Cloud Speech API
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics) for
+   * more details.
+   * 
+ * + * int32 sample_rate_hertz = 2; + * + * @return The sampleRateHertz. + */ + int getSampleRateHertz(); + + /** + * + * + *
+   * Optional. If `true`, Dialogflow returns [SpeechWordInfo][google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo] in
+   * [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult] with information about the recognized speech
+   * words, e.g. start and end time offsets. If false or unspecified, Speech
+   * doesn't return any word-level information.
+   * 
+ * + * bool enable_word_info = 13; + * + * @return The enableWordInfo. + */ + boolean getEnableWordInfo(); + + /** + * + * + *
+   * Optional. A list of strings containing words and phrases that the speech
+   * recognizer should recognize with higher likelihood.
+   * See [the Cloud Speech
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+   * for more details.
+   * 
+ * + * repeated string phrase_hints = 4; + * + * @return A list containing the phraseHints. + */ + java.util.List getPhraseHintsList(); + /** + * + * + *
+   * Optional. A list of strings containing words and phrases that the speech
+   * recognizer should recognize with higher likelihood.
+   * See [the Cloud Speech
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+   * for more details.
+   * 
+ * + * repeated string phrase_hints = 4; + * + * @return The count of phraseHints. + */ + int getPhraseHintsCount(); + /** + * + * + *
+   * Optional. A list of strings containing words and phrases that the speech
+   * recognizer should recognize with higher likelihood.
+   * See [the Cloud Speech
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+   * for more details.
+   * 
+ * + * repeated string phrase_hints = 4; + * + * @param index The index of the element to return. + * @return The phraseHints at the given index. + */ + java.lang.String getPhraseHints(int index); + /** + * + * + *
+   * Optional. A list of strings containing words and phrases that the speech
+   * recognizer should recognize with higher likelihood.
+   * See [the Cloud Speech
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
+   * for more details.
+   * 
+ * + * repeated string phrase_hints = 4; + * + * @param index The index of the value to return. + * @return The bytes of the phraseHints at the given index. + */ + com.google.protobuf.ByteString getPhraseHintsBytes(int index); + + /** + * + * + *
+   * Optional. Which Speech model to select for the given request. Select the
+   * model best suited to your domain to get best results. If a model is not
+   * explicitly specified, then we auto-select a model based on the parameters
+   * in the InputAudioConfig.
+   * If enhanced speech model is enabled for the agent and an enhanced
+   * version of the specified model for the language does not exist, then the
+   * speech is recognized using the standard version of the specified model.
+   * Refer to
+   * [Cloud Speech API
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+   * for more details.
+   * 
+ * + * string model = 7; + * + * @return The model. + */ + java.lang.String getModel(); + /** + * + * + *
+   * Optional. Which Speech model to select for the given request. Select the
+   * model best suited to your domain to get best results. If a model is not
+   * explicitly specified, then we auto-select a model based on the parameters
+   * in the InputAudioConfig.
+   * If enhanced speech model is enabled for the agent and an enhanced
+   * version of the specified model for the language does not exist, then the
+   * speech is recognized using the standard version of the specified model.
+   * Refer to
+   * [Cloud Speech API
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+   * for more details.
+   * 
+ * + * string model = 7; + * + * @return The bytes for model. + */ + com.google.protobuf.ByteString getModelBytes(); + + /** + * + * + *
+   * Optional. Which variant of the [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant model_variant = 10; + * + * @return The enum numeric value on the wire for modelVariant. + */ + int getModelVariantValue(); + /** + * + * + *
+   * Optional. Which variant of the [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant model_variant = 10; + * + * @return The modelVariant. + */ + com.google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant getModelVariant(); + + /** + * + * + *
+   * Optional. If `false` (default), recognition does not cease until the
+   * client closes the stream.
+   * If `true`, the recognizer will detect a single spoken utterance in input
+   * audio. Recognition ceases when it detects the audio's voice has
+   * stopped or paused. In this case, once a detected intent is received, the
+   * client should close the stream and start a new request with a new stream as
+   * needed.
+   * Note: This setting is relevant only for streaming methods.
+   * 
+ * + * bool single_utterance = 8; + * + * @return The singleUtterance. + */ + boolean getSingleUtterance(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Intent.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Intent.java new file mode 100644 index 000000000..8ae7089aa --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Intent.java @@ -0,0 +1,5825 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * An intent represents a user's intent to interact with a conversational agent.
+ * You can provide information for the Dialogflow API to use to match user input
+ * to an intent by adding training phrases (i.e., examples of user input) to
+ * your intent.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Intent} + */ +public final class Intent extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Intent) + IntentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Intent.newBuilder() to construct. + private Intent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Intent() { + name_ = ""; + displayName_ = ""; + trainingPhrases_ = java.util.Collections.emptyList(); + parameters_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Intent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Intent( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + trainingPhrases_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase>(); + mutable_bitField0_ |= 0x00000001; + } + trainingPhrases_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.parser(), + extensionRegistry)); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + parameters_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter>(); + mutable_bitField0_ |= 0x00000002; + } + parameters_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.parser(), + extensionRegistry)); + break; + } + case 40: + { + priority_ = input.readInt32(); + break; + } + case 48: + { + isFallback_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + trainingPhrases_ = java.util.Collections.unmodifiableList(trainingPhrases_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + parameters_ = java.util.Collections.unmodifiableList(parameters_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Intent.class, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder.class); + } + + public interface TrainingPhraseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. The unique identifier of the training phrase.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * Output only. The unique identifier of the training phrase.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * Required. The ordered list of training phrase parts.
+     * The parts are concatenated in order to form the training phrase.
+     * Note: The API does not automatically annotate training phrases like the
+     * Dialogflow Console does.
+     * Note: Do not forget to include whitespace at part boundaries, so the
+     * training phrase is well formatted when the parts are concatenated.
+     * If the training phrase does not need to be annotated with parameters,
+     * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+     * If you want to annotate the training phrase, you must create multiple
+     * parts, where the fields of each part are populated in one of two ways:
+     * -   `Part.text` is set to a part of the phrase that has no parameters.
+     * -   `Part.text` is set to a part of the phrase that you want to annotate,
+     *     and the `parameter_id` field is set.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getPartsList(); + /** + * + * + *
+     * Required. The ordered list of training phrase parts.
+     * The parts are concatenated in order to form the training phrase.
+     * Note: The API does not automatically annotate training phrases like the
+     * Dialogflow Console does.
+     * Note: Do not forget to include whitespace at part boundaries, so the
+     * training phrase is well formatted when the parts are concatenated.
+     * If the training phrase does not need to be annotated with parameters,
+     * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+     * If you want to annotate the training phrase, you must create multiple
+     * parts, where the fields of each part are populated in one of two ways:
+     * -   `Part.text` is set to a part of the phrase that has no parameters.
+     * -   `Part.text` is set to a part of the phrase that you want to annotate,
+     *     and the `parameter_id` field is set.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part getParts(int index); + /** + * + * + *
+     * Required. The ordered list of training phrase parts.
+     * The parts are concatenated in order to form the training phrase.
+     * Note: The API does not automatically annotate training phrases like the
+     * Dialogflow Console does.
+     * Note: Do not forget to include whitespace at part boundaries, so the
+     * training phrase is well formatted when the parts are concatenated.
+     * If the training phrase does not need to be annotated with parameters,
+     * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+     * If you want to annotate the training phrase, you must create multiple
+     * parts, where the fields of each part are populated in one of two ways:
+     * -   `Part.text` is set to a part of the phrase that has no parameters.
+     * -   `Part.text` is set to a part of the phrase that you want to annotate,
+     *     and the `parameter_id` field is set.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getPartsCount(); + /** + * + * + *
+     * Required. The ordered list of training phrase parts.
+     * The parts are concatenated in order to form the training phrase.
+     * Note: The API does not automatically annotate training phrases like the
+     * Dialogflow Console does.
+     * Note: Do not forget to include whitespace at part boundaries, so the
+     * training phrase is well formatted when the parts are concatenated.
+     * If the training phrase does not need to be annotated with parameters,
+     * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+     * If you want to annotate the training phrase, you must create multiple
+     * parts, where the fields of each part are populated in one of two ways:
+     * -   `Part.text` is set to a part of the phrase that has no parameters.
+     * -   `Part.text` is set to a part of the phrase that you want to annotate,
+     *     and the `parameter_id` field is set.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.PartOrBuilder> + getPartsOrBuilderList(); + /** + * + * + *
+     * Required. The ordered list of training phrase parts.
+     * The parts are concatenated in order to form the training phrase.
+     * Note: The API does not automatically annotate training phrases like the
+     * Dialogflow Console does.
+     * Note: Do not forget to include whitespace at part boundaries, so the
+     * training phrase is well formatted when the parts are concatenated.
+     * If the training phrase does not need to be annotated with parameters,
+     * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+     * If you want to annotate the training phrase, you must create multiple
+     * parts, where the fields of each part are populated in one of two ways:
+     * -   `Part.text` is set to a part of the phrase that has no parameters.
+     * -   `Part.text` is set to a part of the phrase that you want to annotate,
+     *     and the `parameter_id` field is set.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.PartOrBuilder getPartsOrBuilder( + int index); + + /** + * + * + *
+     * Indicates how many times this example was added to the intent.
+     * 
+ * + * int32 repeat_count = 3; + * + * @return The repeatCount. + */ + int getRepeatCount(); + } + /** + * + * + *
+   * Represents an example that the agent is trained on to identify the intent.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase} + */ + public static final class TrainingPhrase extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase) + TrainingPhraseOrBuilder { + private static final long serialVersionUID = 0L; + // Use TrainingPhrase.newBuilder() to construct. + private TrainingPhrase(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TrainingPhrase() { + id_ = ""; + parts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TrainingPhrase(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TrainingPhrase( + 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)) { + parts_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part>(); + mutable_bitField0_ |= 0x00000001; + } + parts_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.parser(), + extensionRegistry)); + break; + } + case 24: + { + repeatCount_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + parts_ = java.util.Collections.unmodifiableList(parts_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.class, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Builder.class); + } + + public interface PartOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Required. The text for this part.
+       * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The text. + */ + java.lang.String getText(); + /** + * + * + *
+       * Required. The text for this part.
+       * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); + + /** + * + * + *
+       * The [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] used to annotate this part of the
+       * training phrase. This field is required for annotated parts of the
+       * training phrase.
+       * 
+ * + * string parameter_id = 2; + * + * @return The parameterId. + */ + java.lang.String getParameterId(); + /** + * + * + *
+       * The [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] used to annotate this part of the
+       * training phrase. This field is required for annotated parts of the
+       * training phrase.
+       * 
+ * + * string parameter_id = 2; + * + * @return The bytes for parameterId. + */ + com.google.protobuf.ByteString getParameterIdBytes(); + } + /** + * + * + *
+     * Represents a part of a training phrase.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part} + */ + public static final class Part extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part) + PartOrBuilder { + private static final long serialVersionUID = 0L; + // Use Part.newBuilder() to construct. + private Part(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Part() { + text_ = ""; + parameterId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Part(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Part( + 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(); + + text_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + parameterId_ = 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.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_Part_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_Part_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.class, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.Builder.class); + } + + public static final int TEXT_FIELD_NUMBER = 1; + private volatile java.lang.Object text_; + /** + * + * + *
+       * Required. The text for this part.
+       * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = text_; + 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(); + text_ = s; + return s; + } + } + /** + * + * + *
+       * Required. The text for this part.
+       * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARAMETER_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object parameterId_; + /** + * + * + *
+       * The [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] used to annotate this part of the
+       * training phrase. This field is required for annotated parts of the
+       * training phrase.
+       * 
+ * + * string parameter_id = 2; + * + * @return The parameterId. + */ + @java.lang.Override + public java.lang.String getParameterId() { + java.lang.Object ref = parameterId_; + 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(); + parameterId_ = s; + return s; + } + } + /** + * + * + *
+       * The [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] used to annotate this part of the
+       * training phrase. This field is required for annotated parts of the
+       * training phrase.
+       * 
+ * + * string parameter_id = 2; + * + * @return The bytes for parameterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParameterIdBytes() { + java.lang.Object ref = parameterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parameterId_ = 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 (!getTextBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, text_); + } + if (!getParameterIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parameterId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTextBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, text_); + } + if (!getParameterIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parameterId_); + } + 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part other = + (com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part) obj; + + if (!getText().equals(other.getText())) return false; + if (!getParameterId().equals(other.getParameterId())) 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) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + hash = (37 * hash) + PARAMETER_ID_FIELD_NUMBER; + hash = (53 * hash) + getParameterId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Represents a part of a training phrase.
+       * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part) + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.PartOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_Part_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_Part_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.class, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.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(); + text_ = ""; + + parameterId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_Part_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part build() { + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part result = + new com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part(this); + result.text_ = text_; + result.parameterId_ = parameterId_; + 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + .getDefaultInstance()) return this; + if (!other.getText().isEmpty()) { + text_ = other.text_; + onChanged(); + } + if (!other.getParameterId().isEmpty()) { + parameterId_ = other.parameterId_; + 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object text_ = ""; + /** + * + * + *
+         * Required. The text for this part.
+         * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Required. The text for this part.
+         * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Required. The text for this part.
+         * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + text_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Required. The text for this part.
+         * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearText() { + + text_ = getDefaultInstance().getText(); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. The text for this part.
+         * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + text_ = value; + onChanged(); + return this; + } + + private java.lang.Object parameterId_ = ""; + /** + * + * + *
+         * The [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] used to annotate this part of the
+         * training phrase. This field is required for annotated parts of the
+         * training phrase.
+         * 
+ * + * string parameter_id = 2; + * + * @return The parameterId. + */ + public java.lang.String getParameterId() { + java.lang.Object ref = parameterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parameterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] used to annotate this part of the
+         * training phrase. This field is required for annotated parts of the
+         * training phrase.
+         * 
+ * + * string parameter_id = 2; + * + * @return The bytes for parameterId. + */ + public com.google.protobuf.ByteString getParameterIdBytes() { + java.lang.Object ref = parameterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parameterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] used to annotate this part of the
+         * training phrase. This field is required for annotated parts of the
+         * training phrase.
+         * 
+ * + * string parameter_id = 2; + * + * @param value The parameterId to set. + * @return This builder for chaining. + */ + public Builder setParameterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parameterId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] used to annotate this part of the
+         * training phrase. This field is required for annotated parts of the
+         * training phrase.
+         * 
+ * + * string parameter_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearParameterId() { + + parameterId_ = getDefaultInstance().getParameterId(); + onChanged(); + return this; + } + /** + * + * + *
+         * The [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] used to annotate this part of the
+         * training phrase. This field is required for annotated parts of the
+         * training phrase.
+         * 
+ * + * string parameter_id = 2; + * + * @param value The bytes for parameterId to set. + * @return This builder for chaining. + */ + public Builder setParameterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parameterId_ = 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part) + private static final com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Part parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Part(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.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+     * Output only. The unique identifier of the training phrase.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+     * Output only. The unique identifier of the training phrase.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + 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 PARTS_FIELD_NUMBER = 2; + private java.util.List + parts_; + /** + * + * + *
+     * Required. The ordered list of training phrase parts.
+     * The parts are concatenated in order to form the training phrase.
+     * Note: The API does not automatically annotate training phrases like the
+     * Dialogflow Console does.
+     * Note: Do not forget to include whitespace at part boundaries, so the
+     * training phrase is well formatted when the parts are concatenated.
+     * If the training phrase does not need to be annotated with parameters,
+     * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+     * If you want to annotate the training phrase, you must create multiple
+     * parts, where the fields of each part are populated in one of two ways:
+     * -   `Part.text` is set to a part of the phrase that has no parameters.
+     * -   `Part.text` is set to a part of the phrase that you want to annotate,
+     *     and the `parameter_id` field is set.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getPartsList() { + return parts_; + } + /** + * + * + *
+     * Required. The ordered list of training phrase parts.
+     * The parts are concatenated in order to form the training phrase.
+     * Note: The API does not automatically annotate training phrases like the
+     * Dialogflow Console does.
+     * Note: Do not forget to include whitespace at part boundaries, so the
+     * training phrase is well formatted when the parts are concatenated.
+     * If the training phrase does not need to be annotated with parameters,
+     * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+     * If you want to annotate the training phrase, you must create multiple
+     * parts, where the fields of each part are populated in one of two ways:
+     * -   `Part.text` is set to a part of the phrase that has no parameters.
+     * -   `Part.text` is set to a part of the phrase that you want to annotate,
+     *     and the `parameter_id` field is set.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.PartOrBuilder> + getPartsOrBuilderList() { + return parts_; + } + /** + * + * + *
+     * Required. The ordered list of training phrase parts.
+     * The parts are concatenated in order to form the training phrase.
+     * Note: The API does not automatically annotate training phrases like the
+     * Dialogflow Console does.
+     * Note: Do not forget to include whitespace at part boundaries, so the
+     * training phrase is well formatted when the parts are concatenated.
+     * If the training phrase does not need to be annotated with parameters,
+     * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+     * If you want to annotate the training phrase, you must create multiple
+     * parts, where the fields of each part are populated in one of two ways:
+     * -   `Part.text` is set to a part of the phrase that has no parameters.
+     * -   `Part.text` is set to a part of the phrase that you want to annotate,
+     *     and the `parameter_id` field is set.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getPartsCount() { + return parts_.size(); + } + /** + * + * + *
+     * Required. The ordered list of training phrase parts.
+     * The parts are concatenated in order to form the training phrase.
+     * Note: The API does not automatically annotate training phrases like the
+     * Dialogflow Console does.
+     * Note: Do not forget to include whitespace at part boundaries, so the
+     * training phrase is well formatted when the parts are concatenated.
+     * If the training phrase does not need to be annotated with parameters,
+     * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+     * If you want to annotate the training phrase, you must create multiple
+     * parts, where the fields of each part are populated in one of two ways:
+     * -   `Part.text` is set to a part of the phrase that has no parameters.
+     * -   `Part.text` is set to a part of the phrase that you want to annotate,
+     *     and the `parameter_id` field is set.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part getParts(int index) { + return parts_.get(index); + } + /** + * + * + *
+     * Required. The ordered list of training phrase parts.
+     * The parts are concatenated in order to form the training phrase.
+     * Note: The API does not automatically annotate training phrases like the
+     * Dialogflow Console does.
+     * Note: Do not forget to include whitespace at part boundaries, so the
+     * training phrase is well formatted when the parts are concatenated.
+     * If the training phrase does not need to be annotated with parameters,
+     * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+     * If you want to annotate the training phrase, you must create multiple
+     * parts, where the fields of each part are populated in one of two ways:
+     * -   `Part.text` is set to a part of the phrase that has no parameters.
+     * -   `Part.text` is set to a part of the phrase that you want to annotate,
+     *     and the `parameter_id` field is set.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.PartOrBuilder + getPartsOrBuilder(int index) { + return parts_.get(index); + } + + public static final int REPEAT_COUNT_FIELD_NUMBER = 3; + private int repeatCount_; + /** + * + * + *
+     * Indicates how many times this example was added to the intent.
+     * 
+ * + * int32 repeat_count = 3; + * + * @return The repeatCount. + */ + @java.lang.Override + public int getRepeatCount() { + return repeatCount_; + } + + 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 < parts_.size(); i++) { + output.writeMessage(2, parts_.get(i)); + } + if (repeatCount_ != 0) { + output.writeInt32(3, repeatCount_); + } + 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 < parts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, parts_.get(i)); + } + if (repeatCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, repeatCount_); + } + 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase other = + (com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase) obj; + + if (!getId().equals(other.getId())) return false; + if (!getPartsList().equals(other.getPartsList())) return false; + if (getRepeatCount() != other.getRepeatCount()) 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 (getPartsCount() > 0) { + hash = (37 * hash) + PARTS_FIELD_NUMBER; + hash = (53 * hash) + getPartsList().hashCode(); + } + hash = (37 * hash) + REPEAT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getRepeatCount(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Represents an example that the agent is trained on to identify the intent.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase) + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhraseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.class, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPartsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = ""; + + if (partsBuilder_ == null) { + parts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + partsBuilder_.clear(); + } + repeatCount_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase build() { + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase result = + new com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase(this); + int from_bitField0_ = bitField0_; + result.id_ = id_; + if (partsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + parts_ = java.util.Collections.unmodifiableList(parts_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.parts_ = parts_; + } else { + result.parts_ = partsBuilder_.build(); + } + result.repeatCount_ = repeatCount_; + 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (partsBuilder_ == null) { + if (!other.parts_.isEmpty()) { + if (parts_.isEmpty()) { + parts_ = other.parts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePartsIsMutable(); + parts_.addAll(other.parts_); + } + onChanged(); + } + } else { + if (!other.parts_.isEmpty()) { + if (partsBuilder_.isEmpty()) { + partsBuilder_.dispose(); + partsBuilder_ = null; + parts_ = other.parts_; + bitField0_ = (bitField0_ & ~0x00000001); + partsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPartsFieldBuilder() + : null; + } else { + partsBuilder_.addAllMessages(other.parts_); + } + } + } + if (other.getRepeatCount() != 0) { + setRepeatCount(other.getRepeatCount()); + } + 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * Output only. The unique identifier of the training phrase.
+       * 
+ * + * 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; + } + } + /** + * + * + *
+       * Output only. The unique identifier of the training phrase.
+       * 
+ * + * 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; + } + } + /** + * + * + *
+       * Output only. The unique identifier of the training phrase.
+       * 
+ * + * 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; + } + /** + * + * + *
+       * Output only. The unique identifier of the training phrase.
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The unique identifier of the training phrase.
+       * 
+ * + * 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 java.util.List + parts_ = java.util.Collections.emptyList(); + + private void ensurePartsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + parts_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part>(parts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.PartOrBuilder> + partsBuilder_; + + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPartsList() { + if (partsBuilder_ == null) { + return java.util.Collections.unmodifiableList(parts_); + } else { + return partsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getPartsCount() { + if (partsBuilder_ == null) { + return parts_.size(); + } else { + return partsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part getParts(int index) { + if (partsBuilder_ == null) { + return parts_.get(index); + } else { + return partsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setParts( + int index, com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part value) { + if (partsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartsIsMutable(); + parts_.set(index, value); + onChanged(); + } else { + partsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setParts( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.Builder + builderForValue) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + parts_.set(index, builderForValue.build()); + onChanged(); + } else { + partsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addParts( + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part value) { + if (partsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartsIsMutable(); + parts_.add(value); + onChanged(); + } else { + partsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addParts( + int index, com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part value) { + if (partsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartsIsMutable(); + parts_.add(index, value); + onChanged(); + } else { + partsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addParts( + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.Builder + builderForValue) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + parts_.add(builderForValue.build()); + onChanged(); + } else { + partsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addParts( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.Builder + builderForValue) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + parts_.add(index, builderForValue.build()); + onChanged(); + } else { + partsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllParts( + java.lang.Iterable< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part> + values) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, parts_); + onChanged(); + } else { + partsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearParts() { + if (partsBuilder_ == null) { + parts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + partsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeParts(int index) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + parts_.remove(index); + onChanged(); + } else { + partsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.Builder + getPartsBuilder(int index) { + return getPartsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.PartOrBuilder + getPartsOrBuilder(int index) { + if (partsBuilder_ == null) { + return parts_.get(index); + } else { + return partsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.PartOrBuilder> + getPartsOrBuilderList() { + if (partsBuilder_ != null) { + return partsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(parts_); + } + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.Builder + addPartsBuilder() { + return getPartsFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + .getDefaultInstance()); + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.Builder + addPartsBuilder(int index) { + return getPartsFieldBuilder() + .addBuilder( + index, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part + .getDefaultInstance()); + } + /** + * + * + *
+       * Required. The ordered list of training phrase parts.
+       * The parts are concatenated in order to form the training phrase.
+       * Note: The API does not automatically annotate training phrases like the
+       * Dialogflow Console does.
+       * Note: Do not forget to include whitespace at part boundaries, so the
+       * training phrase is well formatted when the parts are concatenated.
+       * If the training phrase does not need to be annotated with parameters,
+       * you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set.
+       * If you want to annotate the training phrase, you must create multiple
+       * parts, where the fields of each part are populated in one of two ways:
+       * -   `Part.text` is set to a part of the phrase that has no parameters.
+       * -   `Part.text` is set to a part of the phrase that you want to annotate,
+       *     and the `parameter_id` field is set.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.Builder> + getPartsBuilderList() { + return getPartsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.PartOrBuilder> + getPartsFieldBuilder() { + if (partsBuilder_ == null) { + partsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.PartOrBuilder>( + parts_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + parts_ = null; + } + return partsBuilder_; + } + + private int repeatCount_; + /** + * + * + *
+       * Indicates how many times this example was added to the intent.
+       * 
+ * + * int32 repeat_count = 3; + * + * @return The repeatCount. + */ + @java.lang.Override + public int getRepeatCount() { + return repeatCount_; + } + /** + * + * + *
+       * Indicates how many times this example was added to the intent.
+       * 
+ * + * int32 repeat_count = 3; + * + * @param value The repeatCount to set. + * @return This builder for chaining. + */ + public Builder setRepeatCount(int value) { + + repeatCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Indicates how many times this example was added to the intent.
+       * 
+ * + * int32 repeat_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearRepeatCount() { + + repeatCount_ = 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.dialogflow.cx.v3beta1.Intent.TrainingPhrase) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase) + private static final com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TrainingPhrase parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TrainingPhrase(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.dialogflow.cx.v3beta1.Intent.TrainingPhrase + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ParameterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Intent.Parameter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The unique identifier of the parameter. This field
+     * is used by [training phrases][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase] to annotate their
+     * [parts][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part].
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * Required. The unique identifier of the parameter. This field
+     * is used by [training phrases][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase] to annotate their
+     * [parts][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part].
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * Required. The entity type of the parameter.
+     * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+     * ID>` for system entity types (for example,
+     * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+     * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+     * 
+ * + * + * string entity_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The entityType. + */ + java.lang.String getEntityType(); + /** + * + * + *
+     * Required. The entity type of the parameter.
+     * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+     * ID>` for system entity types (for example,
+     * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+     * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+     * 
+ * + * + * string entity_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for entityType. + */ + com.google.protobuf.ByteString getEntityTypeBytes(); + + /** + * + * + *
+     * Indicates whether the parameter represents a list of values.
+     * 
+ * + * bool is_list = 3; + * + * @return The isList. + */ + boolean getIsList(); + } + /** + * + * + *
+   * Represents an intent parameter.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Intent.Parameter} + */ + public static final class Parameter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Intent.Parameter) + ParameterOrBuilder { + private static final long serialVersionUID = 0L; + // Use Parameter.newBuilder() to construct. + private Parameter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Parameter() { + id_ = ""; + entityType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Parameter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Parameter( + 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(); + + entityType_ = s; + break; + } + case 24: + { + isList_ = 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.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_Parameter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_Parameter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.class, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+     * Required. The unique identifier of the parameter. This field
+     * is used by [training phrases][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase] to annotate their
+     * [parts][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part].
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The id. + */ + @java.lang.Override + 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. The unique identifier of the parameter. This field
+     * is used by [training phrases][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase] to annotate their
+     * [parts][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part].
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for id. + */ + @java.lang.Override + 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 ENTITY_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object entityType_; + /** + * + * + *
+     * Required. The entity type of the parameter.
+     * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+     * ID>` for system entity types (for example,
+     * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+     * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+     * 
+ * + * + * string entity_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The entityType. + */ + @java.lang.Override + public java.lang.String getEntityType() { + java.lang.Object ref = entityType_; + 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(); + entityType_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The entity type of the parameter.
+     * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+     * ID>` for system entity types (for example,
+     * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+     * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+     * 
+ * + * + * string entity_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for entityType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntityTypeBytes() { + java.lang.Object ref = entityType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entityType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IS_LIST_FIELD_NUMBER = 3; + private boolean isList_; + /** + * + * + *
+     * Indicates whether the parameter represents a list of values.
+     * 
+ * + * bool is_list = 3; + * + * @return The isList. + */ + @java.lang.Override + public boolean getIsList() { + return isList_; + } + + 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 (!getEntityTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, entityType_); + } + if (isList_ != false) { + output.writeBool(3, isList_); + } + 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 (!getEntityTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, entityType_); + } + if (isList_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, isList_); + } + 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.dialogflow.cx.v3beta1.Intent.Parameter)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter other = + (com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter) obj; + + if (!getId().equals(other.getId())) return false; + if (!getEntityType().equals(other.getEntityType())) return false; + if (getIsList() != other.getIsList()) 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) + ENTITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEntityType().hashCode(); + hash = (37 * hash) + IS_LIST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsList()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter 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.dialogflow.cx.v3beta1.Intent.Parameter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter 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.dialogflow.cx.v3beta1.Intent.Parameter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter 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.dialogflow.cx.v3beta1.Intent.Parameter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter 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.dialogflow.cx.v3beta1.Intent.Parameter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter 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.dialogflow.cx.v3beta1.Intent.Parameter prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Represents an intent parameter.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Intent.Parameter} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Intent.Parameter) + com.google.cloud.dialogflow.cx.v3beta1.Intent.ParameterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_Parameter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_Parameter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.class, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.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_ = ""; + + entityType_ = ""; + + isList_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_Parameter_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter build() { + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter result = + new com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter(this); + result.id_ = id_; + result.entityType_ = entityType_; + result.isList_ = isList_; + 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.dialogflow.cx.v3beta1.Intent.Parameter) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.getEntityType().isEmpty()) { + entityType_ = other.entityType_; + onChanged(); + } + if (other.getIsList() != false) { + setIsList(other.getIsList()); + } + 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.dialogflow.cx.v3beta1.Intent.Parameter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * Required. The unique identifier of the parameter. This field
+       * is used by [training phrases][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase] to annotate their
+       * [parts][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part].
+       * 
+ * + * 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. The unique identifier of the parameter. This field
+       * is used by [training phrases][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase] to annotate their
+       * [parts][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part].
+       * 
+ * + * 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. The unique identifier of the parameter. This field
+       * is used by [training phrases][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase] to annotate their
+       * [parts][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part].
+       * 
+ * + * 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. The unique identifier of the parameter. This field
+       * is used by [training phrases][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase] to annotate their
+       * [parts][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part].
+       * 
+ * + * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The unique identifier of the parameter. This field
+       * is used by [training phrases][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase] to annotate their
+       * [parts][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part].
+       * 
+ * + * 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 entityType_ = ""; + /** + * + * + *
+       * Required. The entity type of the parameter.
+       * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+       * ID>` for system entity types (for example,
+       * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+       * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+       * 
+ * + * + * string entity_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The entityType. + */ + public java.lang.String getEntityType() { + java.lang.Object ref = entityType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entityType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The entity type of the parameter.
+       * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+       * ID>` for system entity types (for example,
+       * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+       * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+       * 
+ * + * + * string entity_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for entityType. + */ + public com.google.protobuf.ByteString getEntityTypeBytes() { + java.lang.Object ref = entityType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entityType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The entity type of the parameter.
+       * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+       * ID>` for system entity types (for example,
+       * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+       * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+       * 
+ * + * + * string entity_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The entityType to set. + * @return This builder for chaining. + */ + public Builder setEntityType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entityType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The entity type of the parameter.
+       * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+       * ID>` for system entity types (for example,
+       * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+       * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+       * 
+ * + * + * string entity_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEntityType() { + + entityType_ = getDefaultInstance().getEntityType(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The entity type of the parameter.
+       * Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
+       * ID>` for system entity types (for example,
+       * `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
+       * `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+       * ID>/entityTypes/<Entity Type ID>` for developer entity types.
+       * 
+ * + * + * string entity_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for entityType to set. + * @return This builder for chaining. + */ + public Builder setEntityTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entityType_ = value; + onChanged(); + return this; + } + + private boolean isList_; + /** + * + * + *
+       * Indicates whether the parameter represents a list of values.
+       * 
+ * + * bool is_list = 3; + * + * @return The isList. + */ + @java.lang.Override + public boolean getIsList() { + return isList_; + } + /** + * + * + *
+       * Indicates whether the parameter represents a list of values.
+       * 
+ * + * bool is_list = 3; + * + * @param value The isList to set. + * @return This builder for chaining. + */ + public Builder setIsList(boolean value) { + + isList_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Indicates whether the parameter represents a list of values.
+       * 
+ * + * bool is_list = 3; + * + * @return This builder for chaining. + */ + public Builder clearIsList() { + + isList_ = 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.dialogflow.cx.v3beta1.Intent.Parameter) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Intent.Parameter) + private static final com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Parameter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Parameter(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.dialogflow.cx.v3beta1.Intent.Parameter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The unique identifier of the intent.
+   * Required for the [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent] method. [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent]
+   * populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The unique identifier of the intent.
+   * Required for the [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent] method. [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent]
+   * populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required. The human-readable name of the intent, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The human-readable name of the intent, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRAINING_PHRASES_FIELD_NUMBER = 3; + private java.util.List + trainingPhrases_; + /** + * + * + *
+   * The collection of training phrases the agent is trained on to identify the
+   * intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + @java.lang.Override + public java.util.List + getTrainingPhrasesList() { + return trainingPhrases_; + } + /** + * + * + *
+   * The collection of training phrases the agent is trained on to identify the
+   * intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhraseOrBuilder> + getTrainingPhrasesOrBuilderList() { + return trainingPhrases_; + } + /** + * + * + *
+   * The collection of training phrases the agent is trained on to identify the
+   * intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + @java.lang.Override + public int getTrainingPhrasesCount() { + return trainingPhrases_.size(); + } + /** + * + * + *
+   * The collection of training phrases the agent is trained on to identify the
+   * intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase getTrainingPhrases( + int index) { + return trainingPhrases_.get(index); + } + /** + * + * + *
+   * The collection of training phrases the agent is trained on to identify the
+   * intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhraseOrBuilder + getTrainingPhrasesOrBuilder(int index) { + return trainingPhrases_.get(index); + } + + public static final int PARAMETERS_FIELD_NUMBER = 4; + private java.util.List parameters_; + /** + * + * + *
+   * The collection of parameters associated with the intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + @java.lang.Override + public java.util.List + getParametersList() { + return parameters_; + } + /** + * + * + *
+   * The collection of parameters associated with the intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + @java.lang.Override + public java.util.List + getParametersOrBuilderList() { + return parameters_; + } + /** + * + * + *
+   * The collection of parameters associated with the intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + @java.lang.Override + public int getParametersCount() { + return parameters_.size(); + } + /** + * + * + *
+   * The collection of parameters associated with the intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter getParameters(int index) { + return parameters_.get(index); + } + /** + * + * + *
+   * The collection of parameters associated with the intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent.ParameterOrBuilder getParametersOrBuilder( + int index) { + return parameters_.get(index); + } + + public static final int PRIORITY_FIELD_NUMBER = 5; + private int priority_; + /** + * + * + *
+   * The priority of this intent. Higher numbers represent higher
+   * priorities.
+   * - If the supplied value is unspecified or 0, the service
+   *   translates the value to 500,000, which corresponds to the
+   *   `Normal` priority in the console.
+   * - If the supplied value is negative, the intent is ignored
+   *   in runtime detect intent requests.
+   * 
+ * + * int32 priority = 5; + * + * @return The priority. + */ + @java.lang.Override + public int getPriority() { + return priority_; + } + + public static final int IS_FALLBACK_FIELD_NUMBER = 6; + private boolean isFallback_; + /** + * + * + *
+   * Indicates whether this is a fallback intent. Currently only default
+   * fallback intent is allowed in the agent, which is added upon agent
+   * creation.
+   * Adding training phrases to fallback intent is useful in the case of
+   * requests that are mistakenly matched, since training phrases assigned to
+   * fallback intents act as negative examples that triggers no-match event.
+   * 
+ * + * bool is_fallback = 6; + * + * @return The isFallback. + */ + @java.lang.Override + public boolean getIsFallback() { + return isFallback_; + } + + 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 (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + for (int i = 0; i < trainingPhrases_.size(); i++) { + output.writeMessage(3, trainingPhrases_.get(i)); + } + for (int i = 0; i < parameters_.size(); i++) { + output.writeMessage(4, parameters_.get(i)); + } + if (priority_ != 0) { + output.writeInt32(5, priority_); + } + if (isFallback_ != false) { + output.writeBool(6, isFallback_); + } + 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 (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + for (int i = 0; i < trainingPhrases_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, trainingPhrases_.get(i)); + } + for (int i = 0; i < parameters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, parameters_.get(i)); + } + if (priority_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, priority_); + } + if (isFallback_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, isFallback_); + } + 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.dialogflow.cx.v3beta1.Intent)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Intent other = + (com.google.cloud.dialogflow.cx.v3beta1.Intent) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getTrainingPhrasesList().equals(other.getTrainingPhrasesList())) return false; + if (!getParametersList().equals(other.getParametersList())) return false; + if (getPriority() != other.getPriority()) return false; + if (getIsFallback() != other.getIsFallback()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (getTrainingPhrasesCount() > 0) { + hash = (37 * hash) + TRAINING_PHRASES_FIELD_NUMBER; + hash = (53 * hash) + getTrainingPhrasesList().hashCode(); + } + if (getParametersCount() > 0) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParametersList().hashCode(); + } + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getPriority(); + hash = (37 * hash) + IS_FALLBACK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsFallback()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent 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.dialogflow.cx.v3beta1.Intent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent 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.dialogflow.cx.v3beta1.Intent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent 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.dialogflow.cx.v3beta1.Intent parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent 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.dialogflow.cx.v3beta1.Intent parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent 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.dialogflow.cx.v3beta1.Intent prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An intent represents a user's intent to interact with a conversational agent.
+   * You can provide information for the Dialogflow API to use to match user input
+   * to an intent by adding training phrases (i.e., examples of user input) to
+   * your intent.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Intent} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Intent) + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Intent.class, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.Intent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTrainingPhrasesFieldBuilder(); + getParametersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + if (trainingPhrasesBuilder_ == null) { + trainingPhrases_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + trainingPhrasesBuilder_.clear(); + } + if (parametersBuilder_ == null) { + parameters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + parametersBuilder_.clear(); + } + priority_ = 0; + + isFallback_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent build() { + com.google.cloud.dialogflow.cx.v3beta1.Intent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Intent result = + new com.google.cloud.dialogflow.cx.v3beta1.Intent(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + if (trainingPhrasesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + trainingPhrases_ = java.util.Collections.unmodifiableList(trainingPhrases_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.trainingPhrases_ = trainingPhrases_; + } else { + result.trainingPhrases_ = trainingPhrasesBuilder_.build(); + } + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + parameters_ = java.util.Collections.unmodifiableList(parameters_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.parameters_ = parameters_; + } else { + result.parameters_ = parametersBuilder_.build(); + } + result.priority_ = priority_; + result.isFallback_ = isFallback_; + 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.dialogflow.cx.v3beta1.Intent) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.Intent) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Intent other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (trainingPhrasesBuilder_ == null) { + if (!other.trainingPhrases_.isEmpty()) { + if (trainingPhrases_.isEmpty()) { + trainingPhrases_ = other.trainingPhrases_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTrainingPhrasesIsMutable(); + trainingPhrases_.addAll(other.trainingPhrases_); + } + onChanged(); + } + } else { + if (!other.trainingPhrases_.isEmpty()) { + if (trainingPhrasesBuilder_.isEmpty()) { + trainingPhrasesBuilder_.dispose(); + trainingPhrasesBuilder_ = null; + trainingPhrases_ = other.trainingPhrases_; + bitField0_ = (bitField0_ & ~0x00000001); + trainingPhrasesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTrainingPhrasesFieldBuilder() + : null; + } else { + trainingPhrasesBuilder_.addAllMessages(other.trainingPhrases_); + } + } + } + if (parametersBuilder_ == null) { + if (!other.parameters_.isEmpty()) { + if (parameters_.isEmpty()) { + parameters_ = other.parameters_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureParametersIsMutable(); + parameters_.addAll(other.parameters_); + } + onChanged(); + } + } else { + if (!other.parameters_.isEmpty()) { + if (parametersBuilder_.isEmpty()) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + parameters_ = other.parameters_; + bitField0_ = (bitField0_ & ~0x00000002); + parametersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getParametersFieldBuilder() + : null; + } else { + parametersBuilder_.addAllMessages(other.parameters_); + } + } + } + if (other.getPriority() != 0) { + setPriority(other.getPriority()); + } + if (other.getIsFallback() != false) { + setIsFallback(other.getIsFallback()); + } + 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.dialogflow.cx.v3beta1.Intent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.dialogflow.cx.v3beta1.Intent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The unique identifier of the intent.
+     * Required for the [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent] method. [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unique identifier of the intent.
+     * Required for the [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent] method. [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unique identifier of the intent.
+     * Required for the [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent] method. [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the intent.
+     * Required for the [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent] method. [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the intent.
+     * Required for the [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent] method. [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The human-readable name of the intent, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the intent, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the intent, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the intent, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the intent, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.util.List + trainingPhrases_ = java.util.Collections.emptyList(); + + private void ensureTrainingPhrasesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + trainingPhrases_ = + new java.util.ArrayList( + trainingPhrases_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhraseOrBuilder> + trainingPhrasesBuilder_; + + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public java.util.List + getTrainingPhrasesList() { + if (trainingPhrasesBuilder_ == null) { + return java.util.Collections.unmodifiableList(trainingPhrases_); + } else { + return trainingPhrasesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public int getTrainingPhrasesCount() { + if (trainingPhrasesBuilder_ == null) { + return trainingPhrases_.size(); + } else { + return trainingPhrasesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase getTrainingPhrases( + int index) { + if (trainingPhrasesBuilder_ == null) { + return trainingPhrases_.get(index); + } else { + return trainingPhrasesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public Builder setTrainingPhrases( + int index, com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase value) { + if (trainingPhrasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTrainingPhrasesIsMutable(); + trainingPhrases_.set(index, value); + onChanged(); + } else { + trainingPhrasesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public Builder setTrainingPhrases( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Builder builderForValue) { + if (trainingPhrasesBuilder_ == null) { + ensureTrainingPhrasesIsMutable(); + trainingPhrases_.set(index, builderForValue.build()); + onChanged(); + } else { + trainingPhrasesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public Builder addTrainingPhrases( + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase value) { + if (trainingPhrasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTrainingPhrasesIsMutable(); + trainingPhrases_.add(value); + onChanged(); + } else { + trainingPhrasesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public Builder addTrainingPhrases( + int index, com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase value) { + if (trainingPhrasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTrainingPhrasesIsMutable(); + trainingPhrases_.add(index, value); + onChanged(); + } else { + trainingPhrasesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public Builder addTrainingPhrases( + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Builder builderForValue) { + if (trainingPhrasesBuilder_ == null) { + ensureTrainingPhrasesIsMutable(); + trainingPhrases_.add(builderForValue.build()); + onChanged(); + } else { + trainingPhrasesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public Builder addTrainingPhrases( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Builder builderForValue) { + if (trainingPhrasesBuilder_ == null) { + ensureTrainingPhrasesIsMutable(); + trainingPhrases_.add(index, builderForValue.build()); + onChanged(); + } else { + trainingPhrasesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public Builder addAllTrainingPhrases( + java.lang.Iterable + values) { + if (trainingPhrasesBuilder_ == null) { + ensureTrainingPhrasesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, trainingPhrases_); + onChanged(); + } else { + trainingPhrasesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public Builder clearTrainingPhrases() { + if (trainingPhrasesBuilder_ == null) { + trainingPhrases_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + trainingPhrasesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public Builder removeTrainingPhrases(int index) { + if (trainingPhrasesBuilder_ == null) { + ensureTrainingPhrasesIsMutable(); + trainingPhrases_.remove(index); + onChanged(); + } else { + trainingPhrasesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Builder + getTrainingPhrasesBuilder(int index) { + return getTrainingPhrasesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhraseOrBuilder + getTrainingPhrasesOrBuilder(int index) { + if (trainingPhrasesBuilder_ == null) { + return trainingPhrases_.get(index); + } else { + return trainingPhrasesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhraseOrBuilder> + getTrainingPhrasesOrBuilderList() { + if (trainingPhrasesBuilder_ != null) { + return trainingPhrasesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(trainingPhrases_); + } + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Builder + addTrainingPhrasesBuilder() { + return getTrainingPhrasesFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.getDefaultInstance()); + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Builder + addTrainingPhrasesBuilder(int index) { + return getTrainingPhrasesFieldBuilder() + .addBuilder( + index, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.getDefaultInstance()); + } + /** + * + * + *
+     * The collection of training phrases the agent is trained on to identify the
+     * intent.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + public java.util.List + getTrainingPhrasesBuilderList() { + return getTrainingPhrasesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhraseOrBuilder> + getTrainingPhrasesFieldBuilder() { + if (trainingPhrasesBuilder_ == null) { + trainingPhrasesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhraseOrBuilder>( + trainingPhrases_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + trainingPhrases_ = null; + } + return trainingPhrasesBuilder_; + } + + private java.util.List parameters_ = + java.util.Collections.emptyList(); + + private void ensureParametersIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + parameters_ = + new java.util.ArrayList( + parameters_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Intent.ParameterOrBuilder> + parametersBuilder_; + + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public java.util.List + getParametersList() { + if (parametersBuilder_ == null) { + return java.util.Collections.unmodifiableList(parameters_); + } else { + return parametersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public int getParametersCount() { + if (parametersBuilder_ == null) { + return parameters_.size(); + } else { + return parametersBuilder_.getCount(); + } + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter getParameters(int index) { + if (parametersBuilder_ == null) { + return parameters_.get(index); + } else { + return parametersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public Builder setParameters( + int index, com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.set(index, value); + onChanged(); + } else { + parametersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public Builder setParameters( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.set(index, builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public Builder addParameters(com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.add(value); + onChanged(); + } else { + parametersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public Builder addParameters( + int index, com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.add(index, value); + onChanged(); + } else { + parametersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public Builder addParameters( + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.add(builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public Builder addParameters( + int index, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.add(index, builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public Builder addAllParameters( + java.lang.Iterable + values) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, parameters_); + onChanged(); + } else { + parametersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public Builder clearParameters() { + if (parametersBuilder_ == null) { + parameters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + parametersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public Builder removeParameters(int index) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.remove(index); + onChanged(); + } else { + parametersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.Builder getParametersBuilder( + int index) { + return getParametersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.ParameterOrBuilder getParametersOrBuilder( + int index) { + if (parametersBuilder_ == null) { + return parameters_.get(index); + } else { + return parametersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.Intent.ParameterOrBuilder> + getParametersOrBuilderList() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(parameters_); + } + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.Builder addParametersBuilder() { + return getParametersFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.getDefaultInstance()); + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.Builder addParametersBuilder( + int index) { + return getParametersFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.getDefaultInstance()); + } + /** + * + * + *
+     * The collection of parameters associated with the intent.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + public java.util.List + getParametersBuilderList() { + return getParametersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Intent.ParameterOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Intent.ParameterOrBuilder>( + parameters_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + private int priority_; + /** + * + * + *
+     * The priority of this intent. Higher numbers represent higher
+     * priorities.
+     * - If the supplied value is unspecified or 0, the service
+     *   translates the value to 500,000, which corresponds to the
+     *   `Normal` priority in the console.
+     * - If the supplied value is negative, the intent is ignored
+     *   in runtime detect intent requests.
+     * 
+ * + * int32 priority = 5; + * + * @return The priority. + */ + @java.lang.Override + public int getPriority() { + return priority_; + } + /** + * + * + *
+     * The priority of this intent. Higher numbers represent higher
+     * priorities.
+     * - If the supplied value is unspecified or 0, the service
+     *   translates the value to 500,000, which corresponds to the
+     *   `Normal` priority in the console.
+     * - If the supplied value is negative, the intent is ignored
+     *   in runtime detect intent requests.
+     * 
+ * + * int32 priority = 5; + * + * @param value The priority to set. + * @return This builder for chaining. + */ + public Builder setPriority(int value) { + + priority_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The priority of this intent. Higher numbers represent higher
+     * priorities.
+     * - If the supplied value is unspecified or 0, the service
+     *   translates the value to 500,000, which corresponds to the
+     *   `Normal` priority in the console.
+     * - If the supplied value is negative, the intent is ignored
+     *   in runtime detect intent requests.
+     * 
+ * + * int32 priority = 5; + * + * @return This builder for chaining. + */ + public Builder clearPriority() { + + priority_ = 0; + onChanged(); + return this; + } + + private boolean isFallback_; + /** + * + * + *
+     * Indicates whether this is a fallback intent. Currently only default
+     * fallback intent is allowed in the agent, which is added upon agent
+     * creation.
+     * Adding training phrases to fallback intent is useful in the case of
+     * requests that are mistakenly matched, since training phrases assigned to
+     * fallback intents act as negative examples that triggers no-match event.
+     * 
+ * + * bool is_fallback = 6; + * + * @return The isFallback. + */ + @java.lang.Override + public boolean getIsFallback() { + return isFallback_; + } + /** + * + * + *
+     * Indicates whether this is a fallback intent. Currently only default
+     * fallback intent is allowed in the agent, which is added upon agent
+     * creation.
+     * Adding training phrases to fallback intent is useful in the case of
+     * requests that are mistakenly matched, since training phrases assigned to
+     * fallback intents act as negative examples that triggers no-match event.
+     * 
+ * + * bool is_fallback = 6; + * + * @param value The isFallback to set. + * @return This builder for chaining. + */ + public Builder setIsFallback(boolean value) { + + isFallback_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates whether this is a fallback intent. Currently only default
+     * fallback intent is allowed in the agent, which is added upon agent
+     * creation.
+     * Adding training phrases to fallback intent is useful in the case of
+     * requests that are mistakenly matched, since training phrases assigned to
+     * fallback intents act as negative examples that triggers no-match event.
+     * 
+ * + * bool is_fallback = 6; + * + * @return This builder for chaining. + */ + public Builder clearIsFallback() { + + isFallback_ = 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.dialogflow.cx.v3beta1.Intent) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Intent) + private static final com.google.cloud.dialogflow.cx.v3beta1.Intent DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Intent(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Intent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Intent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Intent(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.dialogflow.cx.v3beta1.Intent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentInput.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentInput.java new file mode 100644 index 000000000..143a23eaa --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentInput.java @@ -0,0 +1,666 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Represents the intent to trigger programmatically rather than as a result of
+ * natural language processing.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.IntentInput} + */ +public final class IntentInput extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.IntentInput) + IntentInputOrBuilder { + private static final long serialVersionUID = 0L; + // Use IntentInput.newBuilder() to construct. + private IntentInput(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IntentInput() { + intent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IntentInput(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IntentInput( + 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(); + + intent_ = 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.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_IntentInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_IntentInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.IntentInput.class, + com.google.cloud.dialogflow.cx.v3beta1.IntentInput.Builder.class); + } + + public static final int INTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object intent_; + /** + * + * + *
+   * Required. The unique identifier of the intent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * + * string intent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The intent. + */ + @java.lang.Override + public java.lang.String getIntent() { + java.lang.Object ref = intent_; + 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(); + intent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The unique identifier of the intent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * + * string intent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for intent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIntentBytes() { + java.lang.Object ref = intent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + intent_ = 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 (!getIntentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, intent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIntentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, intent_); + } + 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.dialogflow.cx.v3beta1.IntentInput)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.IntentInput other = + (com.google.cloud.dialogflow.cx.v3beta1.IntentInput) obj; + + if (!getIntent().equals(other.getIntent())) 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) + INTENT_FIELD_NUMBER; + hash = (53 * hash) + getIntent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.IntentInput parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.IntentInput 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.dialogflow.cx.v3beta1.IntentInput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.IntentInput 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.dialogflow.cx.v3beta1.IntentInput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.IntentInput parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.IntentInput parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.IntentInput 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.dialogflow.cx.v3beta1.IntentInput parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.IntentInput 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.dialogflow.cx.v3beta1.IntentInput parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.IntentInput 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.dialogflow.cx.v3beta1.IntentInput prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the intent to trigger programmatically rather than as a result of
+   * natural language processing.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.IntentInput} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.IntentInput) + com.google.cloud.dialogflow.cx.v3beta1.IntentInputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_IntentInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_IntentInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.IntentInput.class, + com.google.cloud.dialogflow.cx.v3beta1.IntentInput.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.IntentInput.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(); + intent_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_IntentInput_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.IntentInput getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentInput.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.IntentInput build() { + com.google.cloud.dialogflow.cx.v3beta1.IntentInput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.IntentInput buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.IntentInput result = + new com.google.cloud.dialogflow.cx.v3beta1.IntentInput(this); + result.intent_ = intent_; + 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.dialogflow.cx.v3beta1.IntentInput) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.IntentInput) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.IntentInput other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.IntentInput.getDefaultInstance()) + return this; + if (!other.getIntent().isEmpty()) { + intent_ = other.intent_; + 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.dialogflow.cx.v3beta1.IntentInput parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.IntentInput) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object intent_ = ""; + /** + * + * + *
+     * Required. The unique identifier of the intent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string intent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The intent. + */ + public java.lang.String getIntent() { + java.lang.Object ref = intent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + intent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The unique identifier of the intent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string intent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for intent. + */ + public com.google.protobuf.ByteString getIntentBytes() { + java.lang.Object ref = intent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + intent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The unique identifier of the intent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string intent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The intent to set. + * @return This builder for chaining. + */ + public Builder setIntent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + intent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The unique identifier of the intent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string intent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearIntent() { + + intent_ = getDefaultInstance().getIntent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The unique identifier of the intent.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * 
+ * + * + * string intent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for intent to set. + * @return This builder for chaining. + */ + public Builder setIntentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + intent_ = 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.dialogflow.cx.v3beta1.IntentInput) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.IntentInput) + private static final com.google.cloud.dialogflow.cx.v3beta1.IntentInput DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.IntentInput(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.IntentInput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IntentInput parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IntentInput(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.dialogflow.cx.v3beta1.IntentInput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentInputOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentInputOrBuilder.java new file mode 100644 index 000000000..a2392e31b --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentInputOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface IntentInputOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.IntentInput) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique identifier of the intent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * + * string intent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The intent. + */ + java.lang.String getIntent(); + /** + * + * + *
+   * Required. The unique identifier of the intent.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * + * string intent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for intent. + */ + com.google.protobuf.ByteString getIntentBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentName.java new file mode 100644 index 000000000..5fe2d5727 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentName.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 IntentName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}/intents/{intent}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String agent; + private final String intent; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getIntent() { + return intent; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private IntentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + intent = Preconditions.checkNotNull(builder.getIntent()); + } + + public static IntentName of(String project, String location, String agent, String intent) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setIntent(intent) + .build(); + } + + public static String format(String project, String location, String agent, String intent) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setIntent(intent) + .build() + .toString(); + } + + public static IntentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "IntentName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("agent"), + matchMap.get("intent")); + } + + 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 (IntentName 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("agent", agent); + fieldMapBuilder.put("intent", intent); + 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, "agent", agent, "intent", intent); + } + + /** Builder for IntentName. */ + public static class Builder { + + private String project; + private String location; + private String agent; + private String intent; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getIntent() { + return intent; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAgent(String agent) { + this.agent = agent; + return this; + } + + public Builder setIntent(String intent) { + this.intent = intent; + return this; + } + + private Builder() {} + + private Builder(IntentName intentName) { + project = intentName.project; + location = intentName.location; + agent = intentName.agent; + intent = intentName.intent; + } + + public IntentName build() { + return new IntentName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof IntentName) { + IntentName that = (IntentName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.agent.equals(that.agent)) + && (this.intent.equals(that.intent)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= agent.hashCode(); + h *= 1000003; + h ^= intent.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentOrBuilder.java new file mode 100644 index 000000000..574e4c551 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentOrBuilder.java @@ -0,0 +1,237 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface IntentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Intent) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique identifier of the intent.
+   * Required for the [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent] method. [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent]
+   * populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The unique identifier of the intent.
+   * Required for the [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent] method. [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent]
+   * populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The human-readable name of the intent, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The human-readable name of the intent, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The collection of training phrases the agent is trained on to identify the
+   * intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + java.util.List + getTrainingPhrasesList(); + /** + * + * + *
+   * The collection of training phrases the agent is trained on to identify the
+   * intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase getTrainingPhrases(int index); + /** + * + * + *
+   * The collection of training phrases the agent is trained on to identify the
+   * intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + int getTrainingPhrasesCount(); + /** + * + * + *
+   * The collection of training phrases the agent is trained on to identify the
+   * intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + java.util.List + getTrainingPhrasesOrBuilderList(); + /** + * + * + *
+   * The collection of training phrases the agent is trained on to identify the
+   * intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhraseOrBuilder getTrainingPhrasesOrBuilder( + int index); + + /** + * + * + *
+   * The collection of parameters associated with the intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + java.util.List getParametersList(); + /** + * + * + *
+   * The collection of parameters associated with the intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter getParameters(int index); + /** + * + * + *
+   * The collection of parameters associated with the intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + int getParametersCount(); + /** + * + * + *
+   * The collection of parameters associated with the intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + java.util.List + getParametersOrBuilderList(); + /** + * + * + *
+   * The collection of parameters associated with the intent.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4; + */ + com.google.cloud.dialogflow.cx.v3beta1.Intent.ParameterOrBuilder getParametersOrBuilder( + int index); + + /** + * + * + *
+   * The priority of this intent. Higher numbers represent higher
+   * priorities.
+   * - If the supplied value is unspecified or 0, the service
+   *   translates the value to 500,000, which corresponds to the
+   *   `Normal` priority in the console.
+   * - If the supplied value is negative, the intent is ignored
+   *   in runtime detect intent requests.
+   * 
+ * + * int32 priority = 5; + * + * @return The priority. + */ + int getPriority(); + + /** + * + * + *
+   * Indicates whether this is a fallback intent. Currently only default
+   * fallback intent is allowed in the agent, which is added upon agent
+   * creation.
+   * Adding training phrases to fallback intent is useful in the case of
+   * requests that are mistakenly matched, since training phrases assigned to
+   * fallback intents act as negative examples that triggers no-match event.
+   * 
+ * + * bool is_fallback = 6; + * + * @return The isFallback. + */ + boolean getIsFallback(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentProto.java new file mode 100644 index 000000000..9376c6e21 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentProto.java @@ -0,0 +1,276 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class IntentProto { + private IntentProto() {} + + 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_dialogflow_cx_v3beta1_Intent_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_Part_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_Part_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_Parameter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_Parameter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_GetIntentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_GetIntentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateIntentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateIntentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateIntentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateIntentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteIntentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteIntentRequest_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/dialogflow/cx/v3beta1/int" + + "ent.proto\022\"google.cloud.dialogflow.cx.v3" + + "beta1\032\034google/api/annotations.proto\032\027goo" + + "gle/api/client.proto\032\037google/api/field_b" + + "ehavior.proto\032\031google/api/resource.proto" + + "\032\033google/protobuf/empty.proto\032 google/pr" + + "otobuf/field_mask.proto\"\223\005\n\006Intent\022\014\n\004na" + + "me\030\001 \001(\t\022\031\n\014display_name\030\002 \001(\tB\003\340A\002\022S\n\020t" + + "raining_phrases\030\003 \003(\01329.google.cloud.dia" + + "logflow.cx.v3beta1.Intent.TrainingPhrase" + + "\022H\n\nparameters\030\004 \003(\01324.google.cloud.dial" + + "ogflow.cx.v3beta1.Intent.Parameter\022\020\n\010pr" + + "iority\030\005 \001(\005\022\023\n\013is_fallback\030\006 \001(\010\032\267\001\n\016Tr" + + "ainingPhrase\022\n\n\002id\030\001 \001(\t\022R\n\005parts\030\002 \003(\0132" + + ">.google.cloud.dialogflow.cx.v3beta1.Int" + + "ent.TrainingPhrase.PartB\003\340A\002\022\024\n\014repeat_c" + + "ount\030\003 \001(\005\032/\n\004Part\022\021\n\004text\030\001 \001(\tB\003\340A\002\022\024\n" + + "\014parameter_id\030\002 \001(\t\032p\n\tParameter\022\017\n\002id\030\001" + + " \001(\tB\003\340A\002\022A\n\013entity_type\030\002 \001(\tB,\340A\002\372A&\n$" + + "dialogflow.googleapis.com/EntityType\022\017\n\007" + + "is_list\030\003 \001(\010:n\352Ak\n dialogflow.googleapi" + + "s.com/Intent\022Gprojects/{project}/locatio" + + "ns/{location}/agents/{agent}/intents/{in" + + "tent}\"\321\001\n\022ListIntentsRequest\0228\n\006parent\030\001" + + " \001(\tB(\340A\002\372A\"\022 dialogflow.googleapis.com/" + + "Intent\022\025\n\rlanguage_code\030\002 \001(\t\022C\n\013intent_" + + "view\030\005 \001(\0162..google.cloud.dialogflow.cx." + + "v3beta1.IntentView\022\021\n\tpage_size\030\003 \001(\005\022\022\n" + + "\npage_token\030\004 \001(\t\"k\n\023ListIntentsResponse" + + "\022;\n\007intents\030\001 \003(\0132*.google.cloud.dialogf" + + "low.cx.v3beta1.Intent\022\027\n\017next_page_token" + + "\030\002 \001(\t\"a\n\020GetIntentRequest\0226\n\004name\030\001 \001(\t" + + "B(\340A\002\372A\"\n dialogflow.googleapis.com/Inte" + + "nt\022\025\n\rlanguage_code\030\002 \001(\t\"\247\001\n\023CreateInte" + + "ntRequest\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\022 dialo" + + "gflow.googleapis.com/Intent\022?\n\006intent\030\002 " + + "\001(\0132*.google.cloud.dialogflow.cx.v3beta1" + + ".IntentB\003\340A\002\022\025\n\rlanguage_code\030\003 \001(\t\"\236\001\n\023" + + "UpdateIntentRequest\022?\n\006intent\030\001 \001(\0132*.go" + + "ogle.cloud.dialogflow.cx.v3beta1.IntentB" + + "\003\340A\002\022\025\n\rlanguage_code\030\002 \001(\t\022/\n\013update_ma" + + "sk\030\003 \001(\0132\032.google.protobuf.FieldMask\"M\n\023" + + "DeleteIntentRequest\0226\n\004name\030\001 \001(\tB(\340A\002\372A" + + "\"\n dialogflow.googleapis.com/Intent*X\n\nI" + + "ntentView\022\033\n\027INTENT_VIEW_UNSPECIFIED\020\000\022\027" + + "\n\023INTENT_VIEW_PARTIAL\020\001\022\024\n\020INTENT_VIEW_F" + + "ULL\020\0022\344\010\n\007Intents\022\312\001\n\013ListIntents\0226.goog" + + "le.cloud.dialogflow.cx.v3beta1.ListInten" + + "tsRequest\0327.google.cloud.dialogflow.cx.v" + + "3beta1.ListIntentsResponse\"J\202\323\344\223\002;\0229/v3b" + + "eta1/{parent=projects/*/locations/*/agen" + + "ts/*}/intents\332A\006parent\022\267\001\n\tGetIntent\0224.g" + + "oogle.cloud.dialogflow.cx.v3beta1.GetInt" + + "entRequest\032*.google.cloud.dialogflow.cx." + + "v3beta1.Intent\"H\202\323\344\223\002;\0229/v3beta1/{name=p" + + "rojects/*/locations/*/agents/*/intents/*" + + "}\332A\004name\022\316\001\n\014CreateIntent\0227.google.cloud" + + ".dialogflow.cx.v3beta1.CreateIntentReque" + + "st\032*.google.cloud.dialogflow.cx.v3beta1." + + "Intent\"Y\202\323\344\223\002C\"9/v3beta1/{parent=project" + + "s/*/locations/*/agents/*}/intents:\006inten" + + "t\332A\rparent,intent\022\332\001\n\014UpdateIntent\0227.goo" + + "gle.cloud.dialogflow.cx.v3beta1.UpdateIn" + + "tentRequest\032*.google.cloud.dialogflow.cx" + + ".v3beta1.Intent\"e\202\323\344\223\002J2@/v3beta1/{inten" + + "t.name=projects/*/locations/*/agents/*/i" + + "ntents/*}:\006intent\332A\022intent,update_mask\022\251" + + "\001\n\014DeleteIntent\0227.google.cloud.dialogflo" + + "w.cx.v3beta1.DeleteIntentRequest\032\026.googl" + + "e.protobuf.Empty\"H\202\323\344\223\002;*9/v3beta1/{name" + + "=projects/*/locations/*/agents/*/intents" + + "/*}\332A\004name\032x\312A\031dialogflow.googleapis.com" + + "\322AYhttps://www.googleapis.com/auth/cloud" + + "-platform,https://www.googleapis.com/aut" + + "h/dialogflowB\252\001\n&com.google.cloud.dialog" + + "flow.cx.v3beta1B\013IntentProtoP\001ZDgoogle.g" + + "olang.org/genproto/googleapis/cloud/dial" + + "ogflow/cx/v3beta1;cx\370\001\001\242\002\002DF\252\002\"Google.Cl" + + "oud.Dialogflow.Cx.V3Beta1b\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.api.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "TrainingPhrases", "Parameters", "Priority", "IsFallback", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_descriptor, + new java.lang.String[] { + "Id", "Parts", "RepeatCount", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_Part_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_Part_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_TrainingPhrase_Part_descriptor, + new java.lang.String[] { + "Text", "ParameterId", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_Parameter_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_Parameter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Intent_Parameter_descriptor, + new java.lang.String[] { + "Id", "EntityType", "IsList", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsRequest_descriptor, + new java.lang.String[] { + "Parent", "LanguageCode", "IntentView", "PageSize", "PageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsResponse_descriptor, + new java.lang.String[] { + "Intents", "NextPageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetIntentRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetIntentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_GetIntentRequest_descriptor, + new java.lang.String[] { + "Name", "LanguageCode", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateIntentRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateIntentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateIntentRequest_descriptor, + new java.lang.String[] { + "Parent", "Intent", "LanguageCode", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateIntentRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateIntentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateIntentRequest_descriptor, + new java.lang.String[] { + "Intent", "LanguageCode", "UpdateMask", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteIntentRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteIntentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteIntentRequest_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.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentView.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentView.java new file mode 100644 index 000000000..89d8ca4c2 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentView.java @@ -0,0 +1,178 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Represents the options for views of an intent.
+ * An intent can be a sizable object. Therefore, we provide a resource view that
+ * does not return training phrases in the response.
+ * 
+ * + * Protobuf enum {@code google.cloud.dialogflow.cx.v3beta1.IntentView} + */ +public enum IntentView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Not specified. Treated as INTENT_VIEW_FULL.
+   * 
+ * + * INTENT_VIEW_UNSPECIFIED = 0; + */ + INTENT_VIEW_UNSPECIFIED(0), + /** + * + * + *
+   * Training phrases field is not populated in the response.
+   * 
+ * + * INTENT_VIEW_PARTIAL = 1; + */ + INTENT_VIEW_PARTIAL(1), + /** + * + * + *
+   * All fields are populated.
+   * 
+ * + * INTENT_VIEW_FULL = 2; + */ + INTENT_VIEW_FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Not specified. Treated as INTENT_VIEW_FULL.
+   * 
+ * + * INTENT_VIEW_UNSPECIFIED = 0; + */ + public static final int INTENT_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Training phrases field is not populated in the response.
+   * 
+ * + * INTENT_VIEW_PARTIAL = 1; + */ + public static final int INTENT_VIEW_PARTIAL_VALUE = 1; + /** + * + * + *
+   * All fields are populated.
+   * 
+ * + * INTENT_VIEW_FULL = 2; + */ + public static final int INTENT_VIEW_FULL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static IntentView 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 IntentView forNumber(int value) { + switch (value) { + case 0: + return INTENT_VIEW_UNSPECIFIED; + case 1: + return INTENT_VIEW_PARTIAL; + case 2: + return INTENT_VIEW_FULL; + 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 IntentView findValueByNumber(int number) { + return IntentView.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto.getDescriptor().getEnumTypes().get(0); + } + + private static final IntentView[] VALUES = values(); + + public static IntentView 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 IntentView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.IntentView) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/InteractiveVoiceResponseProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/InteractiveVoiceResponseProto.java new file mode 100644 index 000000000..13d78264b --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/InteractiveVoiceResponseProto.java @@ -0,0 +1,60 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/ivr.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class InteractiveVoiceResponseProto { + private InteractiveVoiceResponseProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + 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/dialogflow/cx/v3beta1/ivr" + + ".proto\022\"google.cloud.dialogflow.cx.v3bet" + + "a1\032\036google/protobuf/duration.proto\032\034goog" + + "le/api/annotations.protoB\274\001\n&com.google." + + "cloud.dialogflow.cx.v3beta1B\035Interactive" + + "VoiceResponseProtoP\001ZDgoogle.golang.org/" + + "genproto/googleapis/cloud/dialogflow/cx/" + + "v3beta1;cx\370\001\001\242\002\002DF\252\002\"Google.Cloud.Dialog" + + "flow.Cx.V3Beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DurationProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListAgentsRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListAgentsRequest.java new file mode 100644 index 000000000..72b151ff7 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListAgentsRequest.java @@ -0,0 +1,931 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Agents.ListAgents][google.cloud.dialogflow.cx.v3beta1.Agents.ListAgents].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest} + */ +public final class ListAgentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest) + ListAgentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAgentsRequest.newBuilder() to construct. + private ListAgentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAgentsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAgentsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAgentsRequest( + 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.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The location to list all agents for.
+   * Format: `projects/<Project ID>/locations/<Location ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 location to list all agents for.
+   * Format: `projects/<Project ID>/locations/<Location ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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_; + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + 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.dialogflow.cx.v3beta1.ListAgentsRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest) 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.dialogflow.cx.v3beta1.ListAgentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest 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.dialogflow.cx.v3beta1.ListAgentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest 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.dialogflow.cx.v3beta1.ListAgentsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest 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.dialogflow.cx.v3beta1.ListAgentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest 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.dialogflow.cx.v3beta1.ListAgentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest 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.dialogflow.cx.v3beta1.ListAgentsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Agents.ListAgents][google.cloud.dialogflow.cx.v3beta1.Agents.ListAgents].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest) + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest.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.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest(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.dialogflow.cx.v3beta1.ListAgentsRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest.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.dialogflow.cx.v3beta1.ListAgentsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The location to list all agents for.
+     * Format: `projects/<Project ID>/locations/<Location ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 location to list all agents for.
+     * Format: `projects/<Project ID>/locations/<Location ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 location to list all agents for.
+     * Format: `projects/<Project ID>/locations/<Location ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 location to list all agents for.
+     * Format: `projects/<Project ID>/locations/<Location ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The location to list all agents for.
+     * Format: `projects/<Project ID>/locations/<Location ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_; + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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.dialogflow.cx.v3beta1.ListAgentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAgentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAgentsRequest(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.dialogflow.cx.v3beta1.ListAgentsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListAgentsRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListAgentsRequestOrBuilder.java new file mode 100644 index 000000000..77d8371f0 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListAgentsRequestOrBuilder.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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListAgentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The location to list all agents for.
+   * Format: `projects/<Project ID>/locations/<Location ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The location to list all agents for.
+   * Format: `projects/<Project ID>/locations/<Location ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListAgentsResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListAgentsResponse.java new file mode 100644 index 000000000..84837d503 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListAgentsResponse.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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The response message for [Agents.ListAgents][google.cloud.dialogflow.cx.v3beta1.Agents.ListAgents].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse} + */ +public final class ListAgentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse) + ListAgentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAgentsResponse.newBuilder() to construct. + private ListAgentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAgentsResponse() { + agents_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAgentsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAgentsResponse( + 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)) { + agents_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + agents_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Agent.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)) { + agents_ = java.util.Collections.unmodifiableList(agents_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse.Builder.class); + } + + public static final int AGENTS_FIELD_NUMBER = 1; + private java.util.List agents_; + /** + * + * + *
+   * The list of agents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + @java.lang.Override + public java.util.List getAgentsList() { + return agents_; + } + /** + * + * + *
+   * The list of agents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + @java.lang.Override + public java.util.List + getAgentsOrBuilderList() { + return agents_; + } + /** + * + * + *
+   * The list of agents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + @java.lang.Override + public int getAgentsCount() { + return agents_.size(); + } + /** + * + * + *
+   * The list of agents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Agent getAgents(int index) { + return agents_.get(index); + } + /** + * + * + *
+   * The list of agents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder getAgentsOrBuilder(int index) { + return agents_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + 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 < agents_.size(); i++) { + output.writeMessage(1, agents_.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 < agents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, agents_.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.dialogflow.cx.v3beta1.ListAgentsResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse) obj; + + if (!getAgentsList().equals(other.getAgentsList())) 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 (getAgentsCount() > 0) { + hash = (37 * hash) + AGENTS_FIELD_NUMBER; + hash = (53 * hash) + getAgentsList().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.dialogflow.cx.v3beta1.ListAgentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse 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.dialogflow.cx.v3beta1.ListAgentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse 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.dialogflow.cx.v3beta1.ListAgentsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse 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.dialogflow.cx.v3beta1.ListAgentsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse 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.dialogflow.cx.v3beta1.ListAgentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse 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.dialogflow.cx.v3beta1.ListAgentsResponse 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 response message for [Agents.ListAgents][google.cloud.dialogflow.cx.v3beta1.Agents.ListAgents].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse) + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAgentsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (agentsBuilder_ == null) { + agents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + agentsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListAgentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse(this); + int from_bitField0_ = bitField0_; + if (agentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + agents_ = java.util.Collections.unmodifiableList(agents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.agents_ = agents_; + } else { + result.agents_ = agentsBuilder_.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.dialogflow.cx.v3beta1.ListAgentsResponse) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse.getDefaultInstance()) + return this; + if (agentsBuilder_ == null) { + if (!other.agents_.isEmpty()) { + if (agents_.isEmpty()) { + agents_ = other.agents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAgentsIsMutable(); + agents_.addAll(other.agents_); + } + onChanged(); + } + } else { + if (!other.agents_.isEmpty()) { + if (agentsBuilder_.isEmpty()) { + agentsBuilder_.dispose(); + agentsBuilder_ = null; + agents_ = other.agents_; + bitField0_ = (bitField0_ & ~0x00000001); + agentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAgentsFieldBuilder() + : null; + } else { + agentsBuilder_.addAllMessages(other.agents_); + } + } + } + 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.dialogflow.cx.v3beta1.ListAgentsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List agents_ = + java.util.Collections.emptyList(); + + private void ensureAgentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + agents_ = new java.util.ArrayList(agents_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Agent, + com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder> + agentsBuilder_; + + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public java.util.List getAgentsList() { + if (agentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(agents_); + } else { + return agentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public int getAgentsCount() { + if (agentsBuilder_ == null) { + return agents_.size(); + } else { + return agentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Agent getAgents(int index) { + if (agentsBuilder_ == null) { + return agents_.get(index); + } else { + return agentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public Builder setAgents(int index, com.google.cloud.dialogflow.cx.v3beta1.Agent value) { + if (agentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAgentsIsMutable(); + agents_.set(index, value); + onChanged(); + } else { + agentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public Builder setAgents( + int index, com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder builderForValue) { + if (agentsBuilder_ == null) { + ensureAgentsIsMutable(); + agents_.set(index, builderForValue.build()); + onChanged(); + } else { + agentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public Builder addAgents(com.google.cloud.dialogflow.cx.v3beta1.Agent value) { + if (agentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAgentsIsMutable(); + agents_.add(value); + onChanged(); + } else { + agentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public Builder addAgents(int index, com.google.cloud.dialogflow.cx.v3beta1.Agent value) { + if (agentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAgentsIsMutable(); + agents_.add(index, value); + onChanged(); + } else { + agentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public Builder addAgents(com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder builderForValue) { + if (agentsBuilder_ == null) { + ensureAgentsIsMutable(); + agents_.add(builderForValue.build()); + onChanged(); + } else { + agentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public Builder addAgents( + int index, com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder builderForValue) { + if (agentsBuilder_ == null) { + ensureAgentsIsMutable(); + agents_.add(index, builderForValue.build()); + onChanged(); + } else { + agentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public Builder addAllAgents( + java.lang.Iterable values) { + if (agentsBuilder_ == null) { + ensureAgentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, agents_); + onChanged(); + } else { + agentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public Builder clearAgents() { + if (agentsBuilder_ == null) { + agents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + agentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public Builder removeAgents(int index) { + if (agentsBuilder_ == null) { + ensureAgentsIsMutable(); + agents_.remove(index); + onChanged(); + } else { + agentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder getAgentsBuilder(int index) { + return getAgentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder getAgentsOrBuilder(int index) { + if (agentsBuilder_ == null) { + return agents_.get(index); + } else { + return agentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public java.util.List + getAgentsOrBuilderList() { + if (agentsBuilder_ != null) { + return agentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(agents_); + } + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder addAgentsBuilder() { + return getAgentsFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.Agent.getDefaultInstance()); + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder addAgentsBuilder(int index) { + return getAgentsFieldBuilder() + .addBuilder(index, com.google.cloud.dialogflow.cx.v3beta1.Agent.getDefaultInstance()); + } + /** + * + * + *
+     * The list of agents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + public java.util.List + getAgentsBuilderList() { + return getAgentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Agent, + com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder> + getAgentsFieldBuilder() { + if (agentsBuilder_ == null) { + agentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Agent, + com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder>( + agents_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + agents_ = null; + } + return agentsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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.dialogflow.cx.v3beta1.ListAgentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAgentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAgentsResponse(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.dialogflow.cx.v3beta1.ListAgentsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListAgentsResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListAgentsResponseOrBuilder.java new file mode 100644 index 000000000..022149920 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListAgentsResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListAgentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of agents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + java.util.List getAgentsList(); + /** + * + * + *
+   * The list of agents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.Agent getAgents(int index); + /** + * + * + *
+   * The list of agents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + int getAgentsCount(); + /** + * + * + *
+   * The list of agents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + java.util.List + getAgentsOrBuilderList(); + /** + * + * + *
+   * The list of agents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Agent agents = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder getAgentsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEntityTypesRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEntityTypesRequest.java new file mode 100644 index 000000000..6e975123a --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEntityTypesRequest.java @@ -0,0 +1,1177 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest} + */ +public final class ListEntityTypesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest) + ListEntityTypesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListEntityTypesRequest.newBuilder() to construct. + private ListEntityTypesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListEntityTypesRequest() { + parent_ = ""; + languageCode_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListEntityTypesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListEntityTypesRequest( + 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(); + + languageCode_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + 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.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The agent to list all entity types for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 agent to list all entity types for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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 LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language to list entity types for. The following fields are language
+   * dependent:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language to list entity types for. The following fields are language
+   * dependent:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + 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 (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, 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 (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, 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.dialogflow.cx.v3beta1.ListEntityTypesRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) 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) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().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.dialogflow.cx.v3beta1.ListEntityTypesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest 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.dialogflow.cx.v3beta1.ListEntityTypesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest 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.dialogflow.cx.v3beta1.ListEntityTypesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest 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.dialogflow.cx.v3beta1.ListEntityTypesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest 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.dialogflow.cx.v3beta1.ListEntityTypesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest 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.dialogflow.cx.v3beta1.ListEntityTypesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest) + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest.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_ = ""; + + languageCode_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest(this); + result.parent_ = parent_; + result.languageCode_ = languageCode_; + 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.dialogflow.cx.v3beta1.ListEntityTypesRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + 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.dialogflow.cx.v3beta1.ListEntityTypesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The agent to list all entity types for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to list all entity types for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to list all entity types for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to list all entity types for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The agent to list all entity types for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 languageCode_ = ""; + /** + * + * + *
+     * The language to list entity types for. The following fields are language
+     * dependent:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language to list entity types for. The following fields are language
+     * dependent:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language to list entity types for. The following fields are language
+     * dependent:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list entity types for. The following fields are language
+     * dependent:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list entity types for. The following fields are language
+     * dependent:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @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.dialogflow.cx.v3beta1.ListEntityTypesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListEntityTypesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListEntityTypesRequest(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.dialogflow.cx.v3beta1.ListEntityTypesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEntityTypesRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEntityTypesRequestOrBuilder.java new file mode 100644 index 000000000..2870ca6dc --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEntityTypesRequestOrBuilder.java @@ -0,0 +1,138 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListEntityTypesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The agent to list all entity types for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The agent to list all entity types for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The language to list entity types for. The following fields are language
+   * dependent:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language to list entity types for. The following fields are language
+   * dependent:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEntityTypesResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEntityTypesResponse.java new file mode 100644 index 000000000..d2145c7e0 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEntityTypesResponse.java @@ -0,0 +1,1177 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The response message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse} + */ +public final class ListEntityTypesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse) + ListEntityTypesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListEntityTypesResponse.newBuilder() to construct. + private ListEntityTypesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListEntityTypesResponse() { + entityTypes_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListEntityTypesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListEntityTypesResponse( + 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)) { + entityTypes_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + entityTypes_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.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)) { + entityTypes_ = java.util.Collections.unmodifiableList(entityTypes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse.Builder.class); + } + + public static final int ENTITY_TYPES_FIELD_NUMBER = 1; + private java.util.List entityTypes_; + /** + * + * + *
+   * The list of entity types. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + @java.lang.Override + public java.util.List getEntityTypesList() { + return entityTypes_; + } + /** + * + * + *
+   * The list of entity types. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + @java.lang.Override + public java.util.List + getEntityTypesOrBuilderList() { + return entityTypes_; + } + /** + * + * + *
+   * The list of entity types. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + @java.lang.Override + public int getEntityTypesCount() { + return entityTypes_.size(); + } + /** + * + * + *
+   * The list of entity types. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType getEntityTypes(int index) { + return entityTypes_.get(index); + } + /** + * + * + *
+   * The list of entity types. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder getEntityTypesOrBuilder( + int index) { + return entityTypes_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + 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 < entityTypes_.size(); i++) { + output.writeMessage(1, entityTypes_.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 < entityTypes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, entityTypes_.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.dialogflow.cx.v3beta1.ListEntityTypesResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse) obj; + + if (!getEntityTypesList().equals(other.getEntityTypesList())) 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 (getEntityTypesCount() > 0) { + hash = (37 * hash) + ENTITY_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getEntityTypesList().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.dialogflow.cx.v3beta1.ListEntityTypesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse 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.dialogflow.cx.v3beta1.ListEntityTypesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse 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.dialogflow.cx.v3beta1.ListEntityTypesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse 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.dialogflow.cx.v3beta1.ListEntityTypesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse 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.dialogflow.cx.v3beta1.ListEntityTypesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse 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.dialogflow.cx.v3beta1.ListEntityTypesResponse 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 response message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse) + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEntityTypesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (entityTypesBuilder_ == null) { + entityTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + entityTypesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEntityTypesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse(this); + int from_bitField0_ = bitField0_; + if (entityTypesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + entityTypes_ = java.util.Collections.unmodifiableList(entityTypes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.entityTypes_ = entityTypes_; + } else { + result.entityTypes_ = entityTypesBuilder_.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.dialogflow.cx.v3beta1.ListEntityTypesResponse) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse.getDefaultInstance()) + return this; + if (entityTypesBuilder_ == null) { + if (!other.entityTypes_.isEmpty()) { + if (entityTypes_.isEmpty()) { + entityTypes_ = other.entityTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEntityTypesIsMutable(); + entityTypes_.addAll(other.entityTypes_); + } + onChanged(); + } + } else { + if (!other.entityTypes_.isEmpty()) { + if (entityTypesBuilder_.isEmpty()) { + entityTypesBuilder_.dispose(); + entityTypesBuilder_ = null; + entityTypes_ = other.entityTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + entityTypesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEntityTypesFieldBuilder() + : null; + } else { + entityTypesBuilder_.addAllMessages(other.entityTypes_); + } + } + } + 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.dialogflow.cx.v3beta1.ListEntityTypesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List entityTypes_ = + java.util.Collections.emptyList(); + + private void ensureEntityTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + entityTypes_ = + new java.util.ArrayList( + entityTypes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder> + entityTypesBuilder_; + + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public java.util.List getEntityTypesList() { + if (entityTypesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entityTypes_); + } else { + return entityTypesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public int getEntityTypesCount() { + if (entityTypesBuilder_ == null) { + return entityTypes_.size(); + } else { + return entityTypesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType getEntityTypes(int index) { + if (entityTypesBuilder_ == null) { + return entityTypes_.get(index); + } else { + return entityTypesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public Builder setEntityTypes( + int index, com.google.cloud.dialogflow.cx.v3beta1.EntityType value) { + if (entityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntityTypesIsMutable(); + entityTypes_.set(index, value); + onChanged(); + } else { + entityTypesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public Builder setEntityTypes( + int index, com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder builderForValue) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + entityTypes_.set(index, builderForValue.build()); + onChanged(); + } else { + entityTypesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public Builder addEntityTypes(com.google.cloud.dialogflow.cx.v3beta1.EntityType value) { + if (entityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntityTypesIsMutable(); + entityTypes_.add(value); + onChanged(); + } else { + entityTypesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public Builder addEntityTypes( + int index, com.google.cloud.dialogflow.cx.v3beta1.EntityType value) { + if (entityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntityTypesIsMutable(); + entityTypes_.add(index, value); + onChanged(); + } else { + entityTypesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public Builder addEntityTypes( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder builderForValue) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + entityTypes_.add(builderForValue.build()); + onChanged(); + } else { + entityTypesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public Builder addEntityTypes( + int index, com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder builderForValue) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + entityTypes_.add(index, builderForValue.build()); + onChanged(); + } else { + entityTypesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public Builder addAllEntityTypes( + java.lang.Iterable values) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entityTypes_); + onChanged(); + } else { + entityTypesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public Builder clearEntityTypes() { + if (entityTypesBuilder_ == null) { + entityTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + entityTypesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public Builder removeEntityTypes(int index) { + if (entityTypesBuilder_ == null) { + ensureEntityTypesIsMutable(); + entityTypes_.remove(index); + onChanged(); + } else { + entityTypesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder getEntityTypesBuilder( + int index) { + return getEntityTypesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder getEntityTypesOrBuilder( + int index) { + if (entityTypesBuilder_ == null) { + return entityTypes_.get(index); + } else { + return entityTypesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public java.util.List + getEntityTypesOrBuilderList() { + if (entityTypesBuilder_ != null) { + return entityTypesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entityTypes_); + } + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder addEntityTypesBuilder() { + return getEntityTypesFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.EntityType.getDefaultInstance()); + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder addEntityTypesBuilder( + int index) { + return getEntityTypesFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.EntityType.getDefaultInstance()); + } + /** + * + * + *
+     * The list of entity types. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + public java.util.List + getEntityTypesBuilderList() { + return getEntityTypesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder> + getEntityTypesFieldBuilder() { + if (entityTypesBuilder_ == null) { + entityTypesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder>( + entityTypes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + entityTypes_ = null; + } + return entityTypesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * 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.dialogflow.cx.v3beta1.ListEntityTypesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListEntityTypesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListEntityTypesResponse(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.dialogflow.cx.v3beta1.ListEntityTypesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEntityTypesResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEntityTypesResponseOrBuilder.java new file mode 100644 index 000000000..83c88464c --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEntityTypesResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListEntityTypesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of entity types. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + java.util.List getEntityTypesList(); + /** + * + * + *
+   * The list of entity types. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.EntityType getEntityTypes(int index); + /** + * + * + *
+   * The list of entity types. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + int getEntityTypesCount(); + /** + * + * + *
+   * The list of entity types. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + java.util.List + getEntityTypesOrBuilderList(); + /** + * + * + *
+   * The list of entity types. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType entity_types = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder getEntityTypesOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEnvironmentsRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEnvironmentsRequest.java new file mode 100644 index 000000000..8c5425478 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEnvironmentsRequest.java @@ -0,0 +1,937 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironments].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest} + */ +public final class ListEnvironmentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest) + ListEnvironmentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListEnvironmentsRequest.newBuilder() to construct. + private ListEnvironmentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListEnvironmentsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListEnvironmentsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListEnvironmentsRequest( + 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.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all environments for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all environments for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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_; + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 20 and
+   * at most 100.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + 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.dialogflow.cx.v3beta1.ListEnvironmentsRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest) 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.dialogflow.cx.v3beta1.ListEnvironmentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest 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.dialogflow.cx.v3beta1.ListEnvironmentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest 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.dialogflow.cx.v3beta1.ListEnvironmentsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest 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.dialogflow.cx.v3beta1.ListEnvironmentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest 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.dialogflow.cx.v3beta1.ListEnvironmentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest 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.dialogflow.cx.v3beta1.ListEnvironmentsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironments].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest) + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest.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.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest(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.dialogflow.cx.v3beta1.ListEnvironmentsRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest.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.dialogflow.cx.v3beta1.ListEnvironmentsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all environments for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all environments for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all environments for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all environments for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all environments for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_; + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 20 and
+     * at most 100.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 20 and
+     * at most 100.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 20 and
+     * at most 100.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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.dialogflow.cx.v3beta1.ListEnvironmentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListEnvironmentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListEnvironmentsRequest(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.dialogflow.cx.v3beta1.ListEnvironmentsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEnvironmentsRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEnvironmentsRequestOrBuilder.java new file mode 100644 index 000000000..caac3ef83 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEnvironmentsRequestOrBuilder.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/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListEnvironmentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all environments for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all environments for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 20 and
+   * at most 100.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEnvironmentsResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEnvironmentsResponse.java new file mode 100644 index 000000000..258d49882 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEnvironmentsResponse.java @@ -0,0 +1,1225 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The response message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironments].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse} + */ +public final class ListEnvironmentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse) + ListEnvironmentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListEnvironmentsResponse.newBuilder() to construct. + private ListEnvironmentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListEnvironmentsResponse() { + environments_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListEnvironmentsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListEnvironmentsResponse( + 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)) { + environments_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + environments_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Environment.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)) { + environments_ = java.util.Collections.unmodifiableList(environments_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse.Builder.class); + } + + public static final int ENVIRONMENTS_FIELD_NUMBER = 1; + private java.util.List environments_; + /** + * + * + *
+   * The list of environments. There will be a maximum number of items
+   * returned based on the page_size field in the request. The list may in some
+   * cases be empty or contain fewer entries than page_size even if this isn't
+   * the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + @java.lang.Override + public java.util.List getEnvironmentsList() { + return environments_; + } + /** + * + * + *
+   * The list of environments. There will be a maximum number of items
+   * returned based on the page_size field in the request. The list may in some
+   * cases be empty or contain fewer entries than page_size even if this isn't
+   * the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + @java.lang.Override + public java.util.List + getEnvironmentsOrBuilderList() { + return environments_; + } + /** + * + * + *
+   * The list of environments. There will be a maximum number of items
+   * returned based on the page_size field in the request. The list may in some
+   * cases be empty or contain fewer entries than page_size even if this isn't
+   * the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + @java.lang.Override + public int getEnvironmentsCount() { + return environments_.size(); + } + /** + * + * + *
+   * The list of environments. There will be a maximum number of items
+   * returned based on the page_size field in the request. The list may in some
+   * cases be empty or contain fewer entries than page_size even if this isn't
+   * the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironments(int index) { + return environments_.get(index); + } + /** + * + * + *
+   * The list of environments. There will be a maximum number of items
+   * returned based on the page_size field in the request. The list may in some
+   * cases be empty or contain fewer entries than page_size even if this isn't
+   * the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder getEnvironmentsOrBuilder( + int index) { + return environments_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + 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 < environments_.size(); i++) { + output.writeMessage(1, environments_.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 < environments_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, environments_.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.dialogflow.cx.v3beta1.ListEnvironmentsResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse) obj; + + if (!getEnvironmentsList().equals(other.getEnvironmentsList())) 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 (getEnvironmentsCount() > 0) { + hash = (37 * hash) + ENVIRONMENTS_FIELD_NUMBER; + hash = (53 * hash) + getEnvironmentsList().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.dialogflow.cx.v3beta1.ListEnvironmentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse 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.dialogflow.cx.v3beta1.ListEnvironmentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse 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.dialogflow.cx.v3beta1.ListEnvironmentsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse 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.dialogflow.cx.v3beta1.ListEnvironmentsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse 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.dialogflow.cx.v3beta1.ListEnvironmentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse 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.dialogflow.cx.v3beta1.ListEnvironmentsResponse 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 response message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironments].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse) + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEnvironmentsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (environmentsBuilder_ == null) { + environments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + environmentsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListEnvironmentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse(this); + int from_bitField0_ = bitField0_; + if (environmentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + environments_ = java.util.Collections.unmodifiableList(environments_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.environments_ = environments_; + } else { + result.environments_ = environmentsBuilder_.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.dialogflow.cx.v3beta1.ListEnvironmentsResponse) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse.getDefaultInstance()) + return this; + if (environmentsBuilder_ == null) { + if (!other.environments_.isEmpty()) { + if (environments_.isEmpty()) { + environments_ = other.environments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEnvironmentsIsMutable(); + environments_.addAll(other.environments_); + } + onChanged(); + } + } else { + if (!other.environments_.isEmpty()) { + if (environmentsBuilder_.isEmpty()) { + environmentsBuilder_.dispose(); + environmentsBuilder_ = null; + environments_ = other.environments_; + bitField0_ = (bitField0_ & ~0x00000001); + environmentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEnvironmentsFieldBuilder() + : null; + } else { + environmentsBuilder_.addAllMessages(other.environments_); + } + } + } + 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.dialogflow.cx.v3beta1.ListEnvironmentsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List environments_ = + java.util.Collections.emptyList(); + + private void ensureEnvironmentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + environments_ = + new java.util.ArrayList( + environments_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment, + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder> + environmentsBuilder_; + + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public java.util.List + getEnvironmentsList() { + if (environmentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(environments_); + } else { + return environmentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public int getEnvironmentsCount() { + if (environmentsBuilder_ == null) { + return environments_.size(); + } else { + return environmentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironments(int index) { + if (environmentsBuilder_ == null) { + return environments_.get(index); + } else { + return environmentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder setEnvironments( + int index, com.google.cloud.dialogflow.cx.v3beta1.Environment value) { + if (environmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvironmentsIsMutable(); + environments_.set(index, value); + onChanged(); + } else { + environmentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder setEnvironments( + int index, com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder builderForValue) { + if (environmentsBuilder_ == null) { + ensureEnvironmentsIsMutable(); + environments_.set(index, builderForValue.build()); + onChanged(); + } else { + environmentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder addEnvironments(com.google.cloud.dialogflow.cx.v3beta1.Environment value) { + if (environmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvironmentsIsMutable(); + environments_.add(value); + onChanged(); + } else { + environmentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder addEnvironments( + int index, com.google.cloud.dialogflow.cx.v3beta1.Environment value) { + if (environmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvironmentsIsMutable(); + environments_.add(index, value); + onChanged(); + } else { + environmentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder addEnvironments( + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder builderForValue) { + if (environmentsBuilder_ == null) { + ensureEnvironmentsIsMutable(); + environments_.add(builderForValue.build()); + onChanged(); + } else { + environmentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder addEnvironments( + int index, com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder builderForValue) { + if (environmentsBuilder_ == null) { + ensureEnvironmentsIsMutable(); + environments_.add(index, builderForValue.build()); + onChanged(); + } else { + environmentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder addAllEnvironments( + java.lang.Iterable values) { + if (environmentsBuilder_ == null) { + ensureEnvironmentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, environments_); + onChanged(); + } else { + environmentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder clearEnvironments() { + if (environmentsBuilder_ == null) { + environments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + environmentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder removeEnvironments(int index) { + if (environmentsBuilder_ == null) { + ensureEnvironmentsIsMutable(); + environments_.remove(index); + onChanged(); + } else { + environmentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder getEnvironmentsBuilder( + int index) { + return getEnvironmentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder getEnvironmentsOrBuilder( + int index) { + if (environmentsBuilder_ == null) { + return environments_.get(index); + } else { + return environmentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public java.util.List + getEnvironmentsOrBuilderList() { + if (environmentsBuilder_ != null) { + return environmentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(environments_); + } + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder addEnvironmentsBuilder() { + return getEnvironmentsFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.Environment.getDefaultInstance()); + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder addEnvironmentsBuilder( + int index) { + return getEnvironmentsFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.Environment.getDefaultInstance()); + } + /** + * + * + *
+     * The list of environments. There will be a maximum number of items
+     * returned based on the page_size field in the request. The list may in some
+     * cases be empty or contain fewer entries than page_size even if this isn't
+     * the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public java.util.List + getEnvironmentsBuilderList() { + return getEnvironmentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment, + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder> + getEnvironmentsFieldBuilder() { + if (environmentsBuilder_ == null) { + environmentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment, + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder>( + environments_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + environments_ = null; + } + return environmentsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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.dialogflow.cx.v3beta1.ListEnvironmentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListEnvironmentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListEnvironmentsResponse(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.dialogflow.cx.v3beta1.ListEnvironmentsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEnvironmentsResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEnvironmentsResponseOrBuilder.java new file mode 100644 index 000000000..40d971bca --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListEnvironmentsResponseOrBuilder.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/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListEnvironmentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of environments. There will be a maximum number of items
+   * returned based on the page_size field in the request. The list may in some
+   * cases be empty or contain fewer entries than page_size even if this isn't
+   * the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + java.util.List getEnvironmentsList(); + /** + * + * + *
+   * The list of environments. There will be a maximum number of items
+   * returned based on the page_size field in the request. The list may in some
+   * cases be empty or contain fewer entries than page_size even if this isn't
+   * the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironments(int index); + /** + * + * + *
+   * The list of environments. There will be a maximum number of items
+   * returned based on the page_size field in the request. The list may in some
+   * cases be empty or contain fewer entries than page_size even if this isn't
+   * the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + int getEnvironmentsCount(); + /** + * + * + *
+   * The list of environments. There will be a maximum number of items
+   * returned based on the page_size field in the request. The list may in some
+   * cases be empty or contain fewer entries than page_size even if this isn't
+   * the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + java.util.List + getEnvironmentsOrBuilderList(); + /** + * + * + *
+   * The list of environments. There will be a maximum number of items
+   * returned based on the page_size field in the request. The list may in some
+   * cases be empty or contain fewer entries than page_size even if this isn't
+   * the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder getEnvironmentsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListFlowsRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListFlowsRequest.java new file mode 100644 index 000000000..4b88dfbdb --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListFlowsRequest.java @@ -0,0 +1,1166 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest} + */ +public final class ListFlowsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest) + ListFlowsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFlowsRequest.newBuilder() to construct. + private ListFlowsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFlowsRequest() { + parent_ = ""; + pageToken_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFlowsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFlowsRequest( + 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(); + + languageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListFlowsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListFlowsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The agent containing the flows.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 agent containing the flows.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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_; + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + 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 LANGUAGE_CODE_FIELD_NUMBER = 4; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language to list flows for. The following fields are language
+   * dependent:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 4; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language to list flows for. The following fields are language
+   * dependent:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 4; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + 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 (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, languageCode_); + } + 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 (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + 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) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest 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.dialogflow.cx.v3beta1.ListFlowsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest 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.dialogflow.cx.v3beta1.ListFlowsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest 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.dialogflow.cx.v3beta1.ListFlowsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest 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.dialogflow.cx.v3beta1.ListFlowsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest 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.dialogflow.cx.v3beta1.ListFlowsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest) + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListFlowsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListFlowsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest.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_ = ""; + + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListFlowsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest.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.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The agent containing the flows.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent containing the flows.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent containing the flows.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent containing the flows.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The agent containing the flows.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_; + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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 languageCode_ = ""; + /** + * + * + *
+     * The language to list flows for. The following fields are language
+     * dependent:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 4; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language to list flows for. The following fields are language
+     * dependent:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 4; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language to list flows for. The following fields are language
+     * dependent:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 4; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list flows for. The following fields are language
+     * dependent:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 4; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list flows for. The following fields are language
+     * dependent:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 4; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFlowsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFlowsRequest(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.dialogflow.cx.v3beta1.ListFlowsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListFlowsRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListFlowsRequestOrBuilder.java new file mode 100644 index 000000000..1afea2a4c --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListFlowsRequestOrBuilder.java @@ -0,0 +1,136 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListFlowsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The agent containing the flows.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The agent containing the flows.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The language to list flows for. The following fields are language
+   * dependent:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 4; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language to list flows for. The following fields are language
+   * dependent:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 4; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListFlowsResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListFlowsResponse.java new file mode 100644 index 000000000..e9c3879e1 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListFlowsResponse.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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The response message for [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse} + */ +public final class ListFlowsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse) + ListFlowsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFlowsResponse.newBuilder() to construct. + private ListFlowsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFlowsResponse() { + flows_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFlowsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFlowsResponse( + 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)) { + flows_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + flows_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Flow.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)) { + flows_ = java.util.Collections.unmodifiableList(flows_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListFlowsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListFlowsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse.Builder.class); + } + + public static final int FLOWS_FIELD_NUMBER = 1; + private java.util.List flows_; + /** + * + * + *
+   * The list of flows. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + @java.lang.Override + public java.util.List getFlowsList() { + return flows_; + } + /** + * + * + *
+   * The list of flows. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + @java.lang.Override + public java.util.List + getFlowsOrBuilderList() { + return flows_; + } + /** + * + * + *
+   * The list of flows. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + @java.lang.Override + public int getFlowsCount() { + return flows_.size(); + } + /** + * + * + *
+   * The list of flows. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Flow getFlows(int index) { + return flows_.get(index); + } + /** + * + * + *
+   * The list of flows. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder getFlowsOrBuilder(int index) { + return flows_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + 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 < flows_.size(); i++) { + output.writeMessage(1, flows_.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 < flows_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, flows_.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.dialogflow.cx.v3beta1.ListFlowsResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse) obj; + + if (!getFlowsList().equals(other.getFlowsList())) 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 (getFlowsCount() > 0) { + hash = (37 * hash) + FLOWS_FIELD_NUMBER; + hash = (53 * hash) + getFlowsList().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.dialogflow.cx.v3beta1.ListFlowsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse 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.dialogflow.cx.v3beta1.ListFlowsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse 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.dialogflow.cx.v3beta1.ListFlowsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse 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.dialogflow.cx.v3beta1.ListFlowsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse 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.dialogflow.cx.v3beta1.ListFlowsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse 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.dialogflow.cx.v3beta1.ListFlowsResponse 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 response message for [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse) + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListFlowsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListFlowsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFlowsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (flowsBuilder_ == null) { + flows_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + flowsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListFlowsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse(this); + int from_bitField0_ = bitField0_; + if (flowsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + flows_ = java.util.Collections.unmodifiableList(flows_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.flows_ = flows_; + } else { + result.flows_ = flowsBuilder_.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.dialogflow.cx.v3beta1.ListFlowsResponse) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse.getDefaultInstance()) + return this; + if (flowsBuilder_ == null) { + if (!other.flows_.isEmpty()) { + if (flows_.isEmpty()) { + flows_ = other.flows_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFlowsIsMutable(); + flows_.addAll(other.flows_); + } + onChanged(); + } + } else { + if (!other.flows_.isEmpty()) { + if (flowsBuilder_.isEmpty()) { + flowsBuilder_.dispose(); + flowsBuilder_ = null; + flows_ = other.flows_; + bitField0_ = (bitField0_ & ~0x00000001); + flowsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFlowsFieldBuilder() + : null; + } else { + flowsBuilder_.addAllMessages(other.flows_); + } + } + } + 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.dialogflow.cx.v3beta1.ListFlowsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List flows_ = + java.util.Collections.emptyList(); + + private void ensureFlowsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + flows_ = new java.util.ArrayList(flows_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Flow, + com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder> + flowsBuilder_; + + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public java.util.List getFlowsList() { + if (flowsBuilder_ == null) { + return java.util.Collections.unmodifiableList(flows_); + } else { + return flowsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public int getFlowsCount() { + if (flowsBuilder_ == null) { + return flows_.size(); + } else { + return flowsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Flow getFlows(int index) { + if (flowsBuilder_ == null) { + return flows_.get(index); + } else { + return flowsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public Builder setFlows(int index, com.google.cloud.dialogflow.cx.v3beta1.Flow value) { + if (flowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlowsIsMutable(); + flows_.set(index, value); + onChanged(); + } else { + flowsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public Builder setFlows( + int index, com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder builderForValue) { + if (flowsBuilder_ == null) { + ensureFlowsIsMutable(); + flows_.set(index, builderForValue.build()); + onChanged(); + } else { + flowsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public Builder addFlows(com.google.cloud.dialogflow.cx.v3beta1.Flow value) { + if (flowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlowsIsMutable(); + flows_.add(value); + onChanged(); + } else { + flowsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public Builder addFlows(int index, com.google.cloud.dialogflow.cx.v3beta1.Flow value) { + if (flowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlowsIsMutable(); + flows_.add(index, value); + onChanged(); + } else { + flowsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public Builder addFlows(com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder builderForValue) { + if (flowsBuilder_ == null) { + ensureFlowsIsMutable(); + flows_.add(builderForValue.build()); + onChanged(); + } else { + flowsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public Builder addFlows( + int index, com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder builderForValue) { + if (flowsBuilder_ == null) { + ensureFlowsIsMutable(); + flows_.add(index, builderForValue.build()); + onChanged(); + } else { + flowsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public Builder addAllFlows( + java.lang.Iterable values) { + if (flowsBuilder_ == null) { + ensureFlowsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, flows_); + onChanged(); + } else { + flowsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public Builder clearFlows() { + if (flowsBuilder_ == null) { + flows_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + flowsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public Builder removeFlows(int index) { + if (flowsBuilder_ == null) { + ensureFlowsIsMutable(); + flows_.remove(index); + onChanged(); + } else { + flowsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder getFlowsBuilder(int index) { + return getFlowsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder getFlowsOrBuilder(int index) { + if (flowsBuilder_ == null) { + return flows_.get(index); + } else { + return flowsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public java.util.List + getFlowsOrBuilderList() { + if (flowsBuilder_ != null) { + return flowsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(flows_); + } + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder addFlowsBuilder() { + return getFlowsFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.Flow.getDefaultInstance()); + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder addFlowsBuilder(int index) { + return getFlowsFieldBuilder() + .addBuilder(index, com.google.cloud.dialogflow.cx.v3beta1.Flow.getDefaultInstance()); + } + /** + * + * + *
+     * The list of flows. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + public java.util.List + getFlowsBuilderList() { + return getFlowsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Flow, + com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder> + getFlowsFieldBuilder() { + if (flowsBuilder_ == null) { + flowsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Flow, + com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder>( + flows_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + flows_ = null; + } + return flowsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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.dialogflow.cx.v3beta1.ListFlowsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFlowsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFlowsResponse(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.dialogflow.cx.v3beta1.ListFlowsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListFlowsResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListFlowsResponseOrBuilder.java new file mode 100644 index 000000000..a676308b5 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListFlowsResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListFlowsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of flows. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + java.util.List getFlowsList(); + /** + * + * + *
+   * The list of flows. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.Flow getFlows(int index); + /** + * + * + *
+   * The list of flows. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + int getFlowsCount(); + /** + * + * + *
+   * The list of flows. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + java.util.List + getFlowsOrBuilderList(); + /** + * + * + *
+   * The list of flows. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Flow flows = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder getFlowsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListIntentsRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListIntentsRequest.java new file mode 100644 index 000000000..a13bed6f4 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListIntentsRequest.java @@ -0,0 +1,1313 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Intents.ListIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ListIntents].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest} + */ +public final class ListIntentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest) + ListIntentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListIntentsRequest.newBuilder() to construct. + private ListIntentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListIntentsRequest() { + parent_ = ""; + languageCode_ = ""; + intentView_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListIntentsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListIntentsRequest( + 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(); + + languageCode_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 40: + { + int rawValue = input.readEnum(); + + intentView_ = 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.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The agent to list all intents for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 agent to list all intents for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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 LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language to list intents for. The following fields are language
+   * dependent:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language to list intents for. The following fields are language
+   * dependent:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INTENT_VIEW_FIELD_NUMBER = 5; + private int intentView_; + /** + * + * + *
+   * The resource view to apply to the returned intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentView intent_view = 5; + * + * @return The enum numeric value on the wire for intentView. + */ + @java.lang.Override + public int getIntentViewValue() { + return intentView_; + } + /** + * + * + *
+   * The resource view to apply to the returned intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentView intent_view = 5; + * + * @return The intentView. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.IntentView getIntentView() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.IntentView result = + com.google.cloud.dialogflow.cx.v3beta1.IntentView.valueOf(intentView_); + return result == null ? com.google.cloud.dialogflow.cx.v3beta1.IntentView.UNRECOGNIZED : result; + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + 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 (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + if (intentView_ + != com.google.cloud.dialogflow.cx.v3beta1.IntentView.INTENT_VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(5, intentView_); + } + 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 (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + if (intentView_ + != com.google.cloud.dialogflow.cx.v3beta1.IntentView.INTENT_VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, intentView_); + } + 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.dialogflow.cx.v3beta1.ListIntentsRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (intentView_ != other.intentView_) 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) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (37 * hash) + INTENT_VIEW_FIELD_NUMBER; + hash = (53 * hash) + intentView_; + 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.dialogflow.cx.v3beta1.ListIntentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest 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.dialogflow.cx.v3beta1.ListIntentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest 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.dialogflow.cx.v3beta1.ListIntentsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest 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.dialogflow.cx.v3beta1.ListIntentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest 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.dialogflow.cx.v3beta1.ListIntentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest 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.dialogflow.cx.v3beta1.ListIntentsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Intents.ListIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ListIntents].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest) + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest.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_ = ""; + + languageCode_ = ""; + + intentView_ = 0; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest(this); + result.parent_ = parent_; + result.languageCode_ = languageCode_; + result.intentView_ = intentView_; + 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.dialogflow.cx.v3beta1.ListIntentsRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + if (other.intentView_ != 0) { + setIntentViewValue(other.getIntentViewValue()); + } + 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.dialogflow.cx.v3beta1.ListIntentsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The agent to list all intents for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to list all intents for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to list all intents for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to list all intents for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The agent to list all intents for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 languageCode_ = ""; + /** + * + * + *
+     * The language to list intents for. The following fields are language
+     * dependent:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language to list intents for. The following fields are language
+     * dependent:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language to list intents for. The following fields are language
+     * dependent:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list intents for. The following fields are language
+     * dependent:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list intents for. The following fields are language
+     * dependent:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + private int intentView_ = 0; + /** + * + * + *
+     * The resource view to apply to the returned intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentView intent_view = 5; + * + * @return The enum numeric value on the wire for intentView. + */ + @java.lang.Override + public int getIntentViewValue() { + return intentView_; + } + /** + * + * + *
+     * The resource view to apply to the returned intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentView intent_view = 5; + * + * @param value The enum numeric value on the wire for intentView to set. + * @return This builder for chaining. + */ + public Builder setIntentViewValue(int value) { + + intentView_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource view to apply to the returned intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentView intent_view = 5; + * + * @return The intentView. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.IntentView getIntentView() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.IntentView result = + com.google.cloud.dialogflow.cx.v3beta1.IntentView.valueOf(intentView_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.IntentView.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The resource view to apply to the returned intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentView intent_view = 5; + * + * @param value The intentView to set. + * @return This builder for chaining. + */ + public Builder setIntentView(com.google.cloud.dialogflow.cx.v3beta1.IntentView value) { + if (value == null) { + throw new NullPointerException(); + } + + intentView_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource view to apply to the returned intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentView intent_view = 5; + * + * @return This builder for chaining. + */ + public Builder clearIntentView() { + + intentView_ = 0; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @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.dialogflow.cx.v3beta1.ListIntentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListIntentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListIntentsRequest(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.dialogflow.cx.v3beta1.ListIntentsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListIntentsRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListIntentsRequestOrBuilder.java new file mode 100644 index 000000000..9dcf9f538 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListIntentsRequestOrBuilder.java @@ -0,0 +1,159 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListIntentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The agent to list all intents for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The agent to list all intents for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The language to list intents for. The following fields are language
+   * dependent:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language to list intents for. The following fields are language
+   * dependent:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + + /** + * + * + *
+   * The resource view to apply to the returned intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentView intent_view = 5; + * + * @return The enum numeric value on the wire for intentView. + */ + int getIntentViewValue(); + /** + * + * + *
+   * The resource view to apply to the returned intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentView intent_view = 5; + * + * @return The intentView. + */ + com.google.cloud.dialogflow.cx.v3beta1.IntentView getIntentView(); + + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListIntentsResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListIntentsResponse.java new file mode 100644 index 000000000..67ee47f24 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListIntentsResponse.java @@ -0,0 +1,1160 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The response message for [Intents.ListIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ListIntents].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse} + */ +public final class ListIntentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse) + ListIntentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListIntentsResponse.newBuilder() to construct. + private ListIntentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListIntentsResponse() { + intents_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListIntentsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListIntentsResponse( + 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)) { + intents_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + intents_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Intent.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)) { + intents_ = java.util.Collections.unmodifiableList(intents_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse.Builder.class); + } + + public static final int INTENTS_FIELD_NUMBER = 1; + private java.util.List intents_; + /** + * + * + *
+   * The list of intents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + @java.lang.Override + public java.util.List getIntentsList() { + return intents_; + } + /** + * + * + *
+   * The list of intents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + @java.lang.Override + public java.util.List + getIntentsOrBuilderList() { + return intents_; + } + /** + * + * + *
+   * The list of intents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + @java.lang.Override + public int getIntentsCount() { + return intents_.size(); + } + /** + * + * + *
+   * The list of intents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent getIntents(int index) { + return intents_.get(index); + } + /** + * + * + *
+   * The list of intents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentsOrBuilder(int index) { + return intents_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + 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 < intents_.size(); i++) { + output.writeMessage(1, intents_.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 < intents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, intents_.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.dialogflow.cx.v3beta1.ListIntentsResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse) obj; + + if (!getIntentsList().equals(other.getIntentsList())) 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 (getIntentsCount() > 0) { + hash = (37 * hash) + INTENTS_FIELD_NUMBER; + hash = (53 * hash) + getIntentsList().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.dialogflow.cx.v3beta1.ListIntentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse 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.dialogflow.cx.v3beta1.ListIntentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse 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.dialogflow.cx.v3beta1.ListIntentsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse 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.dialogflow.cx.v3beta1.ListIntentsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse 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.dialogflow.cx.v3beta1.ListIntentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse 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.dialogflow.cx.v3beta1.ListIntentsResponse 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 response message for [Intents.ListIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ListIntents].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse) + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getIntentsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (intentsBuilder_ == null) { + intents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + intentsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListIntentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse(this); + int from_bitField0_ = bitField0_; + if (intentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + intents_ = java.util.Collections.unmodifiableList(intents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.intents_ = intents_; + } else { + result.intents_ = intentsBuilder_.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.dialogflow.cx.v3beta1.ListIntentsResponse) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse.getDefaultInstance()) + return this; + if (intentsBuilder_ == null) { + if (!other.intents_.isEmpty()) { + if (intents_.isEmpty()) { + intents_ = other.intents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIntentsIsMutable(); + intents_.addAll(other.intents_); + } + onChanged(); + } + } else { + if (!other.intents_.isEmpty()) { + if (intentsBuilder_.isEmpty()) { + intentsBuilder_.dispose(); + intentsBuilder_ = null; + intents_ = other.intents_; + bitField0_ = (bitField0_ & ~0x00000001); + intentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIntentsFieldBuilder() + : null; + } else { + intentsBuilder_.addAllMessages(other.intents_); + } + } + } + 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.dialogflow.cx.v3beta1.ListIntentsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List intents_ = + java.util.Collections.emptyList(); + + private void ensureIntentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + intents_ = new java.util.ArrayList(intents_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder> + intentsBuilder_; + + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public java.util.List getIntentsList() { + if (intentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(intents_); + } else { + return intentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public int getIntentsCount() { + if (intentsBuilder_ == null) { + return intents_.size(); + } else { + return intentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent getIntents(int index) { + if (intentsBuilder_ == null) { + return intents_.get(index); + } else { + return intentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public Builder setIntents(int index, com.google.cloud.dialogflow.cx.v3beta1.Intent value) { + if (intentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntentsIsMutable(); + intents_.set(index, value); + onChanged(); + } else { + intentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public Builder setIntents( + int index, com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder builderForValue) { + if (intentsBuilder_ == null) { + ensureIntentsIsMutable(); + intents_.set(index, builderForValue.build()); + onChanged(); + } else { + intentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public Builder addIntents(com.google.cloud.dialogflow.cx.v3beta1.Intent value) { + if (intentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntentsIsMutable(); + intents_.add(value); + onChanged(); + } else { + intentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public Builder addIntents(int index, com.google.cloud.dialogflow.cx.v3beta1.Intent value) { + if (intentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntentsIsMutable(); + intents_.add(index, value); + onChanged(); + } else { + intentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public Builder addIntents( + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder builderForValue) { + if (intentsBuilder_ == null) { + ensureIntentsIsMutable(); + intents_.add(builderForValue.build()); + onChanged(); + } else { + intentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public Builder addIntents( + int index, com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder builderForValue) { + if (intentsBuilder_ == null) { + ensureIntentsIsMutable(); + intents_.add(index, builderForValue.build()); + onChanged(); + } else { + intentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public Builder addAllIntents( + java.lang.Iterable values) { + if (intentsBuilder_ == null) { + ensureIntentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, intents_); + onChanged(); + } else { + intentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public Builder clearIntents() { + if (intentsBuilder_ == null) { + intents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + intentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public Builder removeIntents(int index) { + if (intentsBuilder_ == null) { + ensureIntentsIsMutable(); + intents_.remove(index); + onChanged(); + } else { + intentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder getIntentsBuilder(int index) { + return getIntentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentsOrBuilder(int index) { + if (intentsBuilder_ == null) { + return intents_.get(index); + } else { + return intentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public java.util.List + getIntentsOrBuilderList() { + if (intentsBuilder_ != null) { + return intentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(intents_); + } + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder addIntentsBuilder() { + return getIntentsFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance()); + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder addIntentsBuilder(int index) { + return getIntentsFieldBuilder() + .addBuilder(index, com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance()); + } + /** + * + * + *
+     * The list of intents. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + public java.util.List + getIntentsBuilderList() { + return getIntentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder> + getIntentsFieldBuilder() { + if (intentsBuilder_ == null) { + intentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder>( + intents_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + intents_ = null; + } + return intentsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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.dialogflow.cx.v3beta1.ListIntentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListIntentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListIntentsResponse(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.dialogflow.cx.v3beta1.ListIntentsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListIntentsResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListIntentsResponseOrBuilder.java new file mode 100644 index 000000000..c50f357b6 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListIntentsResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListIntentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of intents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + java.util.List getIntentsList(); + /** + * + * + *
+   * The list of intents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.Intent getIntents(int index); + /** + * + * + *
+   * The list of intents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + int getIntentsCount(); + /** + * + * + *
+   * The list of intents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + java.util.List + getIntentsOrBuilderList(); + /** + * + * + *
+   * The list of intents. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Intent intents = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListPagesRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListPagesRequest.java new file mode 100644 index 000000000..e71aac1d9 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListPagesRequest.java @@ -0,0 +1,1201 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Pages.ListPages][google.cloud.dialogflow.cx.v3beta1.Pages.ListPages].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListPagesRequest} + */ +public final class ListPagesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListPagesRequest) + ListPagesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPagesRequest.newBuilder() to construct. + private ListPagesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPagesRequest() { + parent_ = ""; + languageCode_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListPagesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListPagesRequest( + 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(); + + languageCode_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + 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.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The flow to list all pages for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 flow to list all pages for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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 LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language to list pages for. The following fields are language
+   * dependent:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language to list pages for. The following fields are language
+   * dependent:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + 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 (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, 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 (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, 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.dialogflow.cx.v3beta1.ListPagesRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) 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) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().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.dialogflow.cx.v3beta1.ListPagesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest 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.dialogflow.cx.v3beta1.ListPagesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest 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.dialogflow.cx.v3beta1.ListPagesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest 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.dialogflow.cx.v3beta1.ListPagesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest 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.dialogflow.cx.v3beta1.ListPagesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest 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.dialogflow.cx.v3beta1.ListPagesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Pages.ListPages][google.cloud.dialogflow.cx.v3beta1.Pages.ListPages].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListPagesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListPagesRequest) + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest.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_ = ""; + + languageCode_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest(this); + result.parent_ = parent_; + result.languageCode_ = languageCode_; + 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.dialogflow.cx.v3beta1.ListPagesRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + 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.dialogflow.cx.v3beta1.ListPagesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The flow to list all pages for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to list all pages for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to list all pages for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to list all pages for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The flow to list all pages for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 languageCode_ = ""; + /** + * + * + *
+     * The language to list pages for. The following fields are language
+     * dependent:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language to list pages for. The following fields are language
+     * dependent:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language to list pages for. The following fields are language
+     * dependent:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list pages for. The following fields are language
+     * dependent:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list pages for. The following fields are language
+     * dependent:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 4; + * + * @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.dialogflow.cx.v3beta1.ListPagesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListPagesRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPagesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListPagesRequest(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.dialogflow.cx.v3beta1.ListPagesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListPagesRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListPagesRequestOrBuilder.java new file mode 100644 index 000000000..3f2485ac3 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListPagesRequestOrBuilder.java @@ -0,0 +1,146 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListPagesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListPagesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The flow to list all pages for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The flow to list all pages for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The language to list pages for. The following fields are language
+   * dependent:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language to list pages for. The following fields are language
+   * dependent:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListPagesResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListPagesResponse.java new file mode 100644 index 000000000..3f7469217 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListPagesResponse.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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The response message for [Pages.ListPages][google.cloud.dialogflow.cx.v3beta1.Pages.ListPages].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListPagesResponse} + */ +public final class ListPagesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListPagesResponse) + ListPagesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPagesResponse.newBuilder() to construct. + private ListPagesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPagesResponse() { + pages_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListPagesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListPagesResponse( + 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)) { + pages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + pages_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Page.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)) { + pages_ = java.util.Collections.unmodifiableList(pages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse.Builder.class); + } + + public static final int PAGES_FIELD_NUMBER = 1; + private java.util.List pages_; + /** + * + * + *
+   * The list of pages. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + @java.lang.Override + public java.util.List getPagesList() { + return pages_; + } + /** + * + * + *
+   * The list of pages. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + @java.lang.Override + public java.util.List + getPagesOrBuilderList() { + return pages_; + } + /** + * + * + *
+   * The list of pages. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + @java.lang.Override + public int getPagesCount() { + return pages_.size(); + } + /** + * + * + *
+   * The list of pages. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Page getPages(int index) { + return pages_.get(index); + } + /** + * + * + *
+   * The list of pages. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getPagesOrBuilder(int index) { + return pages_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + 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 < pages_.size(); i++) { + output.writeMessage(1, pages_.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 < pages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, pages_.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.dialogflow.cx.v3beta1.ListPagesResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse) obj; + + if (!getPagesList().equals(other.getPagesList())) 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 (getPagesCount() > 0) { + hash = (37 * hash) + PAGES_FIELD_NUMBER; + hash = (53 * hash) + getPagesList().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.dialogflow.cx.v3beta1.ListPagesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse 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.dialogflow.cx.v3beta1.ListPagesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse 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.dialogflow.cx.v3beta1.ListPagesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse 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.dialogflow.cx.v3beta1.ListPagesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse 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.dialogflow.cx.v3beta1.ListPagesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse 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.dialogflow.cx.v3beta1.ListPagesResponse 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 response message for [Pages.ListPages][google.cloud.dialogflow.cx.v3beta1.Pages.ListPages].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListPagesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListPagesResponse) + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPagesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (pagesBuilder_ == null) { + pages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + pagesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse(this); + int from_bitField0_ = bitField0_; + if (pagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + pages_ = java.util.Collections.unmodifiableList(pages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.pages_ = pages_; + } else { + result.pages_ = pagesBuilder_.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.dialogflow.cx.v3beta1.ListPagesResponse) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse.getDefaultInstance()) + return this; + if (pagesBuilder_ == null) { + if (!other.pages_.isEmpty()) { + if (pages_.isEmpty()) { + pages_ = other.pages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePagesIsMutable(); + pages_.addAll(other.pages_); + } + onChanged(); + } + } else { + if (!other.pages_.isEmpty()) { + if (pagesBuilder_.isEmpty()) { + pagesBuilder_.dispose(); + pagesBuilder_ = null; + pages_ = other.pages_; + bitField0_ = (bitField0_ & ~0x00000001); + pagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPagesFieldBuilder() + : null; + } else { + pagesBuilder_.addAllMessages(other.pages_); + } + } + } + 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.dialogflow.cx.v3beta1.ListPagesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List pages_ = + java.util.Collections.emptyList(); + + private void ensurePagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + pages_ = new java.util.ArrayList(pages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder> + pagesBuilder_; + + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public java.util.List getPagesList() { + if (pagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(pages_); + } else { + return pagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public int getPagesCount() { + if (pagesBuilder_ == null) { + return pages_.size(); + } else { + return pagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Page getPages(int index) { + if (pagesBuilder_ == null) { + return pages_.get(index); + } else { + return pagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public Builder setPages(int index, com.google.cloud.dialogflow.cx.v3beta1.Page value) { + if (pagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePagesIsMutable(); + pages_.set(index, value); + onChanged(); + } else { + pagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public Builder setPages( + int index, com.google.cloud.dialogflow.cx.v3beta1.Page.Builder builderForValue) { + if (pagesBuilder_ == null) { + ensurePagesIsMutable(); + pages_.set(index, builderForValue.build()); + onChanged(); + } else { + pagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public Builder addPages(com.google.cloud.dialogflow.cx.v3beta1.Page value) { + if (pagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePagesIsMutable(); + pages_.add(value); + onChanged(); + } else { + pagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public Builder addPages(int index, com.google.cloud.dialogflow.cx.v3beta1.Page value) { + if (pagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePagesIsMutable(); + pages_.add(index, value); + onChanged(); + } else { + pagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public Builder addPages(com.google.cloud.dialogflow.cx.v3beta1.Page.Builder builderForValue) { + if (pagesBuilder_ == null) { + ensurePagesIsMutable(); + pages_.add(builderForValue.build()); + onChanged(); + } else { + pagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public Builder addPages( + int index, com.google.cloud.dialogflow.cx.v3beta1.Page.Builder builderForValue) { + if (pagesBuilder_ == null) { + ensurePagesIsMutable(); + pages_.add(index, builderForValue.build()); + onChanged(); + } else { + pagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public Builder addAllPages( + java.lang.Iterable values) { + if (pagesBuilder_ == null) { + ensurePagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pages_); + onChanged(); + } else { + pagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public Builder clearPages() { + if (pagesBuilder_ == null) { + pages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + pagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public Builder removePages(int index) { + if (pagesBuilder_ == null) { + ensurePagesIsMutable(); + pages_.remove(index); + onChanged(); + } else { + pagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Page.Builder getPagesBuilder(int index) { + return getPagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getPagesOrBuilder(int index) { + if (pagesBuilder_ == null) { + return pages_.get(index); + } else { + return pagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public java.util.List + getPagesOrBuilderList() { + if (pagesBuilder_ != null) { + return pagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pages_); + } + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Page.Builder addPagesBuilder() { + return getPagesFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance()); + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Page.Builder addPagesBuilder(int index) { + return getPagesFieldBuilder() + .addBuilder(index, com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance()); + } + /** + * + * + *
+     * The list of pages. There will be a maximum number of items returned based
+     * on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + public java.util.List + getPagesBuilderList() { + return getPagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder> + getPagesFieldBuilder() { + if (pagesBuilder_ == null) { + pagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder>( + pages_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + pages_ = null; + } + return pagesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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.dialogflow.cx.v3beta1.ListPagesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListPagesResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPagesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListPagesResponse(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.dialogflow.cx.v3beta1.ListPagesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListPagesResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListPagesResponseOrBuilder.java new file mode 100644 index 000000000..c33879b96 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListPagesResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListPagesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListPagesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of pages. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + java.util.List getPagesList(); + /** + * + * + *
+   * The list of pages. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.Page getPages(int index); + /** + * + * + *
+   * The list of pages. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + int getPagesCount(); + /** + * + * + *
+   * The list of pages. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + java.util.List + getPagesOrBuilderList(); + /** + * + * + *
+   * The list of pages. There will be a maximum number of items returned based
+   * on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Page pages = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getPagesOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListSessionEntityTypesRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListSessionEntityTypesRequest.java new file mode 100644 index 000000000..66675c529 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListSessionEntityTypesRequest.java @@ -0,0 +1,949 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypes].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest} + */ +public final class ListSessionEntityTypesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest) + ListSessionEntityTypesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSessionEntityTypesRequest.newBuilder() to construct. + private ListSessionEntityTypesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSessionEntityTypesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSessionEntityTypesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListSessionEntityTypesRequest( + 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.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListSessionEntityTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListSessionEntityTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The session to list all session entity types from.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 session to list all session entity types from.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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_; + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + 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.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest) 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.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest 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.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest 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.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest 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.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + 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.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest 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.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypes].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest) + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListSessionEntityTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListSessionEntityTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest.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.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListSessionEntityTypesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest(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.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + .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.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The session to list all session entity types from.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 session to list all session entity types from.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 session to list all session entity types from.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 session to list all session entity types from.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The session to list all session entity types from.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_; + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSessionEntityTypesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSessionEntityTypesRequest(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.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListSessionEntityTypesRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListSessionEntityTypesRequestOrBuilder.java new file mode 100644 index 000000000..549b41054 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListSessionEntityTypesRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListSessionEntityTypesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The session to list all session entity types from.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The session to list all session entity types from.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListSessionEntityTypesResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListSessionEntityTypesResponse.java new file mode 100644 index 000000000..8ca058dab --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListSessionEntityTypesResponse.java @@ -0,0 +1,1240 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The response message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypes].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse} + */ +public final class ListSessionEntityTypesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse) + ListSessionEntityTypesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSessionEntityTypesResponse.newBuilder() to construct. + private ListSessionEntityTypesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSessionEntityTypesResponse() { + sessionEntityTypes_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSessionEntityTypesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListSessionEntityTypesResponse( + 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)) { + sessionEntityTypes_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType>(); + mutable_bitField0_ |= 0x00000001; + } + sessionEntityTypes_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.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)) { + sessionEntityTypes_ = java.util.Collections.unmodifiableList(sessionEntityTypes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListSessionEntityTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListSessionEntityTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse.Builder.class); + } + + public static final int SESSION_ENTITY_TYPES_FIELD_NUMBER = 1; + private java.util.List + sessionEntityTypes_; + /** + * + * + *
+   * The list of session entity types. There will be a maximum number of items
+   * returned based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + @java.lang.Override + public java.util.List + getSessionEntityTypesList() { + return sessionEntityTypes_; + } + /** + * + * + *
+   * The list of session entity types. There will be a maximum number of items
+   * returned based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + @java.lang.Override + public java.util.List + getSessionEntityTypesOrBuilderList() { + return sessionEntityTypes_; + } + /** + * + * + *
+   * The list of session entity types. There will be a maximum number of items
+   * returned based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + @java.lang.Override + public int getSessionEntityTypesCount() { + return sessionEntityTypes_.size(); + } + /** + * + * + *
+   * The list of session entity types. There will be a maximum number of items
+   * returned based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityTypes(int index) { + return sessionEntityTypes_.get(index); + } + /** + * + * + *
+   * The list of session entity types. There will be a maximum number of items
+   * returned based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder + getSessionEntityTypesOrBuilder(int index) { + return sessionEntityTypes_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + 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 < sessionEntityTypes_.size(); i++) { + output.writeMessage(1, sessionEntityTypes_.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 < sessionEntityTypes_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, sessionEntityTypes_.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.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse) obj; + + if (!getSessionEntityTypesList().equals(other.getSessionEntityTypesList())) 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 (getSessionEntityTypesCount() > 0) { + hash = (37 * hash) + SESSION_ENTITY_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getSessionEntityTypesList().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.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse 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.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse 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.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse 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.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + 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.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse 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.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse 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 response message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypes].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse) + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListSessionEntityTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListSessionEntityTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSessionEntityTypesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (sessionEntityTypesBuilder_ == null) { + sessionEntityTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + sessionEntityTypesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListSessionEntityTypesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse(this); + int from_bitField0_ = bitField0_; + if (sessionEntityTypesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sessionEntityTypes_ = java.util.Collections.unmodifiableList(sessionEntityTypes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sessionEntityTypes_ = sessionEntityTypes_; + } else { + result.sessionEntityTypes_ = sessionEntityTypesBuilder_.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.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + .getDefaultInstance()) return this; + if (sessionEntityTypesBuilder_ == null) { + if (!other.sessionEntityTypes_.isEmpty()) { + if (sessionEntityTypes_.isEmpty()) { + sessionEntityTypes_ = other.sessionEntityTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.addAll(other.sessionEntityTypes_); + } + onChanged(); + } + } else { + if (!other.sessionEntityTypes_.isEmpty()) { + if (sessionEntityTypesBuilder_.isEmpty()) { + sessionEntityTypesBuilder_.dispose(); + sessionEntityTypesBuilder_ = null; + sessionEntityTypes_ = other.sessionEntityTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + sessionEntityTypesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSessionEntityTypesFieldBuilder() + : null; + } else { + sessionEntityTypesBuilder_.addAllMessages(other.sessionEntityTypes_); + } + } + } + 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.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + sessionEntityTypes_ = java.util.Collections.emptyList(); + + private void ensureSessionEntityTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sessionEntityTypes_ = + new java.util.ArrayList( + sessionEntityTypes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder> + sessionEntityTypesBuilder_; + + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public java.util.List + getSessionEntityTypesList() { + if (sessionEntityTypesBuilder_ == null) { + return java.util.Collections.unmodifiableList(sessionEntityTypes_); + } else { + return sessionEntityTypesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public int getSessionEntityTypesCount() { + if (sessionEntityTypesBuilder_ == null) { + return sessionEntityTypes_.size(); + } else { + return sessionEntityTypesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityTypes( + int index) { + if (sessionEntityTypesBuilder_ == null) { + return sessionEntityTypes_.get(index); + } else { + return sessionEntityTypesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public Builder setSessionEntityTypes( + int index, com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType value) { + if (sessionEntityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.set(index, value); + onChanged(); + } else { + sessionEntityTypesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public Builder setSessionEntityTypes( + int index, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder builderForValue) { + if (sessionEntityTypesBuilder_ == null) { + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.set(index, builderForValue.build()); + onChanged(); + } else { + sessionEntityTypesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public Builder addSessionEntityTypes( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType value) { + if (sessionEntityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.add(value); + onChanged(); + } else { + sessionEntityTypesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public Builder addSessionEntityTypes( + int index, com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType value) { + if (sessionEntityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.add(index, value); + onChanged(); + } else { + sessionEntityTypesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public Builder addSessionEntityTypes( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder builderForValue) { + if (sessionEntityTypesBuilder_ == null) { + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.add(builderForValue.build()); + onChanged(); + } else { + sessionEntityTypesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public Builder addSessionEntityTypes( + int index, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder builderForValue) { + if (sessionEntityTypesBuilder_ == null) { + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.add(index, builderForValue.build()); + onChanged(); + } else { + sessionEntityTypesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public Builder addAllSessionEntityTypes( + java.lang.Iterable + values) { + if (sessionEntityTypesBuilder_ == null) { + ensureSessionEntityTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sessionEntityTypes_); + onChanged(); + } else { + sessionEntityTypesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public Builder clearSessionEntityTypes() { + if (sessionEntityTypesBuilder_ == null) { + sessionEntityTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sessionEntityTypesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public Builder removeSessionEntityTypes(int index) { + if (sessionEntityTypesBuilder_ == null) { + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.remove(index); + onChanged(); + } else { + sessionEntityTypesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder + getSessionEntityTypesBuilder(int index) { + return getSessionEntityTypesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder + getSessionEntityTypesOrBuilder(int index) { + if (sessionEntityTypesBuilder_ == null) { + return sessionEntityTypes_.get(index); + } else { + return sessionEntityTypesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder> + getSessionEntityTypesOrBuilderList() { + if (sessionEntityTypesBuilder_ != null) { + return sessionEntityTypesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sessionEntityTypes_); + } + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder + addSessionEntityTypesBuilder() { + return getSessionEntityTypesFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.getDefaultInstance()); + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder + addSessionEntityTypesBuilder(int index) { + return getSessionEntityTypesFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.getDefaultInstance()); + } + /** + * + * + *
+     * The list of session entity types. There will be a maximum number of items
+     * returned based on the page_size field in the request.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + public java.util.List + getSessionEntityTypesBuilderList() { + return getSessionEntityTypesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder> + getSessionEntityTypesFieldBuilder() { + if (sessionEntityTypesBuilder_ == null) { + sessionEntityTypesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder>( + sessionEntityTypes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + sessionEntityTypes_ = null; + } + return sessionEntityTypesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * 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.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSessionEntityTypesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSessionEntityTypesResponse(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.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListSessionEntityTypesResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListSessionEntityTypesResponseOrBuilder.java new file mode 100644 index 000000000..54b8663ed --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListSessionEntityTypesResponseOrBuilder.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/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListSessionEntityTypesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of session entity types. There will be a maximum number of items
+   * returned based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + java.util.List + getSessionEntityTypesList(); + /** + * + * + *
+   * The list of session entity types. There will be a maximum number of items
+   * returned based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityTypes(int index); + /** + * + * + *
+   * The list of session entity types. There will be a maximum number of items
+   * returned based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + int getSessionEntityTypesCount(); + /** + * + * + *
+   * The list of session entity types. There will be a maximum number of items
+   * returned based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + java.util.List + getSessionEntityTypesOrBuilderList(); + /** + * + * + *
+   * The list of session entity types. There will be a maximum number of items
+   * returned based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 1; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder getSessionEntityTypesOrBuilder( + int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListTransitionRouteGroupsRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListTransitionRouteGroupsRequest.java new file mode 100644 index 000000000..79083d719 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListTransitionRouteGroupsRequest.java @@ -0,0 +1,1182 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroups].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest} + */ +public final class ListTransitionRouteGroupsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest) + ListTransitionRouteGroupsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListTransitionRouteGroupsRequest.newBuilder() to construct. + private ListTransitionRouteGroupsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTransitionRouteGroupsRequest() { + parent_ = ""; + pageToken_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTransitionRouteGroupsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListTransitionRouteGroupsRequest( + 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(); + + languageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The flow to list all transition route groups for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 flow to list all transition route groups for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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_; + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + 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 LANGUAGE_CODE_FIELD_NUMBER = 4; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 4; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 4; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + 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 (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, languageCode_); + } + 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 (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + 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) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest 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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest 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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest 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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + 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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest 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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroups].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest) + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest.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_ = ""; + + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + .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.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The flow to list all transition route groups for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to list all transition route groups for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to list all transition route groups for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to list all transition route groups for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The flow to list all transition route groups for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_; + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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 languageCode_ = ""; + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 4; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 4; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 4; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 4; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 4; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTransitionRouteGroupsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTransitionRouteGroupsRequest(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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListTransitionRouteGroupsRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListTransitionRouteGroupsRequestOrBuilder.java new file mode 100644 index 000000000..3f6775fd6 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListTransitionRouteGroupsRequestOrBuilder.java @@ -0,0 +1,136 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListTransitionRouteGroupsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The flow to list all transition route groups for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The flow to list all transition route groups for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 4; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 4; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListTransitionRouteGroupsResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListTransitionRouteGroupsResponse.java new file mode 100644 index 000000000..bc31e0a46 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListTransitionRouteGroupsResponse.java @@ -0,0 +1,1300 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The response message for [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroups].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse} + */ +public final class ListTransitionRouteGroupsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse) + ListTransitionRouteGroupsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListTransitionRouteGroupsResponse.newBuilder() to construct. + private ListTransitionRouteGroupsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTransitionRouteGroupsResponse() { + transitionRouteGroups_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTransitionRouteGroupsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListTransitionRouteGroupsResponse( + 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)) { + transitionRouteGroups_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup>(); + mutable_bitField0_ |= 0x00000001; + } + transitionRouteGroups_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.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)) { + transitionRouteGroups_ = java.util.Collections.unmodifiableList(transitionRouteGroups_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse.Builder.class); + } + + public static final int TRANSITION_ROUTE_GROUPS_FIELD_NUMBER = 1; + private java.util.List + transitionRouteGroups_; + /** + * + * + *
+   * The list of transition route groups. There will be a maximum number of
+   * items returned based on the page_size field in the request. The list may in
+   * some cases be empty or contain fewer entries than page_size even if this
+   * isn't the last page.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + @java.lang.Override + public java.util.List + getTransitionRouteGroupsList() { + return transitionRouteGroups_; + } + /** + * + * + *
+   * The list of transition route groups. There will be a maximum number of
+   * items returned based on the page_size field in the request. The list may in
+   * some cases be empty or contain fewer entries than page_size even if this
+   * isn't the last page.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder> + getTransitionRouteGroupsOrBuilderList() { + return transitionRouteGroups_; + } + /** + * + * + *
+   * The list of transition route groups. There will be a maximum number of
+   * items returned based on the page_size field in the request. The list may in
+   * some cases be empty or contain fewer entries than page_size even if this
+   * isn't the last page.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + @java.lang.Override + public int getTransitionRouteGroupsCount() { + return transitionRouteGroups_.size(); + } + /** + * + * + *
+   * The list of transition route groups. There will be a maximum number of
+   * items returned based on the page_size field in the request. The list may in
+   * some cases be empty or contain fewer entries than page_size even if this
+   * isn't the last page.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup getTransitionRouteGroups( + int index) { + return transitionRouteGroups_.get(index); + } + /** + * + * + *
+   * The list of transition route groups. There will be a maximum number of
+   * items returned based on the page_size field in the request. The list may in
+   * some cases be empty or contain fewer entries than page_size even if this
+   * isn't the last page.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder + getTransitionRouteGroupsOrBuilder(int index) { + return transitionRouteGroups_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + 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 < transitionRouteGroups_.size(); i++) { + output.writeMessage(1, transitionRouteGroups_.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 < transitionRouteGroups_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, transitionRouteGroups_.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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse) obj; + + if (!getTransitionRouteGroupsList().equals(other.getTransitionRouteGroupsList())) 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 (getTransitionRouteGroupsCount() > 0) { + hash = (37 * hash) + TRANSITION_ROUTE_GROUPS_FIELD_NUMBER; + hash = (53 * hash) + getTransitionRouteGroupsList().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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse 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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse 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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse 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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + 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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse 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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse 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 response message for [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroups].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse) + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTransitionRouteGroupsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (transitionRouteGroupsBuilder_ == null) { + transitionRouteGroups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + transitionRouteGroupsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse(this); + int from_bitField0_ = bitField0_; + if (transitionRouteGroupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + transitionRouteGroups_ = java.util.Collections.unmodifiableList(transitionRouteGroups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.transitionRouteGroups_ = transitionRouteGroups_; + } else { + result.transitionRouteGroups_ = transitionRouteGroupsBuilder_.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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + .getDefaultInstance()) return this; + if (transitionRouteGroupsBuilder_ == null) { + if (!other.transitionRouteGroups_.isEmpty()) { + if (transitionRouteGroups_.isEmpty()) { + transitionRouteGroups_ = other.transitionRouteGroups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTransitionRouteGroupsIsMutable(); + transitionRouteGroups_.addAll(other.transitionRouteGroups_); + } + onChanged(); + } + } else { + if (!other.transitionRouteGroups_.isEmpty()) { + if (transitionRouteGroupsBuilder_.isEmpty()) { + transitionRouteGroupsBuilder_.dispose(); + transitionRouteGroupsBuilder_ = null; + transitionRouteGroups_ = other.transitionRouteGroups_; + bitField0_ = (bitField0_ & ~0x00000001); + transitionRouteGroupsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTransitionRouteGroupsFieldBuilder() + : null; + } else { + transitionRouteGroupsBuilder_.addAllMessages(other.transitionRouteGroups_); + } + } + } + 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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + transitionRouteGroups_ = java.util.Collections.emptyList(); + + private void ensureTransitionRouteGroupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + transitionRouteGroups_ = + new java.util.ArrayList( + transitionRouteGroups_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder> + transitionRouteGroupsBuilder_; + + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public java.util.List + getTransitionRouteGroupsList() { + if (transitionRouteGroupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(transitionRouteGroups_); + } else { + return transitionRouteGroupsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public int getTransitionRouteGroupsCount() { + if (transitionRouteGroupsBuilder_ == null) { + return transitionRouteGroups_.size(); + } else { + return transitionRouteGroupsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup getTransitionRouteGroups( + int index) { + if (transitionRouteGroupsBuilder_ == null) { + return transitionRouteGroups_.get(index); + } else { + return transitionRouteGroupsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public Builder setTransitionRouteGroups( + int index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup value) { + if (transitionRouteGroupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionRouteGroupsIsMutable(); + transitionRouteGroups_.set(index, value); + onChanged(); + } else { + transitionRouteGroupsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public Builder setTransitionRouteGroups( + int index, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder builderForValue) { + if (transitionRouteGroupsBuilder_ == null) { + ensureTransitionRouteGroupsIsMutable(); + transitionRouteGroups_.set(index, builderForValue.build()); + onChanged(); + } else { + transitionRouteGroupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public Builder addTransitionRouteGroups( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup value) { + if (transitionRouteGroupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionRouteGroupsIsMutable(); + transitionRouteGroups_.add(value); + onChanged(); + } else { + transitionRouteGroupsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public Builder addTransitionRouteGroups( + int index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup value) { + if (transitionRouteGroupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionRouteGroupsIsMutable(); + transitionRouteGroups_.add(index, value); + onChanged(); + } else { + transitionRouteGroupsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public Builder addTransitionRouteGroups( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder builderForValue) { + if (transitionRouteGroupsBuilder_ == null) { + ensureTransitionRouteGroupsIsMutable(); + transitionRouteGroups_.add(builderForValue.build()); + onChanged(); + } else { + transitionRouteGroupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public Builder addTransitionRouteGroups( + int index, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder builderForValue) { + if (transitionRouteGroupsBuilder_ == null) { + ensureTransitionRouteGroupsIsMutable(); + transitionRouteGroups_.add(index, builderForValue.build()); + onChanged(); + } else { + transitionRouteGroupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public Builder addAllTransitionRouteGroups( + java.lang.Iterable + values) { + if (transitionRouteGroupsBuilder_ == null) { + ensureTransitionRouteGroupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, transitionRouteGroups_); + onChanged(); + } else { + transitionRouteGroupsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public Builder clearTransitionRouteGroups() { + if (transitionRouteGroupsBuilder_ == null) { + transitionRouteGroups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + transitionRouteGroupsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public Builder removeTransitionRouteGroups(int index) { + if (transitionRouteGroupsBuilder_ == null) { + ensureTransitionRouteGroupsIsMutable(); + transitionRouteGroups_.remove(index); + onChanged(); + } else { + transitionRouteGroupsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder + getTransitionRouteGroupsBuilder(int index) { + return getTransitionRouteGroupsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder + getTransitionRouteGroupsOrBuilder(int index) { + if (transitionRouteGroupsBuilder_ == null) { + return transitionRouteGroups_.get(index); + } else { + return transitionRouteGroupsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder> + getTransitionRouteGroupsOrBuilderList() { + if (transitionRouteGroupsBuilder_ != null) { + return transitionRouteGroupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(transitionRouteGroups_); + } + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder + addTransitionRouteGroupsBuilder() { + return getTransitionRouteGroupsFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.getDefaultInstance()); + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder + addTransitionRouteGroupsBuilder(int index) { + return getTransitionRouteGroupsFieldBuilder() + .addBuilder( + index, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.getDefaultInstance()); + } + /** + * + * + *
+     * The list of transition route groups. There will be a maximum number of
+     * items returned based on the page_size field in the request. The list may in
+     * some cases be empty or contain fewer entries than page_size even if this
+     * isn't the last page.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + public java.util.List + getTransitionRouteGroupsBuilderList() { + return getTransitionRouteGroupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder> + getTransitionRouteGroupsFieldBuilder() { + if (transitionRouteGroupsBuilder_ == null) { + transitionRouteGroupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder>( + transitionRouteGroups_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + transitionRouteGroups_ = null; + } + return transitionRouteGroupsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTransitionRouteGroupsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTransitionRouteGroupsResponse(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.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListTransitionRouteGroupsResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListTransitionRouteGroupsResponseOrBuilder.java new file mode 100644 index 000000000..757c64ce0 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListTransitionRouteGroupsResponseOrBuilder.java @@ -0,0 +1,131 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListTransitionRouteGroupsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of transition route groups. There will be a maximum number of
+   * items returned based on the page_size field in the request. The list may in
+   * some cases be empty or contain fewer entries than page_size even if this
+   * isn't the last page.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + java.util.List + getTransitionRouteGroupsList(); + /** + * + * + *
+   * The list of transition route groups. There will be a maximum number of
+   * items returned based on the page_size field in the request. The list may in
+   * some cases be empty or contain fewer entries than page_size even if this
+   * isn't the last page.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup getTransitionRouteGroups(int index); + /** + * + * + *
+   * The list of transition route groups. There will be a maximum number of
+   * items returned based on the page_size field in the request. The list may in
+   * some cases be empty or contain fewer entries than page_size even if this
+   * isn't the last page.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + int getTransitionRouteGroupsCount(); + /** + * + * + *
+   * The list of transition route groups. There will be a maximum number of
+   * items returned based on the page_size field in the request. The list may in
+   * some cases be empty or contain fewer entries than page_size even if this
+   * isn't the last page.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + java.util.List + getTransitionRouteGroupsOrBuilderList(); + /** + * + * + *
+   * The list of transition route groups. There will be a maximum number of
+   * items returned based on the page_size field in the request. The list may in
+   * some cases be empty or contain fewer entries than page_size even if this
+   * isn't the last page.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_groups = 1; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder + getTransitionRouteGroupsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListVersionsRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListVersionsRequest.java new file mode 100644 index 000000000..7261b0a8a --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListVersionsRequest.java @@ -0,0 +1,938 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest} + */ +public final class ListVersionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest) + ListVersionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListVersionsRequest.newBuilder() to construct. + private ListVersionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListVersionsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListVersionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListVersionsRequest( + 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.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all versions for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all versions for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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_; + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 20 and
+   * at most 100.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + 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.dialogflow.cx.v3beta1.ListVersionsRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest) 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.dialogflow.cx.v3beta1.ListVersionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest 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.dialogflow.cx.v3beta1.ListVersionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest 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.dialogflow.cx.v3beta1.ListVersionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest 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.dialogflow.cx.v3beta1.ListVersionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest 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.dialogflow.cx.v3beta1.ListVersionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest 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.dialogflow.cx.v3beta1.ListVersionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest) + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest.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.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest(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.dialogflow.cx.v3beta1.ListVersionsRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest.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.dialogflow.cx.v3beta1.ListVersionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all versions for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all versions for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all versions for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all versions for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all versions for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_; + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 20 and
+     * at most 100.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 20 and
+     * at most 100.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 20 and
+     * at most 100.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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.dialogflow.cx.v3beta1.ListVersionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListVersionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListVersionsRequest(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.dialogflow.cx.v3beta1.ListVersionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListVersionsRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListVersionsRequestOrBuilder.java new file mode 100644 index 000000000..15cb6c2d6 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListVersionsRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListVersionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all versions for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all versions for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 20 and
+   * at most 100.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListVersionsResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListVersionsResponse.java new file mode 100644 index 000000000..786f5eead --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListVersionsResponse.java @@ -0,0 +1,1185 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The response message for [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse} + */ +public final class ListVersionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse) + ListVersionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListVersionsResponse.newBuilder() to construct. + private ListVersionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListVersionsResponse() { + versions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListVersionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListVersionsResponse( + 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)) { + versions_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + versions_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Version.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)) { + versions_ = java.util.Collections.unmodifiableList(versions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse.Builder.class); + } + + public static final int VERSIONS_FIELD_NUMBER = 1; + private java.util.List versions_; + /** + * + * + *
+   * A list of versions. There will be a maximum number of items returned based
+   * on the page_size field in the request. The list may in some cases be empty
+   * or contain fewer entries than page_size even if this isn't the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + @java.lang.Override + public java.util.List getVersionsList() { + return versions_; + } + /** + * + * + *
+   * A list of versions. There will be a maximum number of items returned based
+   * on the page_size field in the request. The list may in some cases be empty
+   * or contain fewer entries than page_size even if this isn't the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + @java.lang.Override + public java.util.List + getVersionsOrBuilderList() { + return versions_; + } + /** + * + * + *
+   * A list of versions. There will be a maximum number of items returned based
+   * on the page_size field in the request. The list may in some cases be empty
+   * or contain fewer entries than page_size even if this isn't the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + @java.lang.Override + public int getVersionsCount() { + return versions_.size(); + } + /** + * + * + *
+   * A list of versions. There will be a maximum number of items returned based
+   * on the page_size field in the request. The list may in some cases be empty
+   * or contain fewer entries than page_size even if this isn't the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Version getVersions(int index) { + return versions_.get(index); + } + /** + * + * + *
+   * A list of versions. There will be a maximum number of items returned based
+   * on the page_size field in the request. The list may in some cases be empty
+   * or contain fewer entries than page_size even if this isn't the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder getVersionsOrBuilder(int index) { + return versions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + 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 < versions_.size(); i++) { + output.writeMessage(1, versions_.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 < versions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, versions_.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.dialogflow.cx.v3beta1.ListVersionsResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse) obj; + + if (!getVersionsList().equals(other.getVersionsList())) 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 (getVersionsCount() > 0) { + hash = (37 * hash) + VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getVersionsList().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.dialogflow.cx.v3beta1.ListVersionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse 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.dialogflow.cx.v3beta1.ListVersionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse 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.dialogflow.cx.v3beta1.ListVersionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse 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.dialogflow.cx.v3beta1.ListVersionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse 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.dialogflow.cx.v3beta1.ListVersionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse 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.dialogflow.cx.v3beta1.ListVersionsResponse 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 response message for [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse) + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getVersionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (versionsBuilder_ == null) { + versions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + versionsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse(this); + int from_bitField0_ = bitField0_; + if (versionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + versions_ = java.util.Collections.unmodifiableList(versions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.versions_ = versions_; + } else { + result.versions_ = versionsBuilder_.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.dialogflow.cx.v3beta1.ListVersionsResponse) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse.getDefaultInstance()) + return this; + if (versionsBuilder_ == null) { + if (!other.versions_.isEmpty()) { + if (versions_.isEmpty()) { + versions_ = other.versions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVersionsIsMutable(); + versions_.addAll(other.versions_); + } + onChanged(); + } + } else { + if (!other.versions_.isEmpty()) { + if (versionsBuilder_.isEmpty()) { + versionsBuilder_.dispose(); + versionsBuilder_ = null; + versions_ = other.versions_; + bitField0_ = (bitField0_ & ~0x00000001); + versionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVersionsFieldBuilder() + : null; + } else { + versionsBuilder_.addAllMessages(other.versions_); + } + } + } + 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.dialogflow.cx.v3beta1.ListVersionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List versions_ = + java.util.Collections.emptyList(); + + private void ensureVersionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + versions_ = + new java.util.ArrayList(versions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Version, + com.google.cloud.dialogflow.cx.v3beta1.Version.Builder, + com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder> + versionsBuilder_; + + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public java.util.List getVersionsList() { + if (versionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(versions_); + } else { + return versionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public int getVersionsCount() { + if (versionsBuilder_ == null) { + return versions_.size(); + } else { + return versionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Version getVersions(int index) { + if (versionsBuilder_ == null) { + return versions_.get(index); + } else { + return versionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public Builder setVersions(int index, com.google.cloud.dialogflow.cx.v3beta1.Version value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.set(index, value); + onChanged(); + } else { + versionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public Builder setVersions( + int index, com.google.cloud.dialogflow.cx.v3beta1.Version.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.set(index, builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public Builder addVersions(com.google.cloud.dialogflow.cx.v3beta1.Version value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.add(value); + onChanged(); + } else { + versionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public Builder addVersions(int index, com.google.cloud.dialogflow.cx.v3beta1.Version value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.add(index, value); + onChanged(); + } else { + versionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public Builder addVersions( + com.google.cloud.dialogflow.cx.v3beta1.Version.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.add(builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public Builder addVersions( + int index, com.google.cloud.dialogflow.cx.v3beta1.Version.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.add(index, builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public Builder addAllVersions( + java.lang.Iterable values) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, versions_); + onChanged(); + } else { + versionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public Builder clearVersions() { + if (versionsBuilder_ == null) { + versions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + versionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public Builder removeVersions(int index) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.remove(index); + onChanged(); + } else { + versionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Version.Builder getVersionsBuilder(int index) { + return getVersionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder getVersionsOrBuilder(int index) { + if (versionsBuilder_ == null) { + return versions_.get(index); + } else { + return versionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public java.util.List + getVersionsOrBuilderList() { + if (versionsBuilder_ != null) { + return versionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(versions_); + } + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Version.Builder addVersionsBuilder() { + return getVersionsFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.Version.getDefaultInstance()); + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Version.Builder addVersionsBuilder(int index) { + return getVersionsFieldBuilder() + .addBuilder(index, com.google.cloud.dialogflow.cx.v3beta1.Version.getDefaultInstance()); + } + /** + * + * + *
+     * A list of versions. There will be a maximum number of items returned based
+     * on the page_size field in the request. The list may in some cases be empty
+     * or contain fewer entries than page_size even if this isn't the last page.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + public java.util.List + getVersionsBuilderList() { + return getVersionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Version, + com.google.cloud.dialogflow.cx.v3beta1.Version.Builder, + com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder> + getVersionsFieldBuilder() { + if (versionsBuilder_ == null) { + versionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Version, + com.google.cloud.dialogflow.cx.v3beta1.Version.Builder, + com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder>( + versions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + versions_ = null; + } + return versionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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.dialogflow.cx.v3beta1.ListVersionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListVersionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListVersionsResponse(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.dialogflow.cx.v3beta1.ListVersionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListVersionsResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListVersionsResponseOrBuilder.java new file mode 100644 index 000000000..be5ea7a86 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListVersionsResponseOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListVersionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of versions. There will be a maximum number of items returned based
+   * on the page_size field in the request. The list may in some cases be empty
+   * or contain fewer entries than page_size even if this isn't the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + java.util.List getVersionsList(); + /** + * + * + *
+   * A list of versions. There will be a maximum number of items returned based
+   * on the page_size field in the request. The list may in some cases be empty
+   * or contain fewer entries than page_size even if this isn't the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.Version getVersions(int index); + /** + * + * + *
+   * A list of versions. There will be a maximum number of items returned based
+   * on the page_size field in the request. The list may in some cases be empty
+   * or contain fewer entries than page_size even if this isn't the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + int getVersionsCount(); + /** + * + * + *
+   * A list of versions. There will be a maximum number of items returned based
+   * on the page_size field in the request. The list may in some cases be empty
+   * or contain fewer entries than page_size even if this isn't the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + java.util.List + getVersionsOrBuilderList(); + /** + * + * + *
+   * A list of versions. There will be a maximum number of items returned based
+   * on the page_size field in the request. The list may in some cases be empty
+   * or contain fewer entries than page_size even if this isn't the last page.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Version versions = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder getVersionsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListWebhooksRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListWebhooksRequest.java new file mode 100644 index 000000000..1433052f8 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListWebhooksRequest.java @@ -0,0 +1,931 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest} + */ +public final class ListWebhooksRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest) + ListWebhooksRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWebhooksRequest.newBuilder() to construct. + private ListWebhooksRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWebhooksRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListWebhooksRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListWebhooksRequest( + 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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The agent to list all webhooks for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 agent to list all webhooks for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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_; + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + 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.dialogflow.cx.v3beta1.ListWebhooksRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest) 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.dialogflow.cx.v3beta1.ListWebhooksRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest 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.dialogflow.cx.v3beta1.ListWebhooksRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest 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.dialogflow.cx.v3beta1.ListWebhooksRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest 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.dialogflow.cx.v3beta1.ListWebhooksRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest 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.dialogflow.cx.v3beta1.ListWebhooksRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest 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.dialogflow.cx.v3beta1.ListWebhooksRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest) + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest.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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest(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.dialogflow.cx.v3beta1.ListWebhooksRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest.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.dialogflow.cx.v3beta1.ListWebhooksRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The agent to list all webhooks for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to list all webhooks for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to list all webhooks for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 agent to list all webhooks for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The agent to list all webhooks for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_; + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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.dialogflow.cx.v3beta1.ListWebhooksRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWebhooksRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListWebhooksRequest(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.dialogflow.cx.v3beta1.ListWebhooksRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListWebhooksRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListWebhooksRequestOrBuilder.java new file mode 100644 index 000000000..ac984082f --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListWebhooksRequestOrBuilder.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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListWebhooksRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The agent to list all webhooks for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The agent to list all webhooks for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListWebhooksResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListWebhooksResponse.java new file mode 100644 index 000000000..cc964672d --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListWebhooksResponse.java @@ -0,0 +1,1162 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The response message for [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse} + */ +public final class ListWebhooksResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse) + ListWebhooksResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWebhooksResponse.newBuilder() to construct. + private ListWebhooksResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWebhooksResponse() { + webhooks_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListWebhooksResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListWebhooksResponse( + 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)) { + webhooks_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + webhooks_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.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)) { + webhooks_ = java.util.Collections.unmodifiableList(webhooks_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse.Builder.class); + } + + public static final int WEBHOOKS_FIELD_NUMBER = 1; + private java.util.List webhooks_; + /** + * + * + *
+   * The list of webhooks. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + @java.lang.Override + public java.util.List getWebhooksList() { + return webhooks_; + } + /** + * + * + *
+   * The list of webhooks. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + @java.lang.Override + public java.util.List + getWebhooksOrBuilderList() { + return webhooks_; + } + /** + * + * + *
+   * The list of webhooks. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + @java.lang.Override + public int getWebhooksCount() { + return webhooks_.size(); + } + /** + * + * + *
+   * The list of webhooks. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Webhook getWebhooks(int index) { + return webhooks_.get(index); + } + /** + * + * + *
+   * The list of webhooks. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder getWebhooksOrBuilder(int index) { + return webhooks_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + 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 < webhooks_.size(); i++) { + output.writeMessage(1, webhooks_.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 < webhooks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, webhooks_.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.dialogflow.cx.v3beta1.ListWebhooksResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse) obj; + + if (!getWebhooksList().equals(other.getWebhooksList())) 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 (getWebhooksCount() > 0) { + hash = (37 * hash) + WEBHOOKS_FIELD_NUMBER; + hash = (53 * hash) + getWebhooksList().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.dialogflow.cx.v3beta1.ListWebhooksResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse 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.dialogflow.cx.v3beta1.ListWebhooksResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse 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.dialogflow.cx.v3beta1.ListWebhooksResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse 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.dialogflow.cx.v3beta1.ListWebhooksResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse 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.dialogflow.cx.v3beta1.ListWebhooksResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse 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.dialogflow.cx.v3beta1.ListWebhooksResponse 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 response message for [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse) + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getWebhooksFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (webhooksBuilder_ == null) { + webhooks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + webhooksBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse(this); + int from_bitField0_ = bitField0_; + if (webhooksBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + webhooks_ = java.util.Collections.unmodifiableList(webhooks_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.webhooks_ = webhooks_; + } else { + result.webhooks_ = webhooksBuilder_.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.dialogflow.cx.v3beta1.ListWebhooksResponse) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse.getDefaultInstance()) + return this; + if (webhooksBuilder_ == null) { + if (!other.webhooks_.isEmpty()) { + if (webhooks_.isEmpty()) { + webhooks_ = other.webhooks_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWebhooksIsMutable(); + webhooks_.addAll(other.webhooks_); + } + onChanged(); + } + } else { + if (!other.webhooks_.isEmpty()) { + if (webhooksBuilder_.isEmpty()) { + webhooksBuilder_.dispose(); + webhooksBuilder_ = null; + webhooks_ = other.webhooks_; + bitField0_ = (bitField0_ & ~0x00000001); + webhooksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWebhooksFieldBuilder() + : null; + } else { + webhooksBuilder_.addAllMessages(other.webhooks_); + } + } + } + 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.dialogflow.cx.v3beta1.ListWebhooksResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List webhooks_ = + java.util.Collections.emptyList(); + + private void ensureWebhooksIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + webhooks_ = + new java.util.ArrayList(webhooks_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Webhook, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder> + webhooksBuilder_; + + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public java.util.List getWebhooksList() { + if (webhooksBuilder_ == null) { + return java.util.Collections.unmodifiableList(webhooks_); + } else { + return webhooksBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public int getWebhooksCount() { + if (webhooksBuilder_ == null) { + return webhooks_.size(); + } else { + return webhooksBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Webhook getWebhooks(int index) { + if (webhooksBuilder_ == null) { + return webhooks_.get(index); + } else { + return webhooksBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public Builder setWebhooks(int index, com.google.cloud.dialogflow.cx.v3beta1.Webhook value) { + if (webhooksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWebhooksIsMutable(); + webhooks_.set(index, value); + onChanged(); + } else { + webhooksBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public Builder setWebhooks( + int index, com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder builderForValue) { + if (webhooksBuilder_ == null) { + ensureWebhooksIsMutable(); + webhooks_.set(index, builderForValue.build()); + onChanged(); + } else { + webhooksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public Builder addWebhooks(com.google.cloud.dialogflow.cx.v3beta1.Webhook value) { + if (webhooksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWebhooksIsMutable(); + webhooks_.add(value); + onChanged(); + } else { + webhooksBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public Builder addWebhooks(int index, com.google.cloud.dialogflow.cx.v3beta1.Webhook value) { + if (webhooksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWebhooksIsMutable(); + webhooks_.add(index, value); + onChanged(); + } else { + webhooksBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public Builder addWebhooks( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder builderForValue) { + if (webhooksBuilder_ == null) { + ensureWebhooksIsMutable(); + webhooks_.add(builderForValue.build()); + onChanged(); + } else { + webhooksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public Builder addWebhooks( + int index, com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder builderForValue) { + if (webhooksBuilder_ == null) { + ensureWebhooksIsMutable(); + webhooks_.add(index, builderForValue.build()); + onChanged(); + } else { + webhooksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public Builder addAllWebhooks( + java.lang.Iterable values) { + if (webhooksBuilder_ == null) { + ensureWebhooksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, webhooks_); + onChanged(); + } else { + webhooksBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public Builder clearWebhooks() { + if (webhooksBuilder_ == null) { + webhooks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + webhooksBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public Builder removeWebhooks(int index) { + if (webhooksBuilder_ == null) { + ensureWebhooksIsMutable(); + webhooks_.remove(index); + onChanged(); + } else { + webhooksBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder getWebhooksBuilder(int index) { + return getWebhooksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder getWebhooksOrBuilder(int index) { + if (webhooksBuilder_ == null) { + return webhooks_.get(index); + } else { + return webhooksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public java.util.List + getWebhooksOrBuilderList() { + if (webhooksBuilder_ != null) { + return webhooksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(webhooks_); + } + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder addWebhooksBuilder() { + return getWebhooksFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.Webhook.getDefaultInstance()); + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder addWebhooksBuilder(int index) { + return getWebhooksFieldBuilder() + .addBuilder(index, com.google.cloud.dialogflow.cx.v3beta1.Webhook.getDefaultInstance()); + } + /** + * + * + *
+     * The list of webhooks. There will be a maximum number of items returned
+     * based on the page_size field in the request.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + public java.util.List + getWebhooksBuilderList() { + return getWebhooksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Webhook, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder> + getWebhooksFieldBuilder() { + if (webhooksBuilder_ == null) { + webhooksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Webhook, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder>( + webhooks_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + webhooks_ = null; + } + return webhooksBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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.dialogflow.cx.v3beta1.ListWebhooksResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWebhooksResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListWebhooksResponse(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.dialogflow.cx.v3beta1.ListWebhooksResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListWebhooksResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListWebhooksResponseOrBuilder.java new file mode 100644 index 000000000..16835aeb8 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ListWebhooksResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ListWebhooksResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of webhooks. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + java.util.List getWebhooksList(); + /** + * + * + *
+   * The list of webhooks. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.Webhook getWebhooks(int index); + /** + * + * + *
+   * The list of webhooks. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + int getWebhooksCount(); + /** + * + * + *
+   * The list of webhooks. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + java.util.List + getWebhooksOrBuilderList(); + /** + * + * + *
+   * The list of webhooks. There will be a maximum number of items returned
+   * based on the page_size field in the request.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Webhook webhooks = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder getWebhooksOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LoadVersionRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LoadVersionRequest.java new file mode 100644 index 000000000..b8172e49a --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LoadVersionRequest.java @@ -0,0 +1,768 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Versions.LoadVersion][google.cloud.dialogflow.cx.v3beta1.Versions.LoadVersion].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest} + */ +public final class LoadVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest) + LoadVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use LoadVersionRequest.newBuilder() to construct. + private LoadVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LoadVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LoadVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LoadVersionRequest( + 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 16: + { + allowOverrideAgentResources_ = 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.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LoadVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LoadVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to draft version.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to draft version.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOW_OVERRIDE_AGENT_RESOURCES_FIELD_NUMBER = 2; + private boolean allowOverrideAgentResources_; + /** + * + * + *
+   * This field is used to prevent accidental overwrite of other agent resources
+   * in the draft version, which can potentially impact other flow's behavior.
+   * If `allow_override_agent_resources` is false, conflicted agent-level
+   * resources will not be overridden (i.e. intents, entities, webhooks).
+   * 
+ * + * bool allow_override_agent_resources = 2; + * + * @return The allowOverrideAgentResources. + */ + @java.lang.Override + public boolean getAllowOverrideAgentResources() { + return allowOverrideAgentResources_; + } + + 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 (allowOverrideAgentResources_ != false) { + output.writeBool(2, allowOverrideAgentResources_); + } + 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 (allowOverrideAgentResources_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowOverrideAgentResources_); + } + 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.dialogflow.cx.v3beta1.LoadVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getAllowOverrideAgentResources() != other.getAllowOverrideAgentResources()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ALLOW_OVERRIDE_AGENT_RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowOverrideAgentResources()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest 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.dialogflow.cx.v3beta1.LoadVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest 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.dialogflow.cx.v3beta1.LoadVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest 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.dialogflow.cx.v3beta1.LoadVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest 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.dialogflow.cx.v3beta1.LoadVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest 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.dialogflow.cx.v3beta1.LoadVersionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Versions.LoadVersion][google.cloud.dialogflow.cx.v3beta1.Versions.LoadVersion].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest) + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LoadVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LoadVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest.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_ = ""; + + allowOverrideAgentResources_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LoadVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest(this); + result.name_ = name_; + result.allowOverrideAgentResources_ = allowOverrideAgentResources_; + 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.dialogflow.cx.v3beta1.LoadVersionRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getAllowOverrideAgentResources() != false) { + setAllowOverrideAgentResources(other.getAllowOverrideAgentResources()); + } + 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.dialogflow.cx.v3beta1.LoadVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to draft version.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to draft version.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to draft version.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to draft version.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to draft version.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 boolean allowOverrideAgentResources_; + /** + * + * + *
+     * This field is used to prevent accidental overwrite of other agent resources
+     * in the draft version, which can potentially impact other flow's behavior.
+     * If `allow_override_agent_resources` is false, conflicted agent-level
+     * resources will not be overridden (i.e. intents, entities, webhooks).
+     * 
+ * + * bool allow_override_agent_resources = 2; + * + * @return The allowOverrideAgentResources. + */ + @java.lang.Override + public boolean getAllowOverrideAgentResources() { + return allowOverrideAgentResources_; + } + /** + * + * + *
+     * This field is used to prevent accidental overwrite of other agent resources
+     * in the draft version, which can potentially impact other flow's behavior.
+     * If `allow_override_agent_resources` is false, conflicted agent-level
+     * resources will not be overridden (i.e. intents, entities, webhooks).
+     * 
+ * + * bool allow_override_agent_resources = 2; + * + * @param value The allowOverrideAgentResources to set. + * @return This builder for chaining. + */ + public Builder setAllowOverrideAgentResources(boolean value) { + + allowOverrideAgentResources_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This field is used to prevent accidental overwrite of other agent resources
+     * in the draft version, which can potentially impact other flow's behavior.
+     * If `allow_override_agent_resources` is false, conflicted agent-level
+     * resources will not be overridden (i.e. intents, entities, webhooks).
+     * 
+ * + * bool allow_override_agent_resources = 2; + * + * @return This builder for chaining. + */ + public Builder clearAllowOverrideAgentResources() { + + allowOverrideAgentResources_ = 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.dialogflow.cx.v3beta1.LoadVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LoadVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LoadVersionRequest(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.dialogflow.cx.v3beta1.LoadVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LoadVersionRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LoadVersionRequestOrBuilder.java new file mode 100644 index 000000000..de3483f42 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LoadVersionRequestOrBuilder.java @@ -0,0 +1,74 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface LoadVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to draft version.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to draft version.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * This field is used to prevent accidental overwrite of other agent resources
+   * in the draft version, which can potentially impact other flow's behavior.
+   * If `allow_override_agent_resources` is false, conflicted agent-level
+   * resources will not be overridden (i.e. intents, entities, webhooks).
+   * 
+ * + * bool allow_override_agent_resources = 2; + * + * @return The allowOverrideAgentResources. + */ + boolean getAllowOverrideAgentResources(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LocationName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LocationName.java new file mode 100644 index 000000000..7f792bb28 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LocationName.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 LocationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + 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 (LocationName 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); + 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); + } + + /** Builder for LocationName. */ + public static class Builder { + + private String project; + private String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder() {} + + private Builder(LocationName locationName) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LocationName) { + LocationName that = (LocationName) o; + return (this.project.equals(that.project)) && (this.location.equals(that.location)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LookupEnvironmentHistoryRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LookupEnvironmentHistoryRequest.java new file mode 100644 index 000000000..5f81395b5 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LookupEnvironmentHistoryRequest.java @@ -0,0 +1,951 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistory].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest} + */ +public final class LookupEnvironmentHistoryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest) + LookupEnvironmentHistoryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use LookupEnvironmentHistoryRequest.newBuilder() to construct. + private LookupEnvironmentHistoryRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LookupEnvironmentHistoryRequest() { + name_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LookupEnvironmentHistoryRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LookupEnvironmentHistoryRequest( + 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 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.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Resource name of the environment to look up the history for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Resource name of the environment to look up the history for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + 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 (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistory].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest) + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest.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_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest(this); + result.name_ = name_; + 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name of the environment to look up the history for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. Resource name of the environment to look up the history for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. Resource name of the environment to look up the history for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. Resource name of the environment to look up the history for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the environment to look up the history for.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/environments/<Environment ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 int pageSize_; + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return in a single page. By default 100 and
+     * at most 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request.
+     * 
+ * + * string page_token = 3; + * + * @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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LookupEnvironmentHistoryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LookupEnvironmentHistoryRequest(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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LookupEnvironmentHistoryRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LookupEnvironmentHistoryRequestOrBuilder.java new file mode 100644 index 000000000..5db927745 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LookupEnvironmentHistoryRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface LookupEnvironmentHistoryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name of the environment to look up the history for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name of the environment to look up the history for.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/environments/<Environment ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The maximum number of items to return in a single page. By default 100 and
+   * at most 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LookupEnvironmentHistoryResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LookupEnvironmentHistoryResponse.java new file mode 100644 index 000000000..6e7d2f58a --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LookupEnvironmentHistoryResponse.java @@ -0,0 +1,1188 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The response message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistory].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse} + */ +public final class LookupEnvironmentHistoryResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse) + LookupEnvironmentHistoryResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use LookupEnvironmentHistoryResponse.newBuilder() to construct. + private LookupEnvironmentHistoryResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LookupEnvironmentHistoryResponse() { + environments_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LookupEnvironmentHistoryResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LookupEnvironmentHistoryResponse( + 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)) { + environments_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + environments_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Environment.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)) { + environments_ = java.util.Collections.unmodifiableList(environments_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse.Builder.class); + } + + public static final int ENVIRONMENTS_FIELD_NUMBER = 1; + private java.util.List environments_; + /** + * + * + *
+   * Represents a list of snapshots for an environment. Time of the snapshots is
+   * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + @java.lang.Override + public java.util.List getEnvironmentsList() { + return environments_; + } + /** + * + * + *
+   * Represents a list of snapshots for an environment. Time of the snapshots is
+   * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + @java.lang.Override + public java.util.List + getEnvironmentsOrBuilderList() { + return environments_; + } + /** + * + * + *
+   * Represents a list of snapshots for an environment. Time of the snapshots is
+   * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + @java.lang.Override + public int getEnvironmentsCount() { + return environments_.size(); + } + /** + * + * + *
+   * Represents a list of snapshots for an environment. Time of the snapshots is
+   * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironments(int index) { + return environments_.get(index); + } + /** + * + * + *
+   * Represents a list of snapshots for an environment. Time of the snapshots is
+   * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder getEnvironmentsOrBuilder( + int index) { + return environments_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + 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 < environments_.size(); i++) { + output.writeMessage(1, environments_.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 < environments_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, environments_.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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse) obj; + + if (!getEnvironmentsList().equals(other.getEnvironmentsList())) 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 (getEnvironmentsCount() > 0) { + hash = (37 * hash) + ENVIRONMENTS_FIELD_NUMBER; + hash = (53 * hash) + getEnvironmentsList().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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse 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 response message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistory].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse) + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEnvironmentsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (environmentsBuilder_ == null) { + environments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + environmentsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_LookupEnvironmentHistoryResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse(this); + int from_bitField0_ = bitField0_; + if (environmentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + environments_ = java.util.Collections.unmodifiableList(environments_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.environments_ = environments_; + } else { + result.environments_ = environmentsBuilder_.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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + .getDefaultInstance()) return this; + if (environmentsBuilder_ == null) { + if (!other.environments_.isEmpty()) { + if (environments_.isEmpty()) { + environments_ = other.environments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEnvironmentsIsMutable(); + environments_.addAll(other.environments_); + } + onChanged(); + } + } else { + if (!other.environments_.isEmpty()) { + if (environmentsBuilder_.isEmpty()) { + environmentsBuilder_.dispose(); + environmentsBuilder_ = null; + environments_ = other.environments_; + bitField0_ = (bitField0_ & ~0x00000001); + environmentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEnvironmentsFieldBuilder() + : null; + } else { + environmentsBuilder_.addAllMessages(other.environments_); + } + } + } + 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List environments_ = + java.util.Collections.emptyList(); + + private void ensureEnvironmentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + environments_ = + new java.util.ArrayList( + environments_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment, + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder> + environmentsBuilder_; + + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public java.util.List + getEnvironmentsList() { + if (environmentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(environments_); + } else { + return environmentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public int getEnvironmentsCount() { + if (environmentsBuilder_ == null) { + return environments_.size(); + } else { + return environmentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironments(int index) { + if (environmentsBuilder_ == null) { + return environments_.get(index); + } else { + return environmentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder setEnvironments( + int index, com.google.cloud.dialogflow.cx.v3beta1.Environment value) { + if (environmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvironmentsIsMutable(); + environments_.set(index, value); + onChanged(); + } else { + environmentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder setEnvironments( + int index, com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder builderForValue) { + if (environmentsBuilder_ == null) { + ensureEnvironmentsIsMutable(); + environments_.set(index, builderForValue.build()); + onChanged(); + } else { + environmentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder addEnvironments(com.google.cloud.dialogflow.cx.v3beta1.Environment value) { + if (environmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvironmentsIsMutable(); + environments_.add(value); + onChanged(); + } else { + environmentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder addEnvironments( + int index, com.google.cloud.dialogflow.cx.v3beta1.Environment value) { + if (environmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvironmentsIsMutable(); + environments_.add(index, value); + onChanged(); + } else { + environmentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder addEnvironments( + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder builderForValue) { + if (environmentsBuilder_ == null) { + ensureEnvironmentsIsMutable(); + environments_.add(builderForValue.build()); + onChanged(); + } else { + environmentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder addEnvironments( + int index, com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder builderForValue) { + if (environmentsBuilder_ == null) { + ensureEnvironmentsIsMutable(); + environments_.add(index, builderForValue.build()); + onChanged(); + } else { + environmentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder addAllEnvironments( + java.lang.Iterable values) { + if (environmentsBuilder_ == null) { + ensureEnvironmentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, environments_); + onChanged(); + } else { + environmentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder clearEnvironments() { + if (environmentsBuilder_ == null) { + environments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + environmentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public Builder removeEnvironments(int index) { + if (environmentsBuilder_ == null) { + ensureEnvironmentsIsMutable(); + environments_.remove(index); + onChanged(); + } else { + environmentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder getEnvironmentsBuilder( + int index) { + return getEnvironmentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder getEnvironmentsOrBuilder( + int index) { + if (environmentsBuilder_ == null) { + return environments_.get(index); + } else { + return environmentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public java.util.List + getEnvironmentsOrBuilderList() { + if (environmentsBuilder_ != null) { + return environmentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(environments_); + } + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder addEnvironmentsBuilder() { + return getEnvironmentsFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.Environment.getDefaultInstance()); + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder addEnvironmentsBuilder( + int index) { + return getEnvironmentsFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.Environment.getDefaultInstance()); + } + /** + * + * + *
+     * Represents a list of snapshots for an environment. Time of the snapshots is
+     * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + public java.util.List + getEnvironmentsBuilderList() { + return getEnvironmentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment, + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder> + getEnvironmentsFieldBuilder() { + if (environmentsBuilder_ == null) { + environmentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment, + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder>( + environments_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + environments_ = null; + } + return environmentsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LookupEnvironmentHistoryResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LookupEnvironmentHistoryResponse(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.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LookupEnvironmentHistoryResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LookupEnvironmentHistoryResponseOrBuilder.java new file mode 100644 index 000000000..af363a9ce --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LookupEnvironmentHistoryResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface LookupEnvironmentHistoryResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Represents a list of snapshots for an environment. Time of the snapshots is
+   * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + java.util.List getEnvironmentsList(); + /** + * + * + *
+   * Represents a list of snapshots for an environment. Time of the snapshots is
+   * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironments(int index); + /** + * + * + *
+   * Represents a list of snapshots for an environment. Time of the snapshots is
+   * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + int getEnvironmentsCount(); + /** + * + * + *
+   * Represents a list of snapshots for an environment. Time of the snapshots is
+   * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + java.util.List + getEnvironmentsOrBuilderList(); + /** + * + * + *
+   * Represents a list of snapshots for an environment. Time of the snapshots is
+   * stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time].
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Environment environments = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder getEnvironmentsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Match.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Match.java new file mode 100644 index 000000000..6b8650c66 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Match.java @@ -0,0 +1,1854 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Represents one match result of [MatchIntent][].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Match} + */ +public final class Match extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Match) + MatchOrBuilder { + private static final long serialVersionUID = 0L; + // Use Match.newBuilder() to construct. + private Match(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Match() { + resolvedInput_ = ""; + matchType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Match(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Match( + 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.dialogflow.cx.v3beta1.Intent.Builder subBuilder = null; + if (intent_ != null) { + subBuilder = intent_.toBuilder(); + } + intent_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Intent.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(intent_); + intent_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (parameters_ != null) { + subBuilder = parameters_.toBuilder(); + } + parameters_ = + input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(parameters_); + parameters_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + resolvedInput_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + matchType_ = rawValue; + break; + } + case 45: + { + confidence_ = input.readFloat(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Match_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Match_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Match.class, + com.google.cloud.dialogflow.cx.v3beta1.Match.Builder.class); + } + + /** + * + * + *
+   * Type of a Match.
+   * 
+ * + * Protobuf enum {@code google.cloud.dialogflow.cx.v3beta1.Match.MatchType} + */ + public enum MatchType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. Should never be used.
+     * 
+ * + * MATCH_TYPE_UNSPECIFIED = 0; + */ + MATCH_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The query was matched to an intent.
+     * 
+ * + * INTENT = 1; + */ + INTENT(1), + /** + * + * + *
+     * The query directly triggered an intent.
+     * 
+ * + * DIRECT_INTENT = 2; + */ + DIRECT_INTENT(2), + /** + * + * + *
+     * The query was used for parameter filling.
+     * 
+ * + * PARAMETER_FILLING = 3; + */ + PARAMETER_FILLING(3), + /** + * + * + *
+     * No match was found for the query.
+     * 
+ * + * NO_MATCH = 4; + */ + NO_MATCH(4), + /** + * + * + *
+     * Indicates an empty query.
+     * 
+ * + * NO_INPUT = 5; + */ + NO_INPUT(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. Should never be used.
+     * 
+ * + * MATCH_TYPE_UNSPECIFIED = 0; + */ + public static final int MATCH_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The query was matched to an intent.
+     * 
+ * + * INTENT = 1; + */ + public static final int INTENT_VALUE = 1; + /** + * + * + *
+     * The query directly triggered an intent.
+     * 
+ * + * DIRECT_INTENT = 2; + */ + public static final int DIRECT_INTENT_VALUE = 2; + /** + * + * + *
+     * The query was used for parameter filling.
+     * 
+ * + * PARAMETER_FILLING = 3; + */ + public static final int PARAMETER_FILLING_VALUE = 3; + /** + * + * + *
+     * No match was found for the query.
+     * 
+ * + * NO_MATCH = 4; + */ + public static final int NO_MATCH_VALUE = 4; + /** + * + * + *
+     * Indicates an empty query.
+     * 
+ * + * NO_INPUT = 5; + */ + public static final int NO_INPUT_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @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 MatchType 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 MatchType forNumber(int value) { + switch (value) { + case 0: + return MATCH_TYPE_UNSPECIFIED; + case 1: + return INTENT; + case 2: + return DIRECT_INTENT; + case 3: + return PARAMETER_FILLING; + case 4: + return NO_MATCH; + case 5: + return NO_INPUT; + 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 MatchType findValueByNumber(int number) { + return MatchType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.Match.getDescriptor().getEnumTypes().get(0); + } + + private static final MatchType[] VALUES = values(); + + public static MatchType 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 MatchType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.Match.MatchType) + } + + public static final int INTENT_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.cx.v3beta1.Intent intent_; + /** + * + * + *
+   * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+   * this message, including but not limited to: `name` and `display_name`. Only
+   * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + * + * @return Whether the intent field is set. + */ + @java.lang.Override + public boolean hasIntent() { + return intent_ != null; + } + /** + * + * + *
+   * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+   * this message, including but not limited to: `name` and `display_name`. Only
+   * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + * + * @return The intent. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent() { + return intent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance() + : intent_; + } + /** + * + * + *
+   * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+   * this message, including but not limited to: `name` and `display_name`. Only
+   * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder() { + return getIntent(); + } + + public static final int PARAMETERS_FIELD_NUMBER = 2; + private com.google.protobuf.Struct parameters_; + /** + * + * + *
+   * The collection of parameters extracted from the query.
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 2; + * + * @return Whether the parameters field is set. + */ + @java.lang.Override + public boolean hasParameters() { + return parameters_ != null; + } + /** + * + * + *
+   * The collection of parameters extracted from the query.
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 2; + * + * @return The parameters. + */ + @java.lang.Override + public com.google.protobuf.Struct getParameters() { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } + /** + * + * + *
+   * The collection of parameters extracted from the query.
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 2; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getParametersOrBuilder() { + return getParameters(); + } + + public static final int RESOLVED_INPUT_FIELD_NUMBER = 3; + private volatile java.lang.Object resolvedInput_; + /** + * + * + *
+   * Final text input which was matched during MatchIntent. This value can be
+   * different from original input sent in request because of spelling
+   * correction or other processing.
+   * 
+ * + * string resolved_input = 3; + * + * @return The resolvedInput. + */ + @java.lang.Override + public java.lang.String getResolvedInput() { + java.lang.Object ref = resolvedInput_; + 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(); + resolvedInput_ = s; + return s; + } + } + /** + * + * + *
+   * Final text input which was matched during MatchIntent. This value can be
+   * different from original input sent in request because of spelling
+   * correction or other processing.
+   * 
+ * + * string resolved_input = 3; + * + * @return The bytes for resolvedInput. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResolvedInputBytes() { + java.lang.Object ref = resolvedInput_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resolvedInput_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MATCH_TYPE_FIELD_NUMBER = 4; + private int matchType_; + /** + * + * + *
+   * Type of this [Match][google.cloud.dialogflow.cx.v3beta1.Match].
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match.MatchType match_type = 4; + * + * @return The enum numeric value on the wire for matchType. + */ + @java.lang.Override + public int getMatchTypeValue() { + return matchType_; + } + /** + * + * + *
+   * Type of this [Match][google.cloud.dialogflow.cx.v3beta1.Match].
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match.MatchType match_type = 4; + * + * @return The matchType. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Match.MatchType getMatchType() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.Match.MatchType result = + com.google.cloud.dialogflow.cx.v3beta1.Match.MatchType.valueOf(matchType_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.Match.MatchType.UNRECOGNIZED + : result; + } + + public static final int CONFIDENCE_FIELD_NUMBER = 5; + private float confidence_; + /** + * + * + *
+   * The confidence of this match. Values range from 0.0 (completely uncertain)
+   * to 1.0 (completely certain).
+   * This value is for informational purpose only and is only used to help match
+   * the best intent within the classification threshold. This value may change
+   * for the same end-user expression at any time due to a model retraining or
+   * change in implementation.
+   * 
+ * + * float confidence = 5; + * + * @return The confidence. + */ + @java.lang.Override + public float getConfidence() { + return confidence_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (intent_ != null) { + output.writeMessage(1, getIntent()); + } + if (parameters_ != null) { + output.writeMessage(2, getParameters()); + } + if (!getResolvedInputBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, resolvedInput_); + } + if (matchType_ + != com.google.cloud.dialogflow.cx.v3beta1.Match.MatchType.MATCH_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, matchType_); + } + if (confidence_ != 0F) { + output.writeFloat(5, confidence_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (intent_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getIntent()); + } + if (parameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getParameters()); + } + if (!getResolvedInputBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, resolvedInput_); + } + if (matchType_ + != com.google.cloud.dialogflow.cx.v3beta1.Match.MatchType.MATCH_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, matchType_); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, confidence_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.Match)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Match other = + (com.google.cloud.dialogflow.cx.v3beta1.Match) obj; + + if (hasIntent() != other.hasIntent()) return false; + if (hasIntent()) { + if (!getIntent().equals(other.getIntent())) return false; + } + if (hasParameters() != other.hasParameters()) return false; + if (hasParameters()) { + if (!getParameters().equals(other.getParameters())) return false; + } + if (!getResolvedInput().equals(other.getResolvedInput())) return false; + if (matchType_ != other.matchType_) return false; + if (java.lang.Float.floatToIntBits(getConfidence()) + != java.lang.Float.floatToIntBits(other.getConfidence())) 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 (hasIntent()) { + hash = (37 * hash) + INTENT_FIELD_NUMBER; + hash = (53 * hash) + getIntent().hashCode(); + } + if (hasParameters()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParameters().hashCode(); + } + hash = (37 * hash) + RESOLVED_INPUT_FIELD_NUMBER; + hash = (53 * hash) + getResolvedInput().hashCode(); + hash = (37 * hash) + MATCH_TYPE_FIELD_NUMBER; + hash = (53 * hash) + matchType_; + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Match parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Match 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.dialogflow.cx.v3beta1.Match parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Match 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.dialogflow.cx.v3beta1.Match parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Match parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Match parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Match 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.dialogflow.cx.v3beta1.Match parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Match 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.dialogflow.cx.v3beta1.Match parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Match 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.dialogflow.cx.v3beta1.Match prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents one match result of [MatchIntent][].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Match} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Match) + com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Match_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Match_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Match.class, + com.google.cloud.dialogflow.cx.v3beta1.Match.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.Match.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (intentBuilder_ == null) { + intent_ = null; + } else { + intent_ = null; + intentBuilder_ = null; + } + if (parametersBuilder_ == null) { + parameters_ = null; + } else { + parameters_ = null; + parametersBuilder_ = null; + } + resolvedInput_ = ""; + + matchType_ = 0; + + confidence_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Match_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Match getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Match.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Match build() { + com.google.cloud.dialogflow.cx.v3beta1.Match result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Match buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Match result = + new com.google.cloud.dialogflow.cx.v3beta1.Match(this); + if (intentBuilder_ == null) { + result.intent_ = intent_; + } else { + result.intent_ = intentBuilder_.build(); + } + if (parametersBuilder_ == null) { + result.parameters_ = parameters_; + } else { + result.parameters_ = parametersBuilder_.build(); + } + result.resolvedInput_ = resolvedInput_; + result.matchType_ = matchType_; + result.confidence_ = confidence_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.Match) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.Match) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Match other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.Match.getDefaultInstance()) return this; + if (other.hasIntent()) { + mergeIntent(other.getIntent()); + } + if (other.hasParameters()) { + mergeParameters(other.getParameters()); + } + if (!other.getResolvedInput().isEmpty()) { + resolvedInput_ = other.resolvedInput_; + onChanged(); + } + if (other.matchType_ != 0) { + setMatchTypeValue(other.getMatchTypeValue()); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + 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.dialogflow.cx.v3beta1.Match parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.dialogflow.cx.v3beta1.Match) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Intent intent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder> + intentBuilder_; + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+     * this message, including but not limited to: `name` and `display_name`. Only
+     * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + * + * @return Whether the intent field is set. + */ + public boolean hasIntent() { + return intentBuilder_ != null || intent_ != null; + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+     * this message, including but not limited to: `name` and `display_name`. Only
+     * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + * + * @return The intent. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent() { + if (intentBuilder_ == null) { + return intent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance() + : intent_; + } else { + return intentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+     * this message, including but not limited to: `name` and `display_name`. Only
+     * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + */ + public Builder setIntent(com.google.cloud.dialogflow.cx.v3beta1.Intent value) { + if (intentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + intent_ = value; + onChanged(); + } else { + intentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+     * this message, including but not limited to: `name` and `display_name`. Only
+     * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + */ + public Builder setIntent( + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder builderForValue) { + if (intentBuilder_ == null) { + intent_ = builderForValue.build(); + onChanged(); + } else { + intentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+     * this message, including but not limited to: `name` and `display_name`. Only
+     * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + */ + public Builder mergeIntent(com.google.cloud.dialogflow.cx.v3beta1.Intent value) { + if (intentBuilder_ == null) { + if (intent_ != null) { + intent_ = + com.google.cloud.dialogflow.cx.v3beta1.Intent.newBuilder(intent_) + .mergeFrom(value) + .buildPartial(); + } else { + intent_ = value; + } + onChanged(); + } else { + intentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+     * this message, including but not limited to: `name` and `display_name`. Only
+     * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + */ + public Builder clearIntent() { + if (intentBuilder_ == null) { + intent_ = null; + onChanged(); + } else { + intent_ = null; + intentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+     * this message, including but not limited to: `name` and `display_name`. Only
+     * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder getIntentBuilder() { + + onChanged(); + return getIntentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+     * this message, including but not limited to: `name` and `display_name`. Only
+     * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder() { + if (intentBuilder_ != null) { + return intentBuilder_.getMessageOrBuilder(); + } else { + return intent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance() + : intent_; + } + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+     * this message, including but not limited to: `name` and `display_name`. Only
+     * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder> + getIntentFieldBuilder() { + if (intentBuilder_ == null) { + intentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder>( + getIntent(), getParentForChildren(), isClean()); + intent_ = null; + } + return intentBuilder_; + } + + private com.google.protobuf.Struct parameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + parametersBuilder_; + /** + * + * + *
+     * The collection of parameters extracted from the query.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 2; + * + * @return Whether the parameters field is set. + */ + public boolean hasParameters() { + return parametersBuilder_ != null || parameters_ != null; + } + /** + * + * + *
+     * The collection of parameters extracted from the query.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 2; + * + * @return The parameters. + */ + public com.google.protobuf.Struct getParameters() { + if (parametersBuilder_ == null) { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } else { + return parametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The collection of parameters extracted from the query.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 2; + */ + public Builder setParameters(com.google.protobuf.Struct value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parameters_ = value; + onChanged(); + } else { + parametersBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The collection of parameters extracted from the query.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 2; + */ + public Builder setParameters(com.google.protobuf.Struct.Builder builderForValue) { + if (parametersBuilder_ == null) { + parameters_ = builderForValue.build(); + onChanged(); + } else { + parametersBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The collection of parameters extracted from the query.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 2; + */ + public Builder mergeParameters(com.google.protobuf.Struct value) { + if (parametersBuilder_ == null) { + if (parameters_ != null) { + parameters_ = + com.google.protobuf.Struct.newBuilder(parameters_).mergeFrom(value).buildPartial(); + } else { + parameters_ = value; + } + onChanged(); + } else { + parametersBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The collection of parameters extracted from the query.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 2; + */ + public Builder clearParameters() { + if (parametersBuilder_ == null) { + parameters_ = null; + onChanged(); + } else { + parameters_ = null; + parametersBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The collection of parameters extracted from the query.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 2; + */ + public com.google.protobuf.Struct.Builder getParametersBuilder() { + + onChanged(); + return getParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The collection of parameters extracted from the query.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 2; + */ + public com.google.protobuf.StructOrBuilder getParametersOrBuilder() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilder(); + } else { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } + } + /** + * + * + *
+     * The collection of parameters extracted from the query.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getParameters(), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + private java.lang.Object resolvedInput_ = ""; + /** + * + * + *
+     * Final text input which was matched during MatchIntent. This value can be
+     * different from original input sent in request because of spelling
+     * correction or other processing.
+     * 
+ * + * string resolved_input = 3; + * + * @return The resolvedInput. + */ + public java.lang.String getResolvedInput() { + java.lang.Object ref = resolvedInput_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resolvedInput_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Final text input which was matched during MatchIntent. This value can be
+     * different from original input sent in request because of spelling
+     * correction or other processing.
+     * 
+ * + * string resolved_input = 3; + * + * @return The bytes for resolvedInput. + */ + public com.google.protobuf.ByteString getResolvedInputBytes() { + java.lang.Object ref = resolvedInput_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resolvedInput_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Final text input which was matched during MatchIntent. This value can be
+     * different from original input sent in request because of spelling
+     * correction or other processing.
+     * 
+ * + * string resolved_input = 3; + * + * @param value The resolvedInput to set. + * @return This builder for chaining. + */ + public Builder setResolvedInput(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resolvedInput_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Final text input which was matched during MatchIntent. This value can be
+     * different from original input sent in request because of spelling
+     * correction or other processing.
+     * 
+ * + * string resolved_input = 3; + * + * @return This builder for chaining. + */ + public Builder clearResolvedInput() { + + resolvedInput_ = getDefaultInstance().getResolvedInput(); + onChanged(); + return this; + } + /** + * + * + *
+     * Final text input which was matched during MatchIntent. This value can be
+     * different from original input sent in request because of spelling
+     * correction or other processing.
+     * 
+ * + * string resolved_input = 3; + * + * @param value The bytes for resolvedInput to set. + * @return This builder for chaining. + */ + public Builder setResolvedInputBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resolvedInput_ = value; + onChanged(); + return this; + } + + private int matchType_ = 0; + /** + * + * + *
+     * Type of this [Match][google.cloud.dialogflow.cx.v3beta1.Match].
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match.MatchType match_type = 4; + * + * @return The enum numeric value on the wire for matchType. + */ + @java.lang.Override + public int getMatchTypeValue() { + return matchType_; + } + /** + * + * + *
+     * Type of this [Match][google.cloud.dialogflow.cx.v3beta1.Match].
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match.MatchType match_type = 4; + * + * @param value The enum numeric value on the wire for matchType to set. + * @return This builder for chaining. + */ + public Builder setMatchTypeValue(int value) { + + matchType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Type of this [Match][google.cloud.dialogflow.cx.v3beta1.Match].
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match.MatchType match_type = 4; + * + * @return The matchType. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Match.MatchType getMatchType() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.Match.MatchType result = + com.google.cloud.dialogflow.cx.v3beta1.Match.MatchType.valueOf(matchType_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.Match.MatchType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Type of this [Match][google.cloud.dialogflow.cx.v3beta1.Match].
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match.MatchType match_type = 4; + * + * @param value The matchType to set. + * @return This builder for chaining. + */ + public Builder setMatchType(com.google.cloud.dialogflow.cx.v3beta1.Match.MatchType value) { + if (value == null) { + throw new NullPointerException(); + } + + matchType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of this [Match][google.cloud.dialogflow.cx.v3beta1.Match].
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match.MatchType match_type = 4; + * + * @return This builder for chaining. + */ + public Builder clearMatchType() { + + matchType_ = 0; + onChanged(); + return this; + } + + private float confidence_; + /** + * + * + *
+     * The confidence of this match. Values range from 0.0 (completely uncertain)
+     * to 1.0 (completely certain).
+     * This value is for informational purpose only and is only used to help match
+     * the best intent within the classification threshold. This value may change
+     * for the same end-user expression at any time due to a model retraining or
+     * change in implementation.
+     * 
+ * + * float confidence = 5; + * + * @return The confidence. + */ + @java.lang.Override + public float getConfidence() { + return confidence_; + } + /** + * + * + *
+     * The confidence of this match. Values range from 0.0 (completely uncertain)
+     * to 1.0 (completely certain).
+     * This value is for informational purpose only and is only used to help match
+     * the best intent within the classification threshold. This value may change
+     * for the same end-user expression at any time due to a model retraining or
+     * change in implementation.
+     * 
+ * + * float confidence = 5; + * + * @param value The confidence to set. + * @return This builder for chaining. + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The confidence of this match. Values range from 0.0 (completely uncertain)
+     * to 1.0 (completely certain).
+     * This value is for informational purpose only and is only used to help match
+     * the best intent within the classification threshold. This value may change
+     * for the same end-user expression at any time due to a model retraining or
+     * change in implementation.
+     * 
+ * + * float confidence = 5; + * + * @return This builder for chaining. + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.Match) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Match) + private static final com.google.cloud.dialogflow.cx.v3beta1.Match DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Match(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Match getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Match parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Match(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.dialogflow.cx.v3beta1.Match getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchIntentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchIntentRequest.java new file mode 100644 index 000000000..875251914 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchIntentRequest.java @@ -0,0 +1,1269 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Request of [MatchIntent][].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest} + */ +public final class MatchIntentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest) + MatchIntentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use MatchIntentRequest.newBuilder() to construct. + private MatchIntentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MatchIntentRequest() { + session_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MatchIntentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MatchIntentRequest( + 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(); + + session_ = s; + break; + } + case 18: + { + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder subBuilder = null; + if (queryParams_ != null) { + subBuilder = queryParams_.toBuilder(); + } + queryParams_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryParams_); + queryParams_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder subBuilder = null; + if (queryInput_ != null) { + subBuilder = queryInput_.toBuilder(); + } + queryInput_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryInput_); + queryInput_ = 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.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.Builder.class); + } + + public static final int SESSION_FIELD_NUMBER = 1; + private volatile java.lang.Object session_; + /** + * + * + *
+   * Required. The name of the session this query is sent to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * It's up to the API caller to choose an appropriate `Session ID`. It can be
+   * a random number or some type of session identifiers (preferably hashed).
+   * The length of the `Session ID` must not exceed 36 characters.
+   * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The session. + */ + @java.lang.Override + public java.lang.String getSession() { + java.lang.Object ref = session_; + 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(); + session_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the session this query is sent to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * It's up to the API caller to choose an appropriate `Session ID`. It can be
+   * a random number or some type of session identifiers (preferably hashed).
+   * The length of the `Session ID` must not exceed 36 characters.
+   * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for session. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSessionBytes() { + java.lang.Object ref = session_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + session_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_PARAMS_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.QueryParameters queryParams_; + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return Whether the queryParams field is set. + */ + @java.lang.Override + public boolean hasQueryParams() { + return queryParams_ != null; + } + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return The queryParams. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryParameters getQueryParams() { + return queryParams_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.getDefaultInstance() + : queryParams_; + } + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder getQueryParamsOrBuilder() { + return getQueryParams(); + } + + public static final int QUERY_INPUT_FIELD_NUMBER = 3; + private com.google.cloud.dialogflow.cx.v3beta1.QueryInput queryInput_; + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the queryInput field is set. + */ + @java.lang.Override + public boolean hasQueryInput() { + return queryInput_ != null; + } + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The queryInput. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryInput getQueryInput() { + return queryInput_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryInput.getDefaultInstance() + : queryInput_; + } + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputOrBuilder() { + return getQueryInput(); + } + + 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 (!getSessionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, session_); + } + if (queryParams_ != null) { + output.writeMessage(2, getQueryParams()); + } + if (queryInput_ != null) { + output.writeMessage(3, getQueryInput()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSessionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, session_); + } + if (queryParams_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQueryParams()); + } + if (queryInput_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getQueryInput()); + } + 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.dialogflow.cx.v3beta1.MatchIntentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest) obj; + + if (!getSession().equals(other.getSession())) return false; + if (hasQueryParams() != other.hasQueryParams()) return false; + if (hasQueryParams()) { + if (!getQueryParams().equals(other.getQueryParams())) return false; + } + if (hasQueryInput() != other.hasQueryInput()) return false; + if (hasQueryInput()) { + if (!getQueryInput().equals(other.getQueryInput())) 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) + SESSION_FIELD_NUMBER; + hash = (53 * hash) + getSession().hashCode(); + if (hasQueryParams()) { + hash = (37 * hash) + QUERY_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getQueryParams().hashCode(); + } + if (hasQueryInput()) { + hash = (37 * hash) + QUERY_INPUT_FIELD_NUMBER; + hash = (53 * hash) + getQueryInput().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest 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.dialogflow.cx.v3beta1.MatchIntentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest 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.dialogflow.cx.v3beta1.MatchIntentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest 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.dialogflow.cx.v3beta1.MatchIntentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest 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.dialogflow.cx.v3beta1.MatchIntentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest 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.dialogflow.cx.v3beta1.MatchIntentRequest 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 of [MatchIntent][].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest) + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.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(); + session_ = ""; + + if (queryParamsBuilder_ == null) { + queryParams_ = null; + } else { + queryParams_ = null; + queryParamsBuilder_ = null; + } + if (queryInputBuilder_ == null) { + queryInput_ = null; + } else { + queryInput_ = null; + queryInputBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest(this); + result.session_ = session_; + if (queryParamsBuilder_ == null) { + result.queryParams_ = queryParams_; + } else { + result.queryParams_ = queryParamsBuilder_.build(); + } + if (queryInputBuilder_ == null) { + result.queryInput_ = queryInput_; + } else { + result.queryInput_ = queryInputBuilder_.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.dialogflow.cx.v3beta1.MatchIntentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest.getDefaultInstance()) + return this; + if (!other.getSession().isEmpty()) { + session_ = other.session_; + onChanged(); + } + if (other.hasQueryParams()) { + mergeQueryParams(other.getQueryParams()); + } + if (other.hasQueryInput()) { + mergeQueryInput(other.getQueryInput()); + } + 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.dialogflow.cx.v3beta1.MatchIntentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object session_ = ""; + /** + * + * + *
+     * Required. The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The session. + */ + public java.lang.String getSession() { + java.lang.Object ref = session_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + session_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for session. + */ + public com.google.protobuf.ByteString getSessionBytes() { + java.lang.Object ref = session_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + session_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The session to set. + * @return This builder for chaining. + */ + public Builder setSession(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + session_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSession() { + + session_ = getDefaultInstance().getSession(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for session to set. + * @return This builder for chaining. + */ + public Builder setSessionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + session_ = value; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.QueryParameters queryParams_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters, + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder> + queryParamsBuilder_; + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return Whether the queryParams field is set. + */ + public boolean hasQueryParams() { + return queryParamsBuilder_ != null || queryParams_ != null; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return The queryParams. + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryParameters getQueryParams() { + if (queryParamsBuilder_ == null) { + return queryParams_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.getDefaultInstance() + : queryParams_; + } else { + return queryParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public Builder setQueryParams(com.google.cloud.dialogflow.cx.v3beta1.QueryParameters value) { + if (queryParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryParams_ = value; + onChanged(); + } else { + queryParamsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public Builder setQueryParams( + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder builderForValue) { + if (queryParamsBuilder_ == null) { + queryParams_ = builderForValue.build(); + onChanged(); + } else { + queryParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public Builder mergeQueryParams(com.google.cloud.dialogflow.cx.v3beta1.QueryParameters value) { + if (queryParamsBuilder_ == null) { + if (queryParams_ != null) { + queryParams_ = + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.newBuilder(queryParams_) + .mergeFrom(value) + .buildPartial(); + } else { + queryParams_ = value; + } + onChanged(); + } else { + queryParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public Builder clearQueryParams() { + if (queryParamsBuilder_ == null) { + queryParams_ = null; + onChanged(); + } else { + queryParams_ = null; + queryParamsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder getQueryParamsBuilder() { + + onChanged(); + return getQueryParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder + getQueryParamsOrBuilder() { + if (queryParamsBuilder_ != null) { + return queryParamsBuilder_.getMessageOrBuilder(); + } else { + return queryParams_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.getDefaultInstance() + : queryParams_; + } + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters, + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder> + getQueryParamsFieldBuilder() { + if (queryParamsBuilder_ == null) { + queryParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters, + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder>( + getQueryParams(), getParentForChildren(), isClean()); + queryParams_ = null; + } + return queryParamsBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.QueryInput queryInput_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryInput, + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder> + queryInputBuilder_; + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the queryInput field is set. + */ + public boolean hasQueryInput() { + return queryInputBuilder_ != null || queryInput_ != null; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The queryInput. + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryInput getQueryInput() { + if (queryInputBuilder_ == null) { + return queryInput_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryInput.getDefaultInstance() + : queryInput_; + } else { + return queryInputBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQueryInput(com.google.cloud.dialogflow.cx.v3beta1.QueryInput value) { + if (queryInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryInput_ = value; + onChanged(); + } else { + queryInputBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQueryInput( + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder builderForValue) { + if (queryInputBuilder_ == null) { + queryInput_ = builderForValue.build(); + onChanged(); + } else { + queryInputBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeQueryInput(com.google.cloud.dialogflow.cx.v3beta1.QueryInput value) { + if (queryInputBuilder_ == null) { + if (queryInput_ != null) { + queryInput_ = + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.newBuilder(queryInput_) + .mergeFrom(value) + .buildPartial(); + } else { + queryInput_ = value; + } + onChanged(); + } else { + queryInputBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearQueryInput() { + if (queryInputBuilder_ == null) { + queryInput_ = null; + onChanged(); + } else { + queryInput_ = null; + queryInputBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder getQueryInputBuilder() { + + onChanged(); + return getQueryInputFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputOrBuilder() { + if (queryInputBuilder_ != null) { + return queryInputBuilder_.getMessageOrBuilder(); + } else { + return queryInput_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryInput.getDefaultInstance() + : queryInput_; + } + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryInput, + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder> + getQueryInputFieldBuilder() { + if (queryInputBuilder_ == null) { + queryInputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryInput, + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder>( + getQueryInput(), getParentForChildren(), isClean()); + queryInput_ = null; + } + return queryInputBuilder_; + } + + @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.dialogflow.cx.v3beta1.MatchIntentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MatchIntentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MatchIntentRequest(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.dialogflow.cx.v3beta1.MatchIntentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchIntentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchIntentRequestOrBuilder.java new file mode 100644 index 000000000..9b4872bfc --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchIntentRequestOrBuilder.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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface MatchIntentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the session this query is sent to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * It's up to the API caller to choose an appropriate `Session ID`. It can be
+   * a random number or some type of session identifiers (preferably hashed).
+   * The length of the `Session ID` must not exceed 36 characters.
+   * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The session. + */ + java.lang.String getSession(); + /** + * + * + *
+   * Required. The name of the session this query is sent to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * It's up to the API caller to choose an appropriate `Session ID`. It can be
+   * a random number or some type of session identifiers (preferably hashed).
+   * The length of the `Session ID` must not exceed 36 characters.
+   * 
+ * + * + * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for session. + */ + com.google.protobuf.ByteString getSessionBytes(); + + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return Whether the queryParams field is set. + */ + boolean hasQueryParams(); + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return The queryParams. + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters getQueryParams(); + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder getQueryParamsOrBuilder(); + + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the queryInput field is set. + */ + boolean hasQueryInput(); + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The queryInput. + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryInput getQueryInput(); + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchIntentResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchIntentResponse.java new file mode 100644 index 000000000..02a3f205c --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchIntentResponse.java @@ -0,0 +1,1982 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Response of [MatchIntent][].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse} + */ +public final class MatchIntentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse) + MatchIntentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use MatchIntentResponse.newBuilder() to construct. + private MatchIntentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MatchIntentResponse() { + matches_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MatchIntentResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MatchIntentResponse( + 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(); + queryCase_ = 1; + query_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + queryCase_ = 2; + query_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + queryCase_ = 3; + query_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + matches_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + matches_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Match.parser(), extensionRegistry)); + break; + } + case 42: + { + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder subBuilder = null; + if (currentPage_ != null) { + subBuilder = currentPage_.toBuilder(); + } + currentPage_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Page.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(currentPage_); + currentPage_ = 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)) { + matches_ = java.util.Collections.unmodifiableList(matches_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.Builder.class); + } + + private int queryCase_ = 0; + private java.lang.Object query_; + + public enum QueryCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TEXT(1), + TRIGGER_INTENT(2), + TRANSCRIPT(3), + QUERY_NOT_SET(0); + private final int value; + + private QueryCase(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 QueryCase valueOf(int value) { + return forNumber(value); + } + + public static QueryCase forNumber(int value) { + switch (value) { + case 1: + return TEXT; + case 2: + return TRIGGER_INTENT; + case 3: + return TRANSCRIPT; + case 0: + return QUERY_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public QueryCase getQueryCase() { + return QueryCase.forNumber(queryCase_); + } + + public static final int TEXT_FIELD_NUMBER = 1; + /** + * + * + *
+   * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+   * will contain a copy of the text.
+   * 
+ * + * string text = 1; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = ""; + if (queryCase_ == 1) { + ref = query_; + } + 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 (queryCase_ == 1) { + query_ = s; + } + return s; + } + } + /** + * + * + *
+   * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+   * will contain a copy of the text.
+   * 
+ * + * string text = 1; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 1) { + ref = query_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (queryCase_ == 1) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRIGGER_INTENT_FIELD_NUMBER = 2; + /** + * + * + *
+   * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+   * contain a copy of the intent identifier.
+   * 
+ * + * string trigger_intent = 2; + * + * @return The triggerIntent. + */ + public java.lang.String getTriggerIntent() { + java.lang.Object ref = ""; + if (queryCase_ == 2) { + ref = query_; + } + 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 (queryCase_ == 2) { + query_ = s; + } + return s; + } + } + /** + * + * + *
+   * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+   * contain a copy of the intent identifier.
+   * 
+ * + * string trigger_intent = 2; + * + * @return The bytes for triggerIntent. + */ + public com.google.protobuf.ByteString getTriggerIntentBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 2) { + ref = query_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (queryCase_ == 2) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRANSCRIPT_FIELD_NUMBER = 3; + /** + * + * + *
+   * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+   * this field will contain the trascript for the audio.
+   * 
+ * + * string transcript = 3; + * + * @return The transcript. + */ + public java.lang.String getTranscript() { + java.lang.Object ref = ""; + if (queryCase_ == 3) { + ref = query_; + } + 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 (queryCase_ == 3) { + query_ = s; + } + return s; + } + } + /** + * + * + *
+   * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+   * this field will contain the trascript for the audio.
+   * 
+ * + * string transcript = 3; + * + * @return The bytes for transcript. + */ + public com.google.protobuf.ByteString getTranscriptBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 3) { + ref = query_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (queryCase_ == 3) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MATCHES_FIELD_NUMBER = 4; + private java.util.List matches_; + /** + * + * + *
+   * Match results, if more than one, ordered descendingly by the confidence
+   * we have that the particular intent matches the query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + @java.lang.Override + public java.util.List getMatchesList() { + return matches_; + } + /** + * + * + *
+   * Match results, if more than one, ordered descendingly by the confidence
+   * we have that the particular intent matches the query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + @java.lang.Override + public java.util.List + getMatchesOrBuilderList() { + return matches_; + } + /** + * + * + *
+   * Match results, if more than one, ordered descendingly by the confidence
+   * we have that the particular intent matches the query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + @java.lang.Override + public int getMatchesCount() { + return matches_.size(); + } + /** + * + * + *
+   * Match results, if more than one, ordered descendingly by the confidence
+   * we have that the particular intent matches the query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Match getMatches(int index) { + return matches_.get(index); + } + /** + * + * + *
+   * Match results, if more than one, ordered descendingly by the confidence
+   * we have that the particular intent matches the query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder getMatchesOrBuilder(int index) { + return matches_.get(index); + } + + public static final int CURRENT_PAGE_FIELD_NUMBER = 5; + private com.google.cloud.dialogflow.cx.v3beta1.Page currentPage_; + /** + * + * + *
+   * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+   * including but not limited to `name` and `display_name`.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + * + * @return Whether the currentPage field is set. + */ + @java.lang.Override + public boolean hasCurrentPage() { + return currentPage_ != null; + } + /** + * + * + *
+   * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+   * including but not limited to `name` and `display_name`.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + * + * @return The currentPage. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Page getCurrentPage() { + return currentPage_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance() + : currentPage_; + } + /** + * + * + *
+   * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+   * including but not limited to `name` and `display_name`.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getCurrentPageOrBuilder() { + return getCurrentPage(); + } + + 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 (queryCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, query_); + } + if (queryCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, query_); + } + if (queryCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, query_); + } + for (int i = 0; i < matches_.size(); i++) { + output.writeMessage(4, matches_.get(i)); + } + if (currentPage_ != null) { + output.writeMessage(5, getCurrentPage()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (queryCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, query_); + } + if (queryCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, query_); + } + if (queryCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, query_); + } + for (int i = 0; i < matches_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, matches_.get(i)); + } + if (currentPage_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCurrentPage()); + } + 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.dialogflow.cx.v3beta1.MatchIntentResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse) obj; + + if (!getMatchesList().equals(other.getMatchesList())) return false; + if (hasCurrentPage() != other.hasCurrentPage()) return false; + if (hasCurrentPage()) { + if (!getCurrentPage().equals(other.getCurrentPage())) return false; + } + if (!getQueryCase().equals(other.getQueryCase())) return false; + switch (queryCase_) { + case 1: + if (!getText().equals(other.getText())) return false; + break; + case 2: + if (!getTriggerIntent().equals(other.getTriggerIntent())) return false; + break; + case 3: + if (!getTranscript().equals(other.getTranscript())) 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 (getMatchesCount() > 0) { + hash = (37 * hash) + MATCHES_FIELD_NUMBER; + hash = (53 * hash) + getMatchesList().hashCode(); + } + if (hasCurrentPage()) { + hash = (37 * hash) + CURRENT_PAGE_FIELD_NUMBER; + hash = (53 * hash) + getCurrentPage().hashCode(); + } + switch (queryCase_) { + case 1: + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 2: + hash = (37 * hash) + TRIGGER_INTENT_FIELD_NUMBER; + hash = (53 * hash) + getTriggerIntent().hashCode(); + break; + case 3: + hash = (37 * hash) + TRANSCRIPT_FIELD_NUMBER; + hash = (53 * hash) + getTranscript().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse 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.dialogflow.cx.v3beta1.MatchIntentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse 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.dialogflow.cx.v3beta1.MatchIntentResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse 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.dialogflow.cx.v3beta1.MatchIntentResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse 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.dialogflow.cx.v3beta1.MatchIntentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse 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.dialogflow.cx.v3beta1.MatchIntentResponse 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 [MatchIntent][].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse) + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMatchesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (matchesBuilder_ == null) { + matches_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + matchesBuilder_.clear(); + } + if (currentPageBuilder_ == null) { + currentPage_ = null; + } else { + currentPage_ = null; + currentPageBuilder_ = null; + } + queryCase_ = 0; + query_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse(this); + int from_bitField0_ = bitField0_; + if (queryCase_ == 1) { + result.query_ = query_; + } + if (queryCase_ == 2) { + result.query_ = query_; + } + if (queryCase_ == 3) { + result.query_ = query_; + } + if (matchesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + matches_ = java.util.Collections.unmodifiableList(matches_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.matches_ = matches_; + } else { + result.matches_ = matchesBuilder_.build(); + } + if (currentPageBuilder_ == null) { + result.currentPage_ = currentPage_; + } else { + result.currentPage_ = currentPageBuilder_.build(); + } + result.queryCase_ = queryCase_; + 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.dialogflow.cx.v3beta1.MatchIntentResponse) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.getDefaultInstance()) + return this; + if (matchesBuilder_ == null) { + if (!other.matches_.isEmpty()) { + if (matches_.isEmpty()) { + matches_ = other.matches_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMatchesIsMutable(); + matches_.addAll(other.matches_); + } + onChanged(); + } + } else { + if (!other.matches_.isEmpty()) { + if (matchesBuilder_.isEmpty()) { + matchesBuilder_.dispose(); + matchesBuilder_ = null; + matches_ = other.matches_; + bitField0_ = (bitField0_ & ~0x00000001); + matchesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMatchesFieldBuilder() + : null; + } else { + matchesBuilder_.addAllMessages(other.matches_); + } + } + } + if (other.hasCurrentPage()) { + mergeCurrentPage(other.getCurrentPage()); + } + switch (other.getQueryCase()) { + case TEXT: + { + queryCase_ = 1; + query_ = other.query_; + onChanged(); + break; + } + case TRIGGER_INTENT: + { + queryCase_ = 2; + query_ = other.query_; + onChanged(); + break; + } + case TRANSCRIPT: + { + queryCase_ = 3; + query_ = other.query_; + onChanged(); + break; + } + case QUERY_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.dialogflow.cx.v3beta1.MatchIntentResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int queryCase_ = 0; + private java.lang.Object query_; + + public QueryCase getQueryCase() { + return QueryCase.forNumber(queryCase_); + } + + public Builder clearQuery() { + queryCase_ = 0; + query_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+     * will contain a copy of the text.
+     * 
+ * + * string text = 1; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = ""; + if (queryCase_ == 1) { + ref = query_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (queryCase_ == 1) { + query_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+     * will contain a copy of the text.
+     * 
+ * + * string text = 1; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 1) { + ref = query_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (queryCase_ == 1) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+     * will contain a copy of the text.
+     * 
+ * + * string text = 1; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + queryCase_ = 1; + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+     * will contain a copy of the text.
+     * 
+ * + * string text = 1; + * + * @return This builder for chaining. + */ + public Builder clearText() { + if (queryCase_ == 1) { + queryCase_ = 0; + query_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+     * will contain a copy of the text.
+     * 
+ * + * string text = 1; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + queryCase_ = 1; + query_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+     * contain a copy of the intent identifier.
+     * 
+ * + * string trigger_intent = 2; + * + * @return The triggerIntent. + */ + @java.lang.Override + public java.lang.String getTriggerIntent() { + java.lang.Object ref = ""; + if (queryCase_ == 2) { + ref = query_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (queryCase_ == 2) { + query_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+     * contain a copy of the intent identifier.
+     * 
+ * + * string trigger_intent = 2; + * + * @return The bytes for triggerIntent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTriggerIntentBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 2) { + ref = query_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (queryCase_ == 2) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+     * contain a copy of the intent identifier.
+     * 
+ * + * string trigger_intent = 2; + * + * @param value The triggerIntent to set. + * @return This builder for chaining. + */ + public Builder setTriggerIntent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + queryCase_ = 2; + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+     * contain a copy of the intent identifier.
+     * 
+ * + * string trigger_intent = 2; + * + * @return This builder for chaining. + */ + public Builder clearTriggerIntent() { + if (queryCase_ == 2) { + queryCase_ = 0; + query_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+     * contain a copy of the intent identifier.
+     * 
+ * + * string trigger_intent = 2; + * + * @param value The bytes for triggerIntent to set. + * @return This builder for chaining. + */ + public Builder setTriggerIntentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + queryCase_ = 2; + query_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+     * this field will contain the trascript for the audio.
+     * 
+ * + * string transcript = 3; + * + * @return The transcript. + */ + @java.lang.Override + public java.lang.String getTranscript() { + java.lang.Object ref = ""; + if (queryCase_ == 3) { + ref = query_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (queryCase_ == 3) { + query_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+     * this field will contain the trascript for the audio.
+     * 
+ * + * string transcript = 3; + * + * @return The bytes for transcript. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTranscriptBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 3) { + ref = query_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (queryCase_ == 3) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+     * this field will contain the trascript for the audio.
+     * 
+ * + * string transcript = 3; + * + * @param value The transcript to set. + * @return This builder for chaining. + */ + public Builder setTranscript(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + queryCase_ = 3; + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+     * this field will contain the trascript for the audio.
+     * 
+ * + * string transcript = 3; + * + * @return This builder for chaining. + */ + public Builder clearTranscript() { + if (queryCase_ == 3) { + queryCase_ = 0; + query_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+     * this field will contain the trascript for the audio.
+     * 
+ * + * string transcript = 3; + * + * @param value The bytes for transcript to set. + * @return This builder for chaining. + */ + public Builder setTranscriptBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + queryCase_ = 3; + query_ = value; + onChanged(); + return this; + } + + private java.util.List matches_ = + java.util.Collections.emptyList(); + + private void ensureMatchesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + matches_ = new java.util.ArrayList(matches_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Match, + com.google.cloud.dialogflow.cx.v3beta1.Match.Builder, + com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder> + matchesBuilder_; + + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public java.util.List getMatchesList() { + if (matchesBuilder_ == null) { + return java.util.Collections.unmodifiableList(matches_); + } else { + return matchesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public int getMatchesCount() { + if (matchesBuilder_ == null) { + return matches_.size(); + } else { + return matchesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Match getMatches(int index) { + if (matchesBuilder_ == null) { + return matches_.get(index); + } else { + return matchesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public Builder setMatches(int index, com.google.cloud.dialogflow.cx.v3beta1.Match value) { + if (matchesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMatchesIsMutable(); + matches_.set(index, value); + onChanged(); + } else { + matchesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public Builder setMatches( + int index, com.google.cloud.dialogflow.cx.v3beta1.Match.Builder builderForValue) { + if (matchesBuilder_ == null) { + ensureMatchesIsMutable(); + matches_.set(index, builderForValue.build()); + onChanged(); + } else { + matchesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public Builder addMatches(com.google.cloud.dialogflow.cx.v3beta1.Match value) { + if (matchesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMatchesIsMutable(); + matches_.add(value); + onChanged(); + } else { + matchesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public Builder addMatches(int index, com.google.cloud.dialogflow.cx.v3beta1.Match value) { + if (matchesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMatchesIsMutable(); + matches_.add(index, value); + onChanged(); + } else { + matchesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public Builder addMatches( + com.google.cloud.dialogflow.cx.v3beta1.Match.Builder builderForValue) { + if (matchesBuilder_ == null) { + ensureMatchesIsMutable(); + matches_.add(builderForValue.build()); + onChanged(); + } else { + matchesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public Builder addMatches( + int index, com.google.cloud.dialogflow.cx.v3beta1.Match.Builder builderForValue) { + if (matchesBuilder_ == null) { + ensureMatchesIsMutable(); + matches_.add(index, builderForValue.build()); + onChanged(); + } else { + matchesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public Builder addAllMatches( + java.lang.Iterable values) { + if (matchesBuilder_ == null) { + ensureMatchesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, matches_); + onChanged(); + } else { + matchesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public Builder clearMatches() { + if (matchesBuilder_ == null) { + matches_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + matchesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public Builder removeMatches(int index) { + if (matchesBuilder_ == null) { + ensureMatchesIsMutable(); + matches_.remove(index); + onChanged(); + } else { + matchesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Match.Builder getMatchesBuilder(int index) { + return getMatchesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder getMatchesOrBuilder(int index) { + if (matchesBuilder_ == null) { + return matches_.get(index); + } else { + return matchesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public java.util.List + getMatchesOrBuilderList() { + if (matchesBuilder_ != null) { + return matchesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(matches_); + } + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Match.Builder addMatchesBuilder() { + return getMatchesFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.Match.getDefaultInstance()); + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Match.Builder addMatchesBuilder(int index) { + return getMatchesFieldBuilder() + .addBuilder(index, com.google.cloud.dialogflow.cx.v3beta1.Match.getDefaultInstance()); + } + /** + * + * + *
+     * Match results, if more than one, ordered descendingly by the confidence
+     * we have that the particular intent matches the query.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + public java.util.List + getMatchesBuilderList() { + return getMatchesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Match, + com.google.cloud.dialogflow.cx.v3beta1.Match.Builder, + com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder> + getMatchesFieldBuilder() { + if (matchesBuilder_ == null) { + matchesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Match, + com.google.cloud.dialogflow.cx.v3beta1.Match.Builder, + com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder>( + matches_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + matches_ = null; + } + return matchesBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Page currentPage_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder> + currentPageBuilder_; + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + * + * @return Whether the currentPage field is set. + */ + public boolean hasCurrentPage() { + return currentPageBuilder_ != null || currentPage_ != null; + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + * + * @return The currentPage. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Page getCurrentPage() { + if (currentPageBuilder_ == null) { + return currentPage_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance() + : currentPage_; + } else { + return currentPageBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + */ + public Builder setCurrentPage(com.google.cloud.dialogflow.cx.v3beta1.Page value) { + if (currentPageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + currentPage_ = value; + onChanged(); + } else { + currentPageBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + */ + public Builder setCurrentPage( + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder builderForValue) { + if (currentPageBuilder_ == null) { + currentPage_ = builderForValue.build(); + onChanged(); + } else { + currentPageBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + */ + public Builder mergeCurrentPage(com.google.cloud.dialogflow.cx.v3beta1.Page value) { + if (currentPageBuilder_ == null) { + if (currentPage_ != null) { + currentPage_ = + com.google.cloud.dialogflow.cx.v3beta1.Page.newBuilder(currentPage_) + .mergeFrom(value) + .buildPartial(); + } else { + currentPage_ = value; + } + onChanged(); + } else { + currentPageBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + */ + public Builder clearCurrentPage() { + if (currentPageBuilder_ == null) { + currentPage_ = null; + onChanged(); + } else { + currentPage_ = null; + currentPageBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Page.Builder getCurrentPageBuilder() { + + onChanged(); + return getCurrentPageFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getCurrentPageOrBuilder() { + if (currentPageBuilder_ != null) { + return currentPageBuilder_.getMessageOrBuilder(); + } else { + return currentPage_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance() + : currentPage_; + } + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder> + getCurrentPageFieldBuilder() { + if (currentPageBuilder_ == null) { + currentPageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder>( + getCurrentPage(), getParentForChildren(), isClean()); + currentPage_ = null; + } + return currentPageBuilder_; + } + + @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.dialogflow.cx.v3beta1.MatchIntentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MatchIntentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MatchIntentResponse(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.dialogflow.cx.v3beta1.MatchIntentResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchIntentResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchIntentResponseOrBuilder.java new file mode 100644 index 000000000..50fb2bcae --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchIntentResponseOrBuilder.java @@ -0,0 +1,203 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface MatchIntentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+   * will contain a copy of the text.
+   * 
+ * + * string text = 1; + * + * @return The text. + */ + java.lang.String getText(); + /** + * + * + *
+   * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+   * will contain a copy of the text.
+   * 
+ * + * string text = 1; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); + + /** + * + * + *
+   * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+   * contain a copy of the intent identifier.
+   * 
+ * + * string trigger_intent = 2; + * + * @return The triggerIntent. + */ + java.lang.String getTriggerIntent(); + /** + * + * + *
+   * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+   * contain a copy of the intent identifier.
+   * 
+ * + * string trigger_intent = 2; + * + * @return The bytes for triggerIntent. + */ + com.google.protobuf.ByteString getTriggerIntentBytes(); + + /** + * + * + *
+   * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+   * this field will contain the trascript for the audio.
+   * 
+ * + * string transcript = 3; + * + * @return The transcript. + */ + java.lang.String getTranscript(); + /** + * + * + *
+   * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+   * this field will contain the trascript for the audio.
+   * 
+ * + * string transcript = 3; + * + * @return The bytes for transcript. + */ + com.google.protobuf.ByteString getTranscriptBytes(); + + /** + * + * + *
+   * Match results, if more than one, ordered descendingly by the confidence
+   * we have that the particular intent matches the query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + java.util.List getMatchesList(); + /** + * + * + *
+   * Match results, if more than one, ordered descendingly by the confidence
+   * we have that the particular intent matches the query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + com.google.cloud.dialogflow.cx.v3beta1.Match getMatches(int index); + /** + * + * + *
+   * Match results, if more than one, ordered descendingly by the confidence
+   * we have that the particular intent matches the query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + int getMatchesCount(); + /** + * + * + *
+   * Match results, if more than one, ordered descendingly by the confidence
+   * we have that the particular intent matches the query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + java.util.List + getMatchesOrBuilderList(); + /** + * + * + *
+   * Match results, if more than one, ordered descendingly by the confidence
+   * we have that the particular intent matches the query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.Match matches = 4; + */ + com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder getMatchesOrBuilder(int index); + + /** + * + * + *
+   * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+   * including but not limited to `name` and `display_name`.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + * + * @return Whether the currentPage field is set. + */ + boolean hasCurrentPage(); + /** + * + * + *
+   * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+   * including but not limited to `name` and `display_name`.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + * + * @return The currentPage. + */ + com.google.cloud.dialogflow.cx.v3beta1.Page getCurrentPage(); + /** + * + * + *
+   * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+   * including but not limited to `name` and `display_name`.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 5; + */ + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getCurrentPageOrBuilder(); + + public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse.QueryCase getQueryCase(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchOrBuilder.java new file mode 100644 index 000000000..633982743 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchOrBuilder.java @@ -0,0 +1,209 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface MatchOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Match) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+   * this message, including but not limited to: `name` and `display_name`. Only
+   * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + * + * @return Whether the intent field is set. + */ + boolean hasIntent(); + /** + * + * + *
+   * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+   * this message, including but not limited to: `name` and `display_name`. Only
+   * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + * + * @return The intent. + */ + com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent(); + /** + * + * + *
+   * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in
+   * this message, including but not limited to: `name` and `display_name`. Only
+   * filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder(); + + /** + * + * + *
+   * The collection of parameters extracted from the query.
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 2; + * + * @return Whether the parameters field is set. + */ + boolean hasParameters(); + /** + * + * + *
+   * The collection of parameters extracted from the query.
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 2; + * + * @return The parameters. + */ + com.google.protobuf.Struct getParameters(); + /** + * + * + *
+   * The collection of parameters extracted from the query.
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 2; + */ + com.google.protobuf.StructOrBuilder getParametersOrBuilder(); + + /** + * + * + *
+   * Final text input which was matched during MatchIntent. This value can be
+   * different from original input sent in request because of spelling
+   * correction or other processing.
+   * 
+ * + * string resolved_input = 3; + * + * @return The resolvedInput. + */ + java.lang.String getResolvedInput(); + /** + * + * + *
+   * Final text input which was matched during MatchIntent. This value can be
+   * different from original input sent in request because of spelling
+   * correction or other processing.
+   * 
+ * + * string resolved_input = 3; + * + * @return The bytes for resolvedInput. + */ + com.google.protobuf.ByteString getResolvedInputBytes(); + + /** + * + * + *
+   * Type of this [Match][google.cloud.dialogflow.cx.v3beta1.Match].
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match.MatchType match_type = 4; + * + * @return The enum numeric value on the wire for matchType. + */ + int getMatchTypeValue(); + /** + * + * + *
+   * Type of this [Match][google.cloud.dialogflow.cx.v3beta1.Match].
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match.MatchType match_type = 4; + * + * @return The matchType. + */ + com.google.cloud.dialogflow.cx.v3beta1.Match.MatchType getMatchType(); + + /** + * + * + *
+   * The confidence of this match. Values range from 0.0 (completely uncertain)
+   * to 1.0 (completely certain).
+   * This value is for informational purpose only and is only used to help match
+   * the best intent within the classification threshold. This value may change
+   * for the same end-user expression at any time due to a model retraining or
+   * change in implementation.
+   * 
+ * + * float confidence = 5; + * + * @return The confidence. + */ + float getConfidence(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/NluSettings.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/NluSettings.java new file mode 100644 index 000000000..253a48f1f --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/NluSettings.java @@ -0,0 +1,1351 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Settings related to NLU.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.NluSettings} + */ +public final class NluSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.NluSettings) + NluSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use NluSettings.newBuilder() to construct. + private NluSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NluSettings() { + modelType_ = 0; + modelTrainingMode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NluSettings(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NluSettings( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + modelType_ = rawValue; + break; + } + case 29: + { + classificationThreshold_ = input.readFloat(); + break; + } + case 32: + { + int rawValue = input.readEnum(); + + modelTrainingMode_ = rawValue; + break; + } + case 40: + { + enableSpellCorrection_ = 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.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_NluSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_NluSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.class, + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.Builder.class); + } + + /** + * + * + *
+   * NLU model type.
+   * 
+ * + * Protobuf enum {@code google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType} + */ + public enum ModelType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. `MODEL_TYPE_STANDARD` will be used.
+     * 
+ * + * MODEL_TYPE_UNSPECIFIED = 0; + */ + MODEL_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Use standard NLU model.
+     * 
+ * + * MODEL_TYPE_STANDARD = 1; + */ + MODEL_TYPE_STANDARD(1), + /** + * + * + *
+     * Use custom NLU model.
+     * 
+ * + * MODEL_TYPE_CUSTOM = 2; + */ + MODEL_TYPE_CUSTOM(2), + /** + * + * + *
+     * Use advanced NLU model.
+     * 
+ * + * MODEL_TYPE_ADVANCED = 3; + */ + MODEL_TYPE_ADVANCED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. `MODEL_TYPE_STANDARD` will be used.
+     * 
+ * + * MODEL_TYPE_UNSPECIFIED = 0; + */ + public static final int MODEL_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Use standard NLU model.
+     * 
+ * + * MODEL_TYPE_STANDARD = 1; + */ + public static final int MODEL_TYPE_STANDARD_VALUE = 1; + /** + * + * + *
+     * Use custom NLU model.
+     * 
+ * + * MODEL_TYPE_CUSTOM = 2; + */ + public static final int MODEL_TYPE_CUSTOM_VALUE = 2; + /** + * + * + *
+     * Use advanced NLU model.
+     * 
+ * + * MODEL_TYPE_ADVANCED = 3; + */ + public static final int MODEL_TYPE_ADVANCED_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 ModelType 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 ModelType forNumber(int value) { + switch (value) { + case 0: + return MODEL_TYPE_UNSPECIFIED; + case 1: + return MODEL_TYPE_STANDARD; + case 2: + return MODEL_TYPE_CUSTOM; + case 3: + return MODEL_TYPE_ADVANCED; + 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 ModelType findValueByNumber(int number) { + return ModelType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.NluSettings.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ModelType[] VALUES = values(); + + public static ModelType 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 ModelType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType) + } + + /** + * + * + *
+   * NLU model training mode.
+   * 
+ * + * Protobuf enum {@code google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode} + */ + public enum ModelTrainingMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. `MODEL_TRAINING_MODE_AUTOMATIC` will be used.
+     * 
+ * + * MODEL_TRAINING_MODE_UNSPECIFIED = 0; + */ + MODEL_TRAINING_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * NLU model training is automatically triggered when a flow gets modified.
+     * User can also manually trigger model training in this mode.
+     * 
+ * + * MODEL_TRAINING_MODE_AUTOMATIC = 1; + */ + MODEL_TRAINING_MODE_AUTOMATIC(1), + /** + * + * + *
+     * User needs to manually trigger NLU model training. Best for large flows
+     * whose models take long time to train.
+     * 
+ * + * MODEL_TRAINING_MODE_MANUAL = 2; + */ + MODEL_TRAINING_MODE_MANUAL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. `MODEL_TRAINING_MODE_AUTOMATIC` will be used.
+     * 
+ * + * MODEL_TRAINING_MODE_UNSPECIFIED = 0; + */ + public static final int MODEL_TRAINING_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * NLU model training is automatically triggered when a flow gets modified.
+     * User can also manually trigger model training in this mode.
+     * 
+ * + * MODEL_TRAINING_MODE_AUTOMATIC = 1; + */ + public static final int MODEL_TRAINING_MODE_AUTOMATIC_VALUE = 1; + /** + * + * + *
+     * User needs to manually trigger NLU model training. Best for large flows
+     * whose models take long time to train.
+     * 
+ * + * MODEL_TRAINING_MODE_MANUAL = 2; + */ + public static final int MODEL_TRAINING_MODE_MANUAL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ModelTrainingMode 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 ModelTrainingMode forNumber(int value) { + switch (value) { + case 0: + return MODEL_TRAINING_MODE_UNSPECIFIED; + case 1: + return MODEL_TRAINING_MODE_AUTOMATIC; + case 2: + return MODEL_TRAINING_MODE_MANUAL; + 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 ModelTrainingMode findValueByNumber(int number) { + return ModelTrainingMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.NluSettings.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final ModelTrainingMode[] VALUES = values(); + + public static ModelTrainingMode 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 ModelTrainingMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode) + } + + public static final int MODEL_TYPE_FIELD_NUMBER = 1; + private int modelType_; + /** + * + * + *
+   * Indicates the type of NLU model.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType model_type = 1; + * + * @return The enum numeric value on the wire for modelType. + */ + @java.lang.Override + public int getModelTypeValue() { + return modelType_; + } + /** + * + * + *
+   * Indicates the type of NLU model.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType model_type = 1; + * + * @return The modelType. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType getModelType() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType result = + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType.valueOf(modelType_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType.UNRECOGNIZED + : result; + } + + public static final int CLASSIFICATION_THRESHOLD_FIELD_NUMBER = 3; + private float classificationThreshold_; + /** + * + * + *
+   * To filter out false positive results and still get variety in matched
+   * natural language inputs for your agent, you can tune the machine learning
+   * classification threshold. If the returned score value is less than the
+   * threshold value, then a no-match event will be triggered. The score values
+   * range from 0.0 (completely uncertain) to 1.0 (completely certain). If set
+   * to 0.0, the default of 0.3 is used.
+   * 
+ * + * float classification_threshold = 3; + * + * @return The classificationThreshold. + */ + @java.lang.Override + public float getClassificationThreshold() { + return classificationThreshold_; + } + + public static final int MODEL_TRAINING_MODE_FIELD_NUMBER = 4; + private int modelTrainingMode_; + /** + * + * + *
+   * Indicates NLU model training mode.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode model_training_mode = 4; + * + * + * @return The enum numeric value on the wire for modelTrainingMode. + */ + @java.lang.Override + public int getModelTrainingModeValue() { + return modelTrainingMode_; + } + /** + * + * + *
+   * Indicates NLU model training mode.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode model_training_mode = 4; + * + * + * @return The modelTrainingMode. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode + getModelTrainingMode() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode result = + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode.valueOf( + modelTrainingMode_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode.UNRECOGNIZED + : result; + } + + public static final int ENABLE_SPELL_CORRECTION_FIELD_NUMBER = 5; + private boolean enableSpellCorrection_; + /** + * + * + *
+   * Indicates if automatic spell correction is enabled in detect intent
+   * requests.
+   * 
+ * + * bool enable_spell_correction = 5 [deprecated = true]; + * + * @return The enableSpellCorrection. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean getEnableSpellCorrection() { + return enableSpellCorrection_; + } + + 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 (modelType_ + != com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType.MODEL_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, modelType_); + } + if (classificationThreshold_ != 0F) { + output.writeFloat(3, classificationThreshold_); + } + if (modelTrainingMode_ + != com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode + .MODEL_TRAINING_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, modelTrainingMode_); + } + if (enableSpellCorrection_ != false) { + output.writeBool(5, enableSpellCorrection_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (modelType_ + != com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType.MODEL_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, modelType_); + } + if (classificationThreshold_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, classificationThreshold_); + } + if (modelTrainingMode_ + != com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode + .MODEL_TRAINING_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, modelTrainingMode_); + } + if (enableSpellCorrection_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, enableSpellCorrection_); + } + 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.dialogflow.cx.v3beta1.NluSettings)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.NluSettings other = + (com.google.cloud.dialogflow.cx.v3beta1.NluSettings) obj; + + if (modelType_ != other.modelType_) return false; + if (java.lang.Float.floatToIntBits(getClassificationThreshold()) + != java.lang.Float.floatToIntBits(other.getClassificationThreshold())) return false; + if (modelTrainingMode_ != other.modelTrainingMode_) return false; + if (getEnableSpellCorrection() != other.getEnableSpellCorrection()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MODEL_TYPE_FIELD_NUMBER; + hash = (53 * hash) + modelType_; + hash = (37 * hash) + CLASSIFICATION_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getClassificationThreshold()); + hash = (37 * hash) + MODEL_TRAINING_MODE_FIELD_NUMBER; + hash = (53 * hash) + modelTrainingMode_; + hash = (37 * hash) + ENABLE_SPELL_CORRECTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableSpellCorrection()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.NluSettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.NluSettings 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.dialogflow.cx.v3beta1.NluSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.NluSettings 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.dialogflow.cx.v3beta1.NluSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.NluSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.NluSettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.NluSettings 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.dialogflow.cx.v3beta1.NluSettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.NluSettings 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.dialogflow.cx.v3beta1.NluSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.NluSettings 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.dialogflow.cx.v3beta1.NluSettings 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; + } + /** + * + * + *
+   * Settings related to NLU.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.NluSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.NluSettings) + com.google.cloud.dialogflow.cx.v3beta1.NluSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_NluSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_NluSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.class, + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.NluSettings.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(); + modelType_ = 0; + + classificationThreshold_ = 0F; + + modelTrainingMode_ = 0; + + enableSpellCorrection_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_NluSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.NluSettings getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.NluSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.NluSettings build() { + com.google.cloud.dialogflow.cx.v3beta1.NluSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.NluSettings buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.NluSettings result = + new com.google.cloud.dialogflow.cx.v3beta1.NluSettings(this); + result.modelType_ = modelType_; + result.classificationThreshold_ = classificationThreshold_; + result.modelTrainingMode_ = modelTrainingMode_; + result.enableSpellCorrection_ = enableSpellCorrection_; + 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.dialogflow.cx.v3beta1.NluSettings) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.NluSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.NluSettings other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.NluSettings.getDefaultInstance()) + return this; + if (other.modelType_ != 0) { + setModelTypeValue(other.getModelTypeValue()); + } + if (other.getClassificationThreshold() != 0F) { + setClassificationThreshold(other.getClassificationThreshold()); + } + if (other.modelTrainingMode_ != 0) { + setModelTrainingModeValue(other.getModelTrainingModeValue()); + } + if (other.getEnableSpellCorrection() != false) { + setEnableSpellCorrection(other.getEnableSpellCorrection()); + } + 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.dialogflow.cx.v3beta1.NluSettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.NluSettings) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int modelType_ = 0; + /** + * + * + *
+     * Indicates the type of NLU model.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType model_type = 1; + * + * @return The enum numeric value on the wire for modelType. + */ + @java.lang.Override + public int getModelTypeValue() { + return modelType_; + } + /** + * + * + *
+     * Indicates the type of NLU model.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType model_type = 1; + * + * @param value The enum numeric value on the wire for modelType to set. + * @return This builder for chaining. + */ + public Builder setModelTypeValue(int value) { + + modelType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates the type of NLU model.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType model_type = 1; + * + * @return The modelType. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType getModelType() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType result = + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType.valueOf(modelType_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Indicates the type of NLU model.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType model_type = 1; + * + * @param value The modelType to set. + * @return This builder for chaining. + */ + public Builder setModelType( + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType value) { + if (value == null) { + throw new NullPointerException(); + } + + modelType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates the type of NLU model.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType model_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearModelType() { + + modelType_ = 0; + onChanged(); + return this; + } + + private float classificationThreshold_; + /** + * + * + *
+     * To filter out false positive results and still get variety in matched
+     * natural language inputs for your agent, you can tune the machine learning
+     * classification threshold. If the returned score value is less than the
+     * threshold value, then a no-match event will be triggered. The score values
+     * range from 0.0 (completely uncertain) to 1.0 (completely certain). If set
+     * to 0.0, the default of 0.3 is used.
+     * 
+ * + * float classification_threshold = 3; + * + * @return The classificationThreshold. + */ + @java.lang.Override + public float getClassificationThreshold() { + return classificationThreshold_; + } + /** + * + * + *
+     * To filter out false positive results and still get variety in matched
+     * natural language inputs for your agent, you can tune the machine learning
+     * classification threshold. If the returned score value is less than the
+     * threshold value, then a no-match event will be triggered. The score values
+     * range from 0.0 (completely uncertain) to 1.0 (completely certain). If set
+     * to 0.0, the default of 0.3 is used.
+     * 
+ * + * float classification_threshold = 3; + * + * @param value The classificationThreshold to set. + * @return This builder for chaining. + */ + public Builder setClassificationThreshold(float value) { + + classificationThreshold_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * To filter out false positive results and still get variety in matched
+     * natural language inputs for your agent, you can tune the machine learning
+     * classification threshold. If the returned score value is less than the
+     * threshold value, then a no-match event will be triggered. The score values
+     * range from 0.0 (completely uncertain) to 1.0 (completely certain). If set
+     * to 0.0, the default of 0.3 is used.
+     * 
+ * + * float classification_threshold = 3; + * + * @return This builder for chaining. + */ + public Builder clearClassificationThreshold() { + + classificationThreshold_ = 0F; + onChanged(); + return this; + } + + private int modelTrainingMode_ = 0; + /** + * + * + *
+     * Indicates NLU model training mode.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode model_training_mode = 4; + * + * + * @return The enum numeric value on the wire for modelTrainingMode. + */ + @java.lang.Override + public int getModelTrainingModeValue() { + return modelTrainingMode_; + } + /** + * + * + *
+     * Indicates NLU model training mode.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode model_training_mode = 4; + * + * + * @param value The enum numeric value on the wire for modelTrainingMode to set. + * @return This builder for chaining. + */ + public Builder setModelTrainingModeValue(int value) { + + modelTrainingMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates NLU model training mode.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode model_training_mode = 4; + * + * + * @return The modelTrainingMode. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode + getModelTrainingMode() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode result = + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode.valueOf( + modelTrainingMode_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Indicates NLU model training mode.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode model_training_mode = 4; + * + * + * @param value The modelTrainingMode to set. + * @return This builder for chaining. + */ + public Builder setModelTrainingMode( + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode value) { + if (value == null) { + throw new NullPointerException(); + } + + modelTrainingMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates NLU model training mode.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode model_training_mode = 4; + * + * + * @return This builder for chaining. + */ + public Builder clearModelTrainingMode() { + + modelTrainingMode_ = 0; + onChanged(); + return this; + } + + private boolean enableSpellCorrection_; + /** + * + * + *
+     * Indicates if automatic spell correction is enabled in detect intent
+     * requests.
+     * 
+ * + * bool enable_spell_correction = 5 [deprecated = true]; + * + * @return The enableSpellCorrection. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean getEnableSpellCorrection() { + return enableSpellCorrection_; + } + /** + * + * + *
+     * Indicates if automatic spell correction is enabled in detect intent
+     * requests.
+     * 
+ * + * bool enable_spell_correction = 5 [deprecated = true]; + * + * @param value The enableSpellCorrection to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setEnableSpellCorrection(boolean value) { + + enableSpellCorrection_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates if automatic spell correction is enabled in detect intent
+     * requests.
+     * 
+ * + * bool enable_spell_correction = 5 [deprecated = true]; + * + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearEnableSpellCorrection() { + + enableSpellCorrection_ = 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.dialogflow.cx.v3beta1.NluSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.NluSettings) + private static final com.google.cloud.dialogflow.cx.v3beta1.NluSettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.NluSettings(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.NluSettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NluSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NluSettings(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.dialogflow.cx.v3beta1.NluSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/NluSettingsOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/NluSettingsOrBuilder.java new file mode 100644 index 000000000..108a24e7f --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/NluSettingsOrBuilder.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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface NluSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.NluSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Indicates the type of NLU model.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType model_type = 1; + * + * @return The enum numeric value on the wire for modelType. + */ + int getModelTypeValue(); + /** + * + * + *
+   * Indicates the type of NLU model.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType model_type = 1; + * + * @return The modelType. + */ + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelType getModelType(); + + /** + * + * + *
+   * To filter out false positive results and still get variety in matched
+   * natural language inputs for your agent, you can tune the machine learning
+   * classification threshold. If the returned score value is less than the
+   * threshold value, then a no-match event will be triggered. The score values
+   * range from 0.0 (completely uncertain) to 1.0 (completely certain). If set
+   * to 0.0, the default of 0.3 is used.
+   * 
+ * + * float classification_threshold = 3; + * + * @return The classificationThreshold. + */ + float getClassificationThreshold(); + + /** + * + * + *
+   * Indicates NLU model training mode.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode model_training_mode = 4; + * + * + * @return The enum numeric value on the wire for modelTrainingMode. + */ + int getModelTrainingModeValue(); + /** + * + * + *
+   * Indicates NLU model training mode.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode model_training_mode = 4; + * + * + * @return The modelTrainingMode. + */ + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.ModelTrainingMode getModelTrainingMode(); + + /** + * + * + *
+   * Indicates if automatic spell correction is enabled in detect intent
+   * requests.
+   * 
+ * + * bool enable_spell_correction = 5 [deprecated = true]; + * + * @return The enableSpellCorrection. + */ + @java.lang.Deprecated + boolean getEnableSpellCorrection(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/OutputAudioConfig.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/OutputAudioConfig.java new file mode 100644 index 000000000..6b1a530f2 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/OutputAudioConfig.java @@ -0,0 +1,1048 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Instructs the speech synthesizer how to generate the output audio content.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig} + */ +public final class OutputAudioConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig) + OutputAudioConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use OutputAudioConfig.newBuilder() to construct. + private OutputAudioConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OutputAudioConfig() { + audioEncoding_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OutputAudioConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OutputAudioConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + audioEncoding_ = rawValue; + break; + } + case 16: + { + sampleRateHertz_ = input.readInt32(); + break; + } + case 26: + { + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.Builder subBuilder = + null; + if (synthesizeSpeechConfig_ != null) { + subBuilder = synthesizeSpeechConfig_.toBuilder(); + } + synthesizeSpeechConfig_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(synthesizeSpeechConfig_); + synthesizeSpeechConfig_ = 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.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_OutputAudioConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_OutputAudioConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.class, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder.class); + } + + public static final int AUDIO_ENCODING_FIELD_NUMBER = 1; + private int audioEncoding_; + /** + * + * + *
+   * Required. Audio encoding of the synthesized audio content.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for audioEncoding. + */ + @java.lang.Override + public int getAudioEncodingValue() { + return audioEncoding_; + } + /** + * + * + *
+   * Required. Audio encoding of the synthesized audio content.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The audioEncoding. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding getAudioEncoding() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding result = + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding.valueOf(audioEncoding_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding.UNRECOGNIZED + : result; + } + + public static final int SAMPLE_RATE_HERTZ_FIELD_NUMBER = 2; + private int sampleRateHertz_; + /** + * + * + *
+   * Optional. The synthesis sample rate (in hertz) for this audio. If not
+   * provided, then the synthesizer will use the default sample rate based on
+   * the audio encoding. If this is different from the voice's natural sample
+   * rate, then the synthesizer will honor this request by converting to the
+   * desired sample rate (which might result in worse audio quality).
+   * 
+ * + * int32 sample_rate_hertz = 2; + * + * @return The sampleRateHertz. + */ + @java.lang.Override + public int getSampleRateHertz() { + return sampleRateHertz_; + } + + public static final int SYNTHESIZE_SPEECH_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesizeSpeechConfig_; + /** + * + * + *
+   * Optional. Configuration of how speech should be synthesized.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + * + * @return Whether the synthesizeSpeechConfig field is set. + */ + @java.lang.Override + public boolean hasSynthesizeSpeechConfig() { + return synthesizeSpeechConfig_ != null; + } + /** + * + * + *
+   * Optional. Configuration of how speech should be synthesized.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + * + * @return The synthesizeSpeechConfig. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig getSynthesizeSpeechConfig() { + return synthesizeSpeechConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.getDefaultInstance() + : synthesizeSpeechConfig_; + } + /** + * + * + *
+   * Optional. Configuration of how speech should be synthesized.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfigOrBuilder + getSynthesizeSpeechConfigOrBuilder() { + return getSynthesizeSpeechConfig(); + } + + 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 (audioEncoding_ + != com.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding + .OUTPUT_AUDIO_ENCODING_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, audioEncoding_); + } + if (sampleRateHertz_ != 0) { + output.writeInt32(2, sampleRateHertz_); + } + if (synthesizeSpeechConfig_ != null) { + output.writeMessage(3, getSynthesizeSpeechConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (audioEncoding_ + != com.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding + .OUTPUT_AUDIO_ENCODING_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, audioEncoding_); + } + if (sampleRateHertz_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, sampleRateHertz_); + } + if (synthesizeSpeechConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSynthesizeSpeechConfig()); + } + 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.dialogflow.cx.v3beta1.OutputAudioConfig)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig other = + (com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig) obj; + + if (audioEncoding_ != other.audioEncoding_) return false; + if (getSampleRateHertz() != other.getSampleRateHertz()) return false; + if (hasSynthesizeSpeechConfig() != other.hasSynthesizeSpeechConfig()) return false; + if (hasSynthesizeSpeechConfig()) { + if (!getSynthesizeSpeechConfig().equals(other.getSynthesizeSpeechConfig())) 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) + AUDIO_ENCODING_FIELD_NUMBER; + hash = (53 * hash) + audioEncoding_; + hash = (37 * hash) + SAMPLE_RATE_HERTZ_FIELD_NUMBER; + hash = (53 * hash) + getSampleRateHertz(); + if (hasSynthesizeSpeechConfig()) { + hash = (37 * hash) + SYNTHESIZE_SPEECH_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSynthesizeSpeechConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig 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.dialogflow.cx.v3beta1.OutputAudioConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig 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.dialogflow.cx.v3beta1.OutputAudioConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig 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.dialogflow.cx.v3beta1.OutputAudioConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig 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.dialogflow.cx.v3beta1.OutputAudioConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig 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.dialogflow.cx.v3beta1.OutputAudioConfig 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; + } + /** + * + * + *
+   * Instructs the speech synthesizer how to generate the output audio content.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig) + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_OutputAudioConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_OutputAudioConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.class, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.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(); + audioEncoding_ = 0; + + sampleRateHertz_ = 0; + + if (synthesizeSpeechConfigBuilder_ == null) { + synthesizeSpeechConfig_ = null; + } else { + synthesizeSpeechConfig_ = null; + synthesizeSpeechConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_OutputAudioConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig build() { + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig result = + new com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig(this); + result.audioEncoding_ = audioEncoding_; + result.sampleRateHertz_ = sampleRateHertz_; + if (synthesizeSpeechConfigBuilder_ == null) { + result.synthesizeSpeechConfig_ = synthesizeSpeechConfig_; + } else { + result.synthesizeSpeechConfig_ = synthesizeSpeechConfigBuilder_.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.dialogflow.cx.v3beta1.OutputAudioConfig) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance()) + return this; + if (other.audioEncoding_ != 0) { + setAudioEncodingValue(other.getAudioEncodingValue()); + } + if (other.getSampleRateHertz() != 0) { + setSampleRateHertz(other.getSampleRateHertz()); + } + if (other.hasSynthesizeSpeechConfig()) { + mergeSynthesizeSpeechConfig(other.getSynthesizeSpeechConfig()); + } + 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.dialogflow.cx.v3beta1.OutputAudioConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int audioEncoding_ = 0; + /** + * + * + *
+     * Required. Audio encoding of the synthesized audio content.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for audioEncoding. + */ + @java.lang.Override + public int getAudioEncodingValue() { + return audioEncoding_; + } + /** + * + * + *
+     * Required. Audio encoding of the synthesized audio content.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for audioEncoding to set. + * @return This builder for chaining. + */ + public Builder setAudioEncodingValue(int value) { + + audioEncoding_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Audio encoding of the synthesized audio content.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The audioEncoding. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding getAudioEncoding() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding result = + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding.valueOf(audioEncoding_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. Audio encoding of the synthesized audio content.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The audioEncoding to set. + * @return This builder for chaining. + */ + public Builder setAudioEncoding( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding value) { + if (value == null) { + throw new NullPointerException(); + } + + audioEncoding_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Audio encoding of the synthesized audio content.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearAudioEncoding() { + + audioEncoding_ = 0; + onChanged(); + return this; + } + + private int sampleRateHertz_; + /** + * + * + *
+     * Optional. The synthesis sample rate (in hertz) for this audio. If not
+     * provided, then the synthesizer will use the default sample rate based on
+     * the audio encoding. If this is different from the voice's natural sample
+     * rate, then the synthesizer will honor this request by converting to the
+     * desired sample rate (which might result in worse audio quality).
+     * 
+ * + * int32 sample_rate_hertz = 2; + * + * @return The sampleRateHertz. + */ + @java.lang.Override + public int getSampleRateHertz() { + return sampleRateHertz_; + } + /** + * + * + *
+     * Optional. The synthesis sample rate (in hertz) for this audio. If not
+     * provided, then the synthesizer will use the default sample rate based on
+     * the audio encoding. If this is different from the voice's natural sample
+     * rate, then the synthesizer will honor this request by converting to the
+     * desired sample rate (which might result in worse audio quality).
+     * 
+ * + * int32 sample_rate_hertz = 2; + * + * @param value The sampleRateHertz to set. + * @return This builder for chaining. + */ + public Builder setSampleRateHertz(int value) { + + sampleRateHertz_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The synthesis sample rate (in hertz) for this audio. If not
+     * provided, then the synthesizer will use the default sample rate based on
+     * the audio encoding. If this is different from the voice's natural sample
+     * rate, then the synthesizer will honor this request by converting to the
+     * desired sample rate (which might result in worse audio quality).
+     * 
+ * + * int32 sample_rate_hertz = 2; + * + * @return This builder for chaining. + */ + public Builder clearSampleRateHertz() { + + sampleRateHertz_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesizeSpeechConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig, + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfigOrBuilder> + synthesizeSpeechConfigBuilder_; + /** + * + * + *
+     * Optional. Configuration of how speech should be synthesized.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + * + * @return Whether the synthesizeSpeechConfig field is set. + */ + public boolean hasSynthesizeSpeechConfig() { + return synthesizeSpeechConfigBuilder_ != null || synthesizeSpeechConfig_ != null; + } + /** + * + * + *
+     * Optional. Configuration of how speech should be synthesized.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + * + * @return The synthesizeSpeechConfig. + */ + public com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + getSynthesizeSpeechConfig() { + if (synthesizeSpeechConfigBuilder_ == null) { + return synthesizeSpeechConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.getDefaultInstance() + : synthesizeSpeechConfig_; + } else { + return synthesizeSpeechConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Configuration of how speech should be synthesized.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + */ + public Builder setSynthesizeSpeechConfig( + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig value) { + if (synthesizeSpeechConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + synthesizeSpeechConfig_ = value; + onChanged(); + } else { + synthesizeSpeechConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Configuration of how speech should be synthesized.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + */ + public Builder setSynthesizeSpeechConfig( + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.Builder builderForValue) { + if (synthesizeSpeechConfigBuilder_ == null) { + synthesizeSpeechConfig_ = builderForValue.build(); + onChanged(); + } else { + synthesizeSpeechConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Configuration of how speech should be synthesized.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + */ + public Builder mergeSynthesizeSpeechConfig( + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig value) { + if (synthesizeSpeechConfigBuilder_ == null) { + if (synthesizeSpeechConfig_ != null) { + synthesizeSpeechConfig_ = + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.newBuilder( + synthesizeSpeechConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + synthesizeSpeechConfig_ = value; + } + onChanged(); + } else { + synthesizeSpeechConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Configuration of how speech should be synthesized.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + */ + public Builder clearSynthesizeSpeechConfig() { + if (synthesizeSpeechConfigBuilder_ == null) { + synthesizeSpeechConfig_ = null; + onChanged(); + } else { + synthesizeSpeechConfig_ = null; + synthesizeSpeechConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Configuration of how speech should be synthesized.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.Builder + getSynthesizeSpeechConfigBuilder() { + + onChanged(); + return getSynthesizeSpeechConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Configuration of how speech should be synthesized.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfigOrBuilder + getSynthesizeSpeechConfigOrBuilder() { + if (synthesizeSpeechConfigBuilder_ != null) { + return synthesizeSpeechConfigBuilder_.getMessageOrBuilder(); + } else { + return synthesizeSpeechConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.getDefaultInstance() + : synthesizeSpeechConfig_; + } + } + /** + * + * + *
+     * Optional. Configuration of how speech should be synthesized.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig, + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfigOrBuilder> + getSynthesizeSpeechConfigFieldBuilder() { + if (synthesizeSpeechConfigBuilder_ == null) { + synthesizeSpeechConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig, + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfigOrBuilder>( + getSynthesizeSpeechConfig(), getParentForChildren(), isClean()); + synthesizeSpeechConfig_ = null; + } + return synthesizeSpeechConfigBuilder_; + } + + @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.dialogflow.cx.v3beta1.OutputAudioConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig) + private static final com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OutputAudioConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OutputAudioConfig(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.dialogflow.cx.v3beta1.OutputAudioConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/OutputAudioConfigOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/OutputAudioConfigOrBuilder.java new file mode 100644 index 000000000..5a2e3a4bc --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/OutputAudioConfigOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface OutputAudioConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Audio encoding of the synthesized audio content.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for audioEncoding. + */ + int getAudioEncodingValue(); + /** + * + * + *
+   * Required. Audio encoding of the synthesized audio content.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The audioEncoding. + */ + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding getAudioEncoding(); + + /** + * + * + *
+   * Optional. The synthesis sample rate (in hertz) for this audio. If not
+   * provided, then the synthesizer will use the default sample rate based on
+   * the audio encoding. If this is different from the voice's natural sample
+   * rate, then the synthesizer will honor this request by converting to the
+   * desired sample rate (which might result in worse audio quality).
+   * 
+ * + * int32 sample_rate_hertz = 2; + * + * @return The sampleRateHertz. + */ + int getSampleRateHertz(); + + /** + * + * + *
+   * Optional. Configuration of how speech should be synthesized.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + * + * @return Whether the synthesizeSpeechConfig field is set. + */ + boolean hasSynthesizeSpeechConfig(); + /** + * + * + *
+   * Optional. Configuration of how speech should be synthesized.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + * + * @return The synthesizeSpeechConfig. + */ + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig getSynthesizeSpeechConfig(); + /** + * + * + *
+   * Optional. Configuration of how speech should be synthesized.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig synthesize_speech_config = 3; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfigOrBuilder + getSynthesizeSpeechConfigOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/OutputAudioEncoding.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/OutputAudioEncoding.java new file mode 100644 index 000000000..b3c918f2d --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/OutputAudioEncoding.java @@ -0,0 +1,255 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Audio encoding of the output audio format in Text-To-Speech.
+ * 
+ * + * Protobuf enum {@code google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding} + */ +public enum OutputAudioEncoding implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Not specified.
+   * 
+ * + * OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0; + */ + OUTPUT_AUDIO_ENCODING_UNSPECIFIED(0), + /** + * + * + *
+   * Uncompressed 16-bit signed little-endian samples (Linear PCM).
+   * Audio content returned as LINEAR16 also contains a WAV header.
+   * 
+ * + * OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1; + */ + OUTPUT_AUDIO_ENCODING_LINEAR_16(1), + /** + * + * + *
+   * MP3 audio at 32kbps.
+   * 
+ * + * OUTPUT_AUDIO_ENCODING_MP3 = 2; + */ + OUTPUT_AUDIO_ENCODING_MP3(2), + /** + * + * + *
+   * MP3 audio at 64kbps.
+   * 
+ * + * OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4; + */ + OUTPUT_AUDIO_ENCODING_MP3_64_KBPS(4), + /** + * + * + *
+   * Opus encoded audio wrapped in an ogg container. The result will be a
+   * file which can be played natively on Android, and in browsers (at least
+   * Chrome and Firefox). The quality of the encoding is considerably higher
+   * than MP3 while using approximately the same bitrate.
+   * 
+ * + * OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3; + */ + OUTPUT_AUDIO_ENCODING_OGG_OPUS(3), + /** + * + * + *
+   * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
+   * 
+ * + * OUTPUT_AUDIO_ENCODING_MULAW = 5; + */ + OUTPUT_AUDIO_ENCODING_MULAW(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Not specified.
+   * 
+ * + * OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0; + */ + public static final int OUTPUT_AUDIO_ENCODING_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Uncompressed 16-bit signed little-endian samples (Linear PCM).
+   * Audio content returned as LINEAR16 also contains a WAV header.
+   * 
+ * + * OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1; + */ + public static final int OUTPUT_AUDIO_ENCODING_LINEAR_16_VALUE = 1; + /** + * + * + *
+   * MP3 audio at 32kbps.
+   * 
+ * + * OUTPUT_AUDIO_ENCODING_MP3 = 2; + */ + public static final int OUTPUT_AUDIO_ENCODING_MP3_VALUE = 2; + /** + * + * + *
+   * MP3 audio at 64kbps.
+   * 
+ * + * OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4; + */ + public static final int OUTPUT_AUDIO_ENCODING_MP3_64_KBPS_VALUE = 4; + /** + * + * + *
+   * Opus encoded audio wrapped in an ogg container. The result will be a
+   * file which can be played natively on Android, and in browsers (at least
+   * Chrome and Firefox). The quality of the encoding is considerably higher
+   * than MP3 while using approximately the same bitrate.
+   * 
+ * + * OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3; + */ + public static final int OUTPUT_AUDIO_ENCODING_OGG_OPUS_VALUE = 3; + /** + * + * + *
+   * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
+   * 
+ * + * OUTPUT_AUDIO_ENCODING_MULAW = 5; + */ + public static final int OUTPUT_AUDIO_ENCODING_MULAW_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @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 OutputAudioEncoding 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 OutputAudioEncoding forNumber(int value) { + switch (value) { + case 0: + return OUTPUT_AUDIO_ENCODING_UNSPECIFIED; + case 1: + return OUTPUT_AUDIO_ENCODING_LINEAR_16; + case 2: + return OUTPUT_AUDIO_ENCODING_MP3; + case 4: + return OUTPUT_AUDIO_ENCODING_MP3_64_KBPS; + case 3: + return OUTPUT_AUDIO_ENCODING_OGG_OPUS; + case 5: + return OUTPUT_AUDIO_ENCODING_MULAW; + 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 OutputAudioEncoding findValueByNumber(int number) { + return OutputAudioEncoding.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto.getDescriptor() + .getEnumTypes() + .get(3); + } + + private static final OutputAudioEncoding[] VALUES = values(); + + public static OutputAudioEncoding 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 OutputAudioEncoding(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Page.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Page.java new file mode 100644 index 000000000..4cb13bdd4 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Page.java @@ -0,0 +1,3107 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * A Dialogflow CX conversation (session) can be described and visualized as a
+ * state machine. The states of a CX session are represented by pages.
+ * For each flow, you define many pages, where your combined pages can handle a
+ * complete conversation on the topics the flow is designed for. At any given
+ * moment, exactly one page is the current page, the current page is considered
+ * active, and the flow associated with that page is considered active. Every
+ * flow has a special start page. When a flow initially becomes active, the
+ * start page page becomes the current page. For each conversational turn, the
+ * current page will either stay the same or transition to another page.
+ * You configure each page to collect information from the end-user that is
+ * relevant for the conversational state represented by the page.
+ * For more information, see the
+ * [Page guide](https://cloud.google.com/dialogflow/cx/docs/concept/page).
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Page} + */ +public final class Page extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Page) + PageOrBuilder { + private static final long serialVersionUID = 0L; + // Use Page.newBuilder() to construct. + private Page(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Page() { + name_ = ""; + displayName_ = ""; + transitionRouteGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; + transitionRoutes_ = java.util.Collections.emptyList(); + eventHandlers_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Page(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Page( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 34: + { + com.google.cloud.dialogflow.cx.v3beta1.Form.Builder subBuilder = null; + if (form_ != null) { + subBuilder = form_.toBuilder(); + } + form_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Form.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(form_); + form_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder subBuilder = null; + if (entryFulfillment_ != null) { + subBuilder = entryFulfillment_.toBuilder(); + } + entryFulfillment_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(entryFulfillment_); + entryFulfillment_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + transitionRoutes_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute>(); + mutable_bitField0_ |= 0x00000002; + } + transitionRoutes_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.parser(), + extensionRegistry)); + break; + } + case 82: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + eventHandlers_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + eventHandlers_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.parser(), + extensionRegistry)); + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + transitionRouteGroups_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + transitionRouteGroups_.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_ & 0x00000002) != 0)) { + transitionRoutes_ = java.util.Collections.unmodifiableList(transitionRoutes_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + eventHandlers_ = java.util.Collections.unmodifiableList(eventHandlers_); + } + if (((mutable_bitField0_ & 0x00000001) != 0)) { + transitionRouteGroups_ = transitionRouteGroups_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Page_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Page_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Page.class, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The unique identifier of the page.
+   * Required for the [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage] method. [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage]
+   * populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The unique identifier of the page.
+   * Required for the [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage] method. [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage]
+   * populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required. The human-readable name of the page, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The human-readable name of the page, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTRY_FULFILLMENT_FIELD_NUMBER = 7; + private com.google.cloud.dialogflow.cx.v3beta1.Fulfillment entryFulfillment_; + /** + * + * + *
+   * The fulfillment to call when the session is entering the page.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + * + * @return Whether the entryFulfillment field is set. + */ + @java.lang.Override + public boolean hasEntryFulfillment() { + return entryFulfillment_ != null; + } + /** + * + * + *
+   * The fulfillment to call when the session is entering the page.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + * + * @return The entryFulfillment. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment getEntryFulfillment() { + return entryFulfillment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.getDefaultInstance() + : entryFulfillment_; + } + /** + * + * + *
+   * The fulfillment to call when the session is entering the page.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder + getEntryFulfillmentOrBuilder() { + return getEntryFulfillment(); + } + + public static final int FORM_FIELD_NUMBER = 4; + private com.google.cloud.dialogflow.cx.v3beta1.Form form_; + /** + * + * + *
+   * The form associated with the page, used for collecting parameters
+   * relevant to the page.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + * + * @return Whether the form field is set. + */ + @java.lang.Override + public boolean hasForm() { + return form_ != null; + } + /** + * + * + *
+   * The form associated with the page, used for collecting parameters
+   * relevant to the page.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + * + * @return The form. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Form getForm() { + return form_ == null ? com.google.cloud.dialogflow.cx.v3beta1.Form.getDefaultInstance() : form_; + } + /** + * + * + *
+   * The form associated with the page, used for collecting parameters
+   * relevant to the page.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.FormOrBuilder getFormOrBuilder() { + return getForm(); + } + + public static final int TRANSITION_ROUTE_GROUPS_FIELD_NUMBER = 11; + private com.google.protobuf.LazyStringList transitionRouteGroups_; + /** + * + * + *
+   * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+   * with the page. Transition route groups must be unique within a page.
+   * *   If multiple transition routes within a page scope refer to the same
+   *     intent, then the precedence order is: page's transition route -> page's
+   *     transition route group -> flow's transition routes.
+   * *   If multiple transition route groups within a page contain the same
+   *     intent, then the first group in the ordered list takes precedence.
+   * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+   * 
+ * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @return A list containing the transitionRouteGroups. + */ + public com.google.protobuf.ProtocolStringList getTransitionRouteGroupsList() { + return transitionRouteGroups_; + } + /** + * + * + *
+   * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+   * with the page. Transition route groups must be unique within a page.
+   * *   If multiple transition routes within a page scope refer to the same
+   *     intent, then the precedence order is: page's transition route -> page's
+   *     transition route group -> flow's transition routes.
+   * *   If multiple transition route groups within a page contain the same
+   *     intent, then the first group in the ordered list takes precedence.
+   * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+   * 
+ * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @return The count of transitionRouteGroups. + */ + public int getTransitionRouteGroupsCount() { + return transitionRouteGroups_.size(); + } + /** + * + * + *
+   * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+   * with the page. Transition route groups must be unique within a page.
+   * *   If multiple transition routes within a page scope refer to the same
+   *     intent, then the precedence order is: page's transition route -> page's
+   *     transition route group -> flow's transition routes.
+   * *   If multiple transition route groups within a page contain the same
+   *     intent, then the first group in the ordered list takes precedence.
+   * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+   * 
+ * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The transitionRouteGroups at the given index. + */ + public java.lang.String getTransitionRouteGroups(int index) { + return transitionRouteGroups_.get(index); + } + /** + * + * + *
+   * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+   * with the page. Transition route groups must be unique within a page.
+   * *   If multiple transition routes within a page scope refer to the same
+   *     intent, then the precedence order is: page's transition route -> page's
+   *     transition route group -> flow's transition routes.
+   * *   If multiple transition route groups within a page contain the same
+   *     intent, then the first group in the ordered list takes precedence.
+   * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+   * 
+ * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the transitionRouteGroups at the given index. + */ + public com.google.protobuf.ByteString getTransitionRouteGroupsBytes(int index) { + return transitionRouteGroups_.getByteString(index); + } + + public static final int TRANSITION_ROUTES_FIELD_NUMBER = 9; + private java.util.List transitionRoutes_; + /** + * + * + *
+   * A list of transitions for the transition rules of this page.
+   * They route the conversation to another page in the same flow, or another
+   * flow.
+   * When we are in a certain page, the TransitionRoutes are evalauted in the
+   * following order:
+   * *   TransitionRoutes defined in the page with intent specified.
+   * *   TransitionRoutes defined in the
+   * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+   * *   TransitionRoutes defined in flow with intent specified.
+   * *   TransitionRoutes defined in the page with only condition specified.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + @java.lang.Override + public java.util.List + getTransitionRoutesList() { + return transitionRoutes_; + } + /** + * + * + *
+   * A list of transitions for the transition rules of this page.
+   * They route the conversation to another page in the same flow, or another
+   * flow.
+   * When we are in a certain page, the TransitionRoutes are evalauted in the
+   * following order:
+   * *   TransitionRoutes defined in the page with intent specified.
+   * *   TransitionRoutes defined in the
+   * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+   * *   TransitionRoutes defined in flow with intent specified.
+   * *   TransitionRoutes defined in the page with only condition specified.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + @java.lang.Override + public java.util.List + getTransitionRoutesOrBuilderList() { + return transitionRoutes_; + } + /** + * + * + *
+   * A list of transitions for the transition rules of this page.
+   * They route the conversation to another page in the same flow, or another
+   * flow.
+   * When we are in a certain page, the TransitionRoutes are evalauted in the
+   * following order:
+   * *   TransitionRoutes defined in the page with intent specified.
+   * *   TransitionRoutes defined in the
+   * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+   * *   TransitionRoutes defined in flow with intent specified.
+   * *   TransitionRoutes defined in the page with only condition specified.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + @java.lang.Override + public int getTransitionRoutesCount() { + return transitionRoutes_.size(); + } + /** + * + * + *
+   * A list of transitions for the transition rules of this page.
+   * They route the conversation to another page in the same flow, or another
+   * flow.
+   * When we are in a certain page, the TransitionRoutes are evalauted in the
+   * following order:
+   * *   TransitionRoutes defined in the page with intent specified.
+   * *   TransitionRoutes defined in the
+   * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+   * *   TransitionRoutes defined in flow with intent specified.
+   * *   TransitionRoutes defined in the page with only condition specified.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute getTransitionRoutes(int index) { + return transitionRoutes_.get(index); + } + /** + * + * + *
+   * A list of transitions for the transition rules of this page.
+   * They route the conversation to another page in the same flow, or another
+   * flow.
+   * When we are in a certain page, the TransitionRoutes are evalauted in the
+   * following order:
+   * *   TransitionRoutes defined in the page with intent specified.
+   * *   TransitionRoutes defined in the
+   * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+   * *   TransitionRoutes defined in flow with intent specified.
+   * *   TransitionRoutes defined in the page with only condition specified.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder + getTransitionRoutesOrBuilder(int index) { + return transitionRoutes_.get(index); + } + + public static final int EVENT_HANDLERS_FIELD_NUMBER = 10; + private java.util.List eventHandlers_; + /** + * + * + *
+   * Handlers associated with the page to handle events such as webhook errors,
+   * no match or no input.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + @java.lang.Override + public java.util.List + getEventHandlersList() { + return eventHandlers_; + } + /** + * + * + *
+   * Handlers associated with the page to handle events such as webhook errors,
+   * no match or no input.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + @java.lang.Override + public java.util.List + getEventHandlersOrBuilderList() { + return eventHandlers_; + } + /** + * + * + *
+   * Handlers associated with the page to handle events such as webhook errors,
+   * no match or no input.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + @java.lang.Override + public int getEventHandlersCount() { + return eventHandlers_.size(); + } + /** + * + * + *
+   * Handlers associated with the page to handle events such as webhook errors,
+   * no match or no input.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler getEventHandlers(int index) { + return eventHandlers_.get(index); + } + /** + * + * + *
+   * Handlers associated with the page to handle events such as webhook errors,
+   * no match or no input.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder getEventHandlersOrBuilder( + int index) { + return eventHandlers_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (form_ != null) { + output.writeMessage(4, getForm()); + } + if (entryFulfillment_ != null) { + output.writeMessage(7, getEntryFulfillment()); + } + for (int i = 0; i < transitionRoutes_.size(); i++) { + output.writeMessage(9, transitionRoutes_.get(i)); + } + for (int i = 0; i < eventHandlers_.size(); i++) { + output.writeMessage(10, eventHandlers_.get(i)); + } + for (int i = 0; i < transitionRouteGroups_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 11, transitionRouteGroups_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (form_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getForm()); + } + if (entryFulfillment_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getEntryFulfillment()); + } + for (int i = 0; i < transitionRoutes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, transitionRoutes_.get(i)); + } + for (int i = 0; i < eventHandlers_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, eventHandlers_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < transitionRouteGroups_.size(); i++) { + dataSize += computeStringSizeNoTag(transitionRouteGroups_.getRaw(i)); + } + size += dataSize; + size += 1 * getTransitionRouteGroupsList().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.dialogflow.cx.v3beta1.Page)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Page other = + (com.google.cloud.dialogflow.cx.v3beta1.Page) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasEntryFulfillment() != other.hasEntryFulfillment()) return false; + if (hasEntryFulfillment()) { + if (!getEntryFulfillment().equals(other.getEntryFulfillment())) return false; + } + if (hasForm() != other.hasForm()) return false; + if (hasForm()) { + if (!getForm().equals(other.getForm())) return false; + } + if (!getTransitionRouteGroupsList().equals(other.getTransitionRouteGroupsList())) return false; + if (!getTransitionRoutesList().equals(other.getTransitionRoutesList())) return false; + if (!getEventHandlersList().equals(other.getEventHandlersList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (hasEntryFulfillment()) { + hash = (37 * hash) + ENTRY_FULFILLMENT_FIELD_NUMBER; + hash = (53 * hash) + getEntryFulfillment().hashCode(); + } + if (hasForm()) { + hash = (37 * hash) + FORM_FIELD_NUMBER; + hash = (53 * hash) + getForm().hashCode(); + } + if (getTransitionRouteGroupsCount() > 0) { + hash = (37 * hash) + TRANSITION_ROUTE_GROUPS_FIELD_NUMBER; + hash = (53 * hash) + getTransitionRouteGroupsList().hashCode(); + } + if (getTransitionRoutesCount() > 0) { + hash = (37 * hash) + TRANSITION_ROUTES_FIELD_NUMBER; + hash = (53 * hash) + getTransitionRoutesList().hashCode(); + } + if (getEventHandlersCount() > 0) { + hash = (37 * hash) + EVENT_HANDLERS_FIELD_NUMBER; + hash = (53 * hash) + getEventHandlersList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Page parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Page 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.dialogflow.cx.v3beta1.Page parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Page 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.dialogflow.cx.v3beta1.Page parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Page parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Page parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Page 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.dialogflow.cx.v3beta1.Page parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Page 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.dialogflow.cx.v3beta1.Page parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Page 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.dialogflow.cx.v3beta1.Page 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 Dialogflow CX conversation (session) can be described and visualized as a
+   * state machine. The states of a CX session are represented by pages.
+   * For each flow, you define many pages, where your combined pages can handle a
+   * complete conversation on the topics the flow is designed for. At any given
+   * moment, exactly one page is the current page, the current page is considered
+   * active, and the flow associated with that page is considered active. Every
+   * flow has a special start page. When a flow initially becomes active, the
+   * start page page becomes the current page. For each conversational turn, the
+   * current page will either stay the same or transition to another page.
+   * You configure each page to collect information from the end-user that is
+   * relevant for the conversational state represented by the page.
+   * For more information, see the
+   * [Page guide](https://cloud.google.com/dialogflow/cx/docs/concept/page).
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Page} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Page) + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Page_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Page_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Page.class, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.Page.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTransitionRoutesFieldBuilder(); + getEventHandlersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + if (entryFulfillmentBuilder_ == null) { + entryFulfillment_ = null; + } else { + entryFulfillment_ = null; + entryFulfillmentBuilder_ = null; + } + if (formBuilder_ == null) { + form_ = null; + } else { + form_ = null; + formBuilder_ = null; + } + transitionRouteGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (transitionRoutesBuilder_ == null) { + transitionRoutes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + transitionRoutesBuilder_.clear(); + } + if (eventHandlersBuilder_ == null) { + eventHandlers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + eventHandlersBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Page_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Page getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Page build() { + com.google.cloud.dialogflow.cx.v3beta1.Page result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Page buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Page result = + new com.google.cloud.dialogflow.cx.v3beta1.Page(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + if (entryFulfillmentBuilder_ == null) { + result.entryFulfillment_ = entryFulfillment_; + } else { + result.entryFulfillment_ = entryFulfillmentBuilder_.build(); + } + if (formBuilder_ == null) { + result.form_ = form_; + } else { + result.form_ = formBuilder_.build(); + } + if (((bitField0_ & 0x00000001) != 0)) { + transitionRouteGroups_ = transitionRouteGroups_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.transitionRouteGroups_ = transitionRouteGroups_; + if (transitionRoutesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + transitionRoutes_ = java.util.Collections.unmodifiableList(transitionRoutes_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.transitionRoutes_ = transitionRoutes_; + } else { + result.transitionRoutes_ = transitionRoutesBuilder_.build(); + } + if (eventHandlersBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + eventHandlers_ = java.util.Collections.unmodifiableList(eventHandlers_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.eventHandlers_ = eventHandlers_; + } else { + result.eventHandlers_ = eventHandlersBuilder_.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.dialogflow.cx.v3beta1.Page) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.Page) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Page other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.hasEntryFulfillment()) { + mergeEntryFulfillment(other.getEntryFulfillment()); + } + if (other.hasForm()) { + mergeForm(other.getForm()); + } + if (!other.transitionRouteGroups_.isEmpty()) { + if (transitionRouteGroups_.isEmpty()) { + transitionRouteGroups_ = other.transitionRouteGroups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTransitionRouteGroupsIsMutable(); + transitionRouteGroups_.addAll(other.transitionRouteGroups_); + } + onChanged(); + } + if (transitionRoutesBuilder_ == null) { + if (!other.transitionRoutes_.isEmpty()) { + if (transitionRoutes_.isEmpty()) { + transitionRoutes_ = other.transitionRoutes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.addAll(other.transitionRoutes_); + } + onChanged(); + } + } else { + if (!other.transitionRoutes_.isEmpty()) { + if (transitionRoutesBuilder_.isEmpty()) { + transitionRoutesBuilder_.dispose(); + transitionRoutesBuilder_ = null; + transitionRoutes_ = other.transitionRoutes_; + bitField0_ = (bitField0_ & ~0x00000002); + transitionRoutesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTransitionRoutesFieldBuilder() + : null; + } else { + transitionRoutesBuilder_.addAllMessages(other.transitionRoutes_); + } + } + } + if (eventHandlersBuilder_ == null) { + if (!other.eventHandlers_.isEmpty()) { + if (eventHandlers_.isEmpty()) { + eventHandlers_ = other.eventHandlers_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureEventHandlersIsMutable(); + eventHandlers_.addAll(other.eventHandlers_); + } + onChanged(); + } + } else { + if (!other.eventHandlers_.isEmpty()) { + if (eventHandlersBuilder_.isEmpty()) { + eventHandlersBuilder_.dispose(); + eventHandlersBuilder_ = null; + eventHandlers_ = other.eventHandlers_; + bitField0_ = (bitField0_ & ~0x00000004); + eventHandlersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEventHandlersFieldBuilder() + : null; + } else { + eventHandlersBuilder_.addAllMessages(other.eventHandlers_); + } + } + } + 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.dialogflow.cx.v3beta1.Page parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.dialogflow.cx.v3beta1.Page) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The unique identifier of the page.
+     * Required for the [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage] method. [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unique identifier of the page.
+     * Required for the [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage] method. [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unique identifier of the page.
+     * Required for the [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage] method. [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the page.
+     * Required for the [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage] method. [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the page.
+     * Required for the [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage] method. [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage]
+     * populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The human-readable name of the page, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the page, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the page, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the page, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the page, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Fulfillment entryFulfillment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder> + entryFulfillmentBuilder_; + /** + * + * + *
+     * The fulfillment to call when the session is entering the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + * + * @return Whether the entryFulfillment field is set. + */ + public boolean hasEntryFulfillment() { + return entryFulfillmentBuilder_ != null || entryFulfillment_ != null; + } + /** + * + * + *
+     * The fulfillment to call when the session is entering the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + * + * @return The entryFulfillment. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment getEntryFulfillment() { + if (entryFulfillmentBuilder_ == null) { + return entryFulfillment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.getDefaultInstance() + : entryFulfillment_; + } else { + return entryFulfillmentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fulfillment to call when the session is entering the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + */ + public Builder setEntryFulfillment(com.google.cloud.dialogflow.cx.v3beta1.Fulfillment value) { + if (entryFulfillmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + entryFulfillment_ = value; + onChanged(); + } else { + entryFulfillmentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fulfillment to call when the session is entering the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + */ + public Builder setEntryFulfillment( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder builderForValue) { + if (entryFulfillmentBuilder_ == null) { + entryFulfillment_ = builderForValue.build(); + onChanged(); + } else { + entryFulfillmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fulfillment to call when the session is entering the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + */ + public Builder mergeEntryFulfillment(com.google.cloud.dialogflow.cx.v3beta1.Fulfillment value) { + if (entryFulfillmentBuilder_ == null) { + if (entryFulfillment_ != null) { + entryFulfillment_ = + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.newBuilder(entryFulfillment_) + .mergeFrom(value) + .buildPartial(); + } else { + entryFulfillment_ = value; + } + onChanged(); + } else { + entryFulfillmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fulfillment to call when the session is entering the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + */ + public Builder clearEntryFulfillment() { + if (entryFulfillmentBuilder_ == null) { + entryFulfillment_ = null; + onChanged(); + } else { + entryFulfillment_ = null; + entryFulfillmentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fulfillment to call when the session is entering the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder getEntryFulfillmentBuilder() { + + onChanged(); + return getEntryFulfillmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fulfillment to call when the session is entering the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + */ + public com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder + getEntryFulfillmentOrBuilder() { + if (entryFulfillmentBuilder_ != null) { + return entryFulfillmentBuilder_.getMessageOrBuilder(); + } else { + return entryFulfillment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.getDefaultInstance() + : entryFulfillment_; + } + } + /** + * + * + *
+     * The fulfillment to call when the session is entering the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder> + getEntryFulfillmentFieldBuilder() { + if (entryFulfillmentBuilder_ == null) { + entryFulfillmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder>( + getEntryFulfillment(), getParentForChildren(), isClean()); + entryFulfillment_ = null; + } + return entryFulfillmentBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Form form_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Form, + com.google.cloud.dialogflow.cx.v3beta1.Form.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FormOrBuilder> + formBuilder_; + /** + * + * + *
+     * The form associated with the page, used for collecting parameters
+     * relevant to the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + * + * @return Whether the form field is set. + */ + public boolean hasForm() { + return formBuilder_ != null || form_ != null; + } + /** + * + * + *
+     * The form associated with the page, used for collecting parameters
+     * relevant to the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + * + * @return The form. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Form getForm() { + if (formBuilder_ == null) { + return form_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Form.getDefaultInstance() + : form_; + } else { + return formBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The form associated with the page, used for collecting parameters
+     * relevant to the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + */ + public Builder setForm(com.google.cloud.dialogflow.cx.v3beta1.Form value) { + if (formBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + form_ = value; + onChanged(); + } else { + formBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The form associated with the page, used for collecting parameters
+     * relevant to the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + */ + public Builder setForm(com.google.cloud.dialogflow.cx.v3beta1.Form.Builder builderForValue) { + if (formBuilder_ == null) { + form_ = builderForValue.build(); + onChanged(); + } else { + formBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The form associated with the page, used for collecting parameters
+     * relevant to the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + */ + public Builder mergeForm(com.google.cloud.dialogflow.cx.v3beta1.Form value) { + if (formBuilder_ == null) { + if (form_ != null) { + form_ = + com.google.cloud.dialogflow.cx.v3beta1.Form.newBuilder(form_) + .mergeFrom(value) + .buildPartial(); + } else { + form_ = value; + } + onChanged(); + } else { + formBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The form associated with the page, used for collecting parameters
+     * relevant to the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + */ + public Builder clearForm() { + if (formBuilder_ == null) { + form_ = null; + onChanged(); + } else { + form_ = null; + formBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The form associated with the page, used for collecting parameters
+     * relevant to the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Form.Builder getFormBuilder() { + + onChanged(); + return getFormFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The form associated with the page, used for collecting parameters
+     * relevant to the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.FormOrBuilder getFormOrBuilder() { + if (formBuilder_ != null) { + return formBuilder_.getMessageOrBuilder(); + } else { + return form_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Form.getDefaultInstance() + : form_; + } + } + /** + * + * + *
+     * The form associated with the page, used for collecting parameters
+     * relevant to the page.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Form, + com.google.cloud.dialogflow.cx.v3beta1.Form.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FormOrBuilder> + getFormFieldBuilder() { + if (formBuilder_ == null) { + formBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Form, + com.google.cloud.dialogflow.cx.v3beta1.Form.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FormOrBuilder>( + getForm(), getParentForChildren(), isClean()); + form_ = null; + } + return formBuilder_; + } + + private com.google.protobuf.LazyStringList transitionRouteGroups_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTransitionRouteGroupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + transitionRouteGroups_ = + new com.google.protobuf.LazyStringArrayList(transitionRouteGroups_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+     * with the page. Transition route groups must be unique within a page.
+     * *   If multiple transition routes within a page scope refer to the same
+     *     intent, then the precedence order is: page's transition route -> page's
+     *     transition route group -> flow's transition routes.
+     * *   If multiple transition route groups within a page contain the same
+     *     intent, then the first group in the ordered list takes precedence.
+     * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+     * 
+ * + * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @return A list containing the transitionRouteGroups. + */ + public com.google.protobuf.ProtocolStringList getTransitionRouteGroupsList() { + return transitionRouteGroups_.getUnmodifiableView(); + } + /** + * + * + *
+     * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+     * with the page. Transition route groups must be unique within a page.
+     * *   If multiple transition routes within a page scope refer to the same
+     *     intent, then the precedence order is: page's transition route -> page's
+     *     transition route group -> flow's transition routes.
+     * *   If multiple transition route groups within a page contain the same
+     *     intent, then the first group in the ordered list takes precedence.
+     * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+     * 
+ * + * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @return The count of transitionRouteGroups. + */ + public int getTransitionRouteGroupsCount() { + return transitionRouteGroups_.size(); + } + /** + * + * + *
+     * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+     * with the page. Transition route groups must be unique within a page.
+     * *   If multiple transition routes within a page scope refer to the same
+     *     intent, then the precedence order is: page's transition route -> page's
+     *     transition route group -> flow's transition routes.
+     * *   If multiple transition route groups within a page contain the same
+     *     intent, then the first group in the ordered list takes precedence.
+     * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+     * 
+ * + * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The transitionRouteGroups at the given index. + */ + public java.lang.String getTransitionRouteGroups(int index) { + return transitionRouteGroups_.get(index); + } + /** + * + * + *
+     * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+     * with the page. Transition route groups must be unique within a page.
+     * *   If multiple transition routes within a page scope refer to the same
+     *     intent, then the precedence order is: page's transition route -> page's
+     *     transition route group -> flow's transition routes.
+     * *   If multiple transition route groups within a page contain the same
+     *     intent, then the first group in the ordered list takes precedence.
+     * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+     * 
+ * + * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the transitionRouteGroups at the given index. + */ + public com.google.protobuf.ByteString getTransitionRouteGroupsBytes(int index) { + return transitionRouteGroups_.getByteString(index); + } + /** + * + * + *
+     * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+     * with the page. Transition route groups must be unique within a page.
+     * *   If multiple transition routes within a page scope refer to the same
+     *     intent, then the precedence order is: page's transition route -> page's
+     *     transition route group -> flow's transition routes.
+     * *   If multiple transition route groups within a page contain the same
+     *     intent, then the first group in the ordered list takes precedence.
+     * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+     * 
+ * + * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The transitionRouteGroups to set. + * @return This builder for chaining. + */ + public Builder setTransitionRouteGroups(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionRouteGroupsIsMutable(); + transitionRouteGroups_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+     * with the page. Transition route groups must be unique within a page.
+     * *   If multiple transition routes within a page scope refer to the same
+     *     intent, then the precedence order is: page's transition route -> page's
+     *     transition route group -> flow's transition routes.
+     * *   If multiple transition route groups within a page contain the same
+     *     intent, then the first group in the ordered list takes precedence.
+     * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+     * 
+ * + * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @param value The transitionRouteGroups to add. + * @return This builder for chaining. + */ + public Builder addTransitionRouteGroups(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionRouteGroupsIsMutable(); + transitionRouteGroups_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+     * with the page. Transition route groups must be unique within a page.
+     * *   If multiple transition routes within a page scope refer to the same
+     *     intent, then the precedence order is: page's transition route -> page's
+     *     transition route group -> flow's transition routes.
+     * *   If multiple transition route groups within a page contain the same
+     *     intent, then the first group in the ordered list takes precedence.
+     * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+     * 
+ * + * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @param values The transitionRouteGroups to add. + * @return This builder for chaining. + */ + public Builder addAllTransitionRouteGroups(java.lang.Iterable values) { + ensureTransitionRouteGroupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, transitionRouteGroups_); + onChanged(); + return this; + } + /** + * + * + *
+     * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+     * with the page. Transition route groups must be unique within a page.
+     * *   If multiple transition routes within a page scope refer to the same
+     *     intent, then the precedence order is: page's transition route -> page's
+     *     transition route group -> flow's transition routes.
+     * *   If multiple transition route groups within a page contain the same
+     *     intent, then the first group in the ordered list takes precedence.
+     * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+     * 
+ * + * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearTransitionRouteGroups() { + transitionRouteGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+     * with the page. Transition route groups must be unique within a page.
+     * *   If multiple transition routes within a page scope refer to the same
+     *     intent, then the precedence order is: page's transition route -> page's
+     *     transition route group -> flow's transition routes.
+     * *   If multiple transition route groups within a page contain the same
+     *     intent, then the first group in the ordered list takes precedence.
+     * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+     * 
+ * + * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the transitionRouteGroups to add. + * @return This builder for chaining. + */ + public Builder addTransitionRouteGroupsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTransitionRouteGroupsIsMutable(); + transitionRouteGroups_.add(value); + onChanged(); + return this; + } + + private java.util.List + transitionRoutes_ = java.util.Collections.emptyList(); + + private void ensureTransitionRoutesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + transitionRoutes_ = + new java.util.ArrayList( + transitionRoutes_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder> + transitionRoutesBuilder_; + + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public java.util.List + getTransitionRoutesList() { + if (transitionRoutesBuilder_ == null) { + return java.util.Collections.unmodifiableList(transitionRoutes_); + } else { + return transitionRoutesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public int getTransitionRoutesCount() { + if (transitionRoutesBuilder_ == null) { + return transitionRoutes_.size(); + } else { + return transitionRoutesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute getTransitionRoutes(int index) { + if (transitionRoutesBuilder_ == null) { + return transitionRoutes_.get(index); + } else { + return transitionRoutesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public Builder setTransitionRoutes( + int index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute value) { + if (transitionRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionRoutesIsMutable(); + transitionRoutes_.set(index, value); + onChanged(); + } else { + transitionRoutesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public Builder setTransitionRoutes( + int index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder builderForValue) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.set(index, builderForValue.build()); + onChanged(); + } else { + transitionRoutesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public Builder addTransitionRoutes( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute value) { + if (transitionRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionRoutesIsMutable(); + transitionRoutes_.add(value); + onChanged(); + } else { + transitionRoutesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public Builder addTransitionRoutes( + int index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute value) { + if (transitionRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionRoutesIsMutable(); + transitionRoutes_.add(index, value); + onChanged(); + } else { + transitionRoutesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public Builder addTransitionRoutes( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder builderForValue) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.add(builderForValue.build()); + onChanged(); + } else { + transitionRoutesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public Builder addTransitionRoutes( + int index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder builderForValue) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.add(index, builderForValue.build()); + onChanged(); + } else { + transitionRoutesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public Builder addAllTransitionRoutes( + java.lang.Iterable + values) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, transitionRoutes_); + onChanged(); + } else { + transitionRoutesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public Builder clearTransitionRoutes() { + if (transitionRoutesBuilder_ == null) { + transitionRoutes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + transitionRoutesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public Builder removeTransitionRoutes(int index) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.remove(index); + onChanged(); + } else { + transitionRoutesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder + getTransitionRoutesBuilder(int index) { + return getTransitionRoutesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder + getTransitionRoutesOrBuilder(int index) { + if (transitionRoutesBuilder_ == null) { + return transitionRoutes_.get(index); + } else { + return transitionRoutesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public java.util.List + getTransitionRoutesOrBuilderList() { + if (transitionRoutesBuilder_ != null) { + return transitionRoutesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(transitionRoutes_); + } + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder + addTransitionRoutesBuilder() { + return getTransitionRoutesFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.getDefaultInstance()); + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder + addTransitionRoutesBuilder(int index) { + return getTransitionRoutesFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.getDefaultInstance()); + } + /** + * + * + *
+     * A list of transitions for the transition rules of this page.
+     * They route the conversation to another page in the same flow, or another
+     * flow.
+     * When we are in a certain page, the TransitionRoutes are evalauted in the
+     * following order:
+     * *   TransitionRoutes defined in the page with intent specified.
+     * *   TransitionRoutes defined in the
+     * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+     * *   TransitionRoutes defined in flow with intent specified.
+     * *   TransitionRoutes defined in the page with only condition specified.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + public java.util.List + getTransitionRoutesBuilderList() { + return getTransitionRoutesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder> + getTransitionRoutesFieldBuilder() { + if (transitionRoutesBuilder_ == null) { + transitionRoutesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder>( + transitionRoutes_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + transitionRoutes_ = null; + } + return transitionRoutesBuilder_; + } + + private java.util.List eventHandlers_ = + java.util.Collections.emptyList(); + + private void ensureEventHandlersIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + eventHandlers_ = + new java.util.ArrayList( + eventHandlers_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EventHandler, + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder> + eventHandlersBuilder_; + + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public java.util.List + getEventHandlersList() { + if (eventHandlersBuilder_ == null) { + return java.util.Collections.unmodifiableList(eventHandlers_); + } else { + return eventHandlersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public int getEventHandlersCount() { + if (eventHandlersBuilder_ == null) { + return eventHandlers_.size(); + } else { + return eventHandlersBuilder_.getCount(); + } + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler getEventHandlers(int index) { + if (eventHandlersBuilder_ == null) { + return eventHandlers_.get(index); + } else { + return eventHandlersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder setEventHandlers( + int index, com.google.cloud.dialogflow.cx.v3beta1.EventHandler value) { + if (eventHandlersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventHandlersIsMutable(); + eventHandlers_.set(index, value); + onChanged(); + } else { + eventHandlersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder setEventHandlers( + int index, com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder builderForValue) { + if (eventHandlersBuilder_ == null) { + ensureEventHandlersIsMutable(); + eventHandlers_.set(index, builderForValue.build()); + onChanged(); + } else { + eventHandlersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder addEventHandlers(com.google.cloud.dialogflow.cx.v3beta1.EventHandler value) { + if (eventHandlersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventHandlersIsMutable(); + eventHandlers_.add(value); + onChanged(); + } else { + eventHandlersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder addEventHandlers( + int index, com.google.cloud.dialogflow.cx.v3beta1.EventHandler value) { + if (eventHandlersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventHandlersIsMutable(); + eventHandlers_.add(index, value); + onChanged(); + } else { + eventHandlersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder addEventHandlers( + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder builderForValue) { + if (eventHandlersBuilder_ == null) { + ensureEventHandlersIsMutable(); + eventHandlers_.add(builderForValue.build()); + onChanged(); + } else { + eventHandlersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder addEventHandlers( + int index, com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder builderForValue) { + if (eventHandlersBuilder_ == null) { + ensureEventHandlersIsMutable(); + eventHandlers_.add(index, builderForValue.build()); + onChanged(); + } else { + eventHandlersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder addAllEventHandlers( + java.lang.Iterable values) { + if (eventHandlersBuilder_ == null) { + ensureEventHandlersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, eventHandlers_); + onChanged(); + } else { + eventHandlersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder clearEventHandlers() { + if (eventHandlersBuilder_ == null) { + eventHandlers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + eventHandlersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public Builder removeEventHandlers(int index) { + if (eventHandlersBuilder_ == null) { + ensureEventHandlersIsMutable(); + eventHandlers_.remove(index); + onChanged(); + } else { + eventHandlersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder getEventHandlersBuilder( + int index) { + return getEventHandlersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder getEventHandlersOrBuilder( + int index) { + if (eventHandlersBuilder_ == null) { + return eventHandlers_.get(index); + } else { + return eventHandlersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public java.util.List + getEventHandlersOrBuilderList() { + if (eventHandlersBuilder_ != null) { + return eventHandlersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(eventHandlers_); + } + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder addEventHandlersBuilder() { + return getEventHandlersFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.EventHandler.getDefaultInstance()); + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder addEventHandlersBuilder( + int index) { + return getEventHandlersFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.EventHandler.getDefaultInstance()); + } + /** + * + * + *
+     * Handlers associated with the page to handle events such as webhook errors,
+     * no match or no input.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + public java.util.List + getEventHandlersBuilderList() { + return getEventHandlersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EventHandler, + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder> + getEventHandlersFieldBuilder() { + if (eventHandlersBuilder_ == null) { + eventHandlersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EventHandler, + com.google.cloud.dialogflow.cx.v3beta1.EventHandler.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder>( + eventHandlers_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + eventHandlers_ = null; + } + return eventHandlersBuilder_; + } + + @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.dialogflow.cx.v3beta1.Page) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Page) + private static final com.google.cloud.dialogflow.cx.v3beta1.Page DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Page(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Page getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Page parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Page(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.dialogflow.cx.v3beta1.Page getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageInfo.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageInfo.java new file mode 100644 index 000000000..6283429c9 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageInfo.java @@ -0,0 +1,3809 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Represents page information communicated to and from the webhook.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.PageInfo} + */ +public final class PageInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.PageInfo) + PageInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use PageInfo.newBuilder() to construct. + private PageInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PageInfo() { + currentPage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PageInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PageInfo( + 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(); + + currentPage_ = s; + break; + } + case 26: + { + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.Builder subBuilder = null; + if (formInfo_ != null) { + subBuilder = formInfo_.toBuilder(); + } + formInfo_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(formInfo_); + formInfo_ = 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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.class, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder.class); + } + + public interface FormInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The parameters contained in the form. Note that the webhook cannot add
+     * or remove any form parameter.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + java.util.List + getParameterInfoList(); + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The parameters contained in the form. Note that the webhook cannot add
+     * or remove any form parameter.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo getParameterInfo( + int index); + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The parameters contained in the form. Note that the webhook cannot add
+     * or remove any form parameter.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + int getParameterInfoCount(); + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The parameters contained in the form. Note that the webhook cannot add
+     * or remove any form parameter.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfoOrBuilder> + getParameterInfoOrBuilderList(); + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The parameters contained in the form. Note that the webhook cannot add
+     * or remove any form parameter.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfoOrBuilder + getParameterInfoOrBuilder(int index); + } + /** + * + * + *
+   * Represents form information.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo} + */ + public static final class FormInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo) + FormInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use FormInfo.newBuilder() to construct. + private FormInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FormInfo() { + parameterInfo_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FormInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FormInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + parameterInfo_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo>(); + mutable_bitField0_ |= 0x00000001; + } + parameterInfo_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + .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)) { + parameterInfo_ = java.util.Collections.unmodifiableList(parameterInfo_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.class, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.Builder.class); + } + + public interface ParameterInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+       * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The human-readable name of the parameter, unique within the form. This
+       * field cannot be modified by the webhook.
+       * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+       * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+       * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The human-readable name of the parameter, unique within the form. This
+       * field cannot be modified by the webhook.
+       * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * Indicates whether the parameter is required. Optional parameters will
+       * not trigger prompts; however, they are filled if the user specifies
+       * them. Required parameters must be filled before form filling concludes.
+       * 
+ * + * bool required = 2; + * + * @return The required. + */ + boolean getRequired(); + + /** + * + * + *
+       * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+       * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The state of the parameter. This field can be set
+       * to [INVALID][google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState.INVALID] by
+       * the webhook to invalidate the parameter; other values set by the
+       * webhook will be ignored.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState state = 3; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+       * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+       * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The state of the parameter. This field can be set
+       * to [INVALID][google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState.INVALID] by
+       * the webhook to invalidate the parameter; other values set by the
+       * webhook will be ignored.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState state = 3; + * + * + * @return The state. + */ + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState + getState(); + + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The value of the parameter. This field can be set by the webhook to
+       * change the parameter value.
+       * 
+ * + * .google.protobuf.Value value = 4; + * + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The value of the parameter. This field can be set by the webhook to
+       * change the parameter value.
+       * 
+ * + * .google.protobuf.Value value = 4; + * + * @return The value. + */ + com.google.protobuf.Value getValue(); + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The value of the parameter. This field can be set by the webhook to
+       * change the parameter value.
+       * 
+ * + * .google.protobuf.Value value = 4; + */ + com.google.protobuf.ValueOrBuilder getValueOrBuilder(); + + /** + * + * + *
+       * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * Indicates if the parameter value was just collected on the last
+       * conversation turn.
+       * 
+ * + * bool just_collected = 5; + * + * @return The justCollected. + */ + boolean getJustCollected(); + } + /** + * + * + *
+     * Represents parameter information.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo} + */ + public static final class ParameterInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo) + ParameterInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ParameterInfo.newBuilder() to construct. + private ParameterInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ParameterInfo() { + displayName_ = ""; + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ParameterInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ParameterInfo( + 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(); + + displayName_ = s; + break; + } + case 16: + { + required_ = input.readBool(); + break; + } + case 24: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 34: + { + com.google.protobuf.Value.Builder subBuilder = null; + if (value_ != null) { + subBuilder = value_.toBuilder(); + } + value_ = input.readMessage(com.google.protobuf.Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(value_); + value_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + justCollected_ = 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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_ParameterInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_ParameterInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.class, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.Builder + .class); + } + + /** + * + * + *
+       * Represents the state of a parameter.
+       * 
+ * + * Protobuf enum {@code + * google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState} + */ + public enum ParameterState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+         * Not specified. This value should be never used.
+         * 
+ * + * PARAMETER_STATE_UNSPECIFIED = 0; + */ + PARAMETER_STATE_UNSPECIFIED(0), + /** + * + * + *
+         * Indicates that the parameter does not have a value.
+         * 
+ * + * EMPTY = 1; + */ + EMPTY(1), + /** + * + * + *
+         * Indicates that the parameter value is invalid. This field can be used
+         * by the webhook to invalidate the parameter and ask the server to
+         * collect it from the user again.
+         * 
+ * + * INVALID = 2; + */ + INVALID(2), + /** + * + * + *
+         * Indicates that the parameter has a value.
+         * 
+ * + * FILLED = 3; + */ + FILLED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+         * Not specified. This value should be never used.
+         * 
+ * + * PARAMETER_STATE_UNSPECIFIED = 0; + */ + public static final int PARAMETER_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+         * Indicates that the parameter does not have a value.
+         * 
+ * + * EMPTY = 1; + */ + public static final int EMPTY_VALUE = 1; + /** + * + * + *
+         * Indicates that the parameter value is invalid. This field can be used
+         * by the webhook to invalidate the parameter and ask the server to
+         * collect it from the user again.
+         * 
+ * + * INVALID = 2; + */ + public static final int INVALID_VALUE = 2; + /** + * + * + *
+         * Indicates that the parameter has a value.
+         * 
+ * + * FILLED = 3; + */ + public static final int FILLED_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 ParameterState 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 ParameterState forNumber(int value) { + switch (value) { + case 0: + return PARAMETER_STATE_UNSPECIFIED; + case 1: + return EMPTY; + case 2: + return INVALID; + case 3: + return FILLED; + 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 ParameterState findValueByNumber(int number) { + return ParameterState.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ParameterState[] VALUES = values(); + + public static ParameterState 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 ParameterState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState) + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object displayName_; + /** + * + * + *
+       * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+       * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The human-readable name of the parameter, unique within the form. This
+       * field cannot be modified by the webhook.
+       * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+       * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+       * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The human-readable name of the parameter, unique within the form. This
+       * field cannot be modified by the webhook.
+       * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUIRED_FIELD_NUMBER = 2; + private boolean required_; + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * Indicates whether the parameter is required. Optional parameters will
+       * not trigger prompts; however, they are filled if the user specifies
+       * them. Required parameters must be filled before form filling concludes.
+       * 
+ * + * bool required = 2; + * + * @return The required. + */ + @java.lang.Override + public boolean getRequired() { + return required_; + } + + public static final int STATE_FIELD_NUMBER = 3; + private int state_; + /** + * + * + *
+       * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+       * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The state of the parameter. This field can be set
+       * to [INVALID][google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState.INVALID] by
+       * the webhook to invalidate the parameter; other values set by the
+       * webhook will be ignored.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState state = 3; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+       * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+       * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The state of the parameter. This field can be set
+       * to [INVALID][google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState.INVALID] by
+       * the webhook to invalidate the parameter; other values set by the
+       * webhook will be ignored.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState state = 3; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState + getState() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState + result = + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + .ParameterState.valueOf(state_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState + .UNRECOGNIZED + : result; + } + + public static final int VALUE_FIELD_NUMBER = 4; + private com.google.protobuf.Value value_; + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The value of the parameter. This field can be set by the webhook to
+       * change the parameter value.
+       * 
+ * + * .google.protobuf.Value value = 4; + * + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return value_ != null; + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The value of the parameter. This field can be set by the webhook to
+       * change the parameter value.
+       * 
+ * + * .google.protobuf.Value value = 4; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.Value getValue() { + return value_ == null ? com.google.protobuf.Value.getDefaultInstance() : value_; + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The value of the parameter. This field can be set by the webhook to
+       * change the parameter value.
+       * 
+ * + * .google.protobuf.Value value = 4; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getValueOrBuilder() { + return getValue(); + } + + public static final int JUST_COLLECTED_FIELD_NUMBER = 5; + private boolean justCollected_; + /** + * + * + *
+       * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * Indicates if the parameter value was just collected on the last
+       * conversation turn.
+       * 
+ * + * bool just_collected = 5; + * + * @return The justCollected. + */ + @java.lang.Override + public boolean getJustCollected() { + return justCollected_; + } + + 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 (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, displayName_); + } + if (required_ != false) { + output.writeBool(2, required_); + } + if (state_ + != com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState + .PARAMETER_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, state_); + } + if (value_ != null) { + output.writeMessage(4, getValue()); + } + if (justCollected_ != false) { + output.writeBool(5, justCollected_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, displayName_); + } + if (required_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, required_); + } + if (state_ + != com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState + .PARAMETER_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, state_); + } + if (value_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getValue()); + } + if (justCollected_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, justCollected_); + } + 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.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo other = + (com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo) obj; + + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (getRequired() != other.getRequired()) return false; + if (state_ != other.state_) return false; + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (!getValue().equals(other.getValue())) return false; + } + if (getJustCollected() != other.getJustCollected()) 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_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + REQUIRED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequired()); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + } + hash = (37 * hash) + JUST_COLLECTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getJustCollected()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + 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.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + 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.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + 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.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + 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.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + 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.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Represents parameter information.
+       * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo) + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_ParameterInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_ParameterInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.class, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.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(); + displayName_ = ""; + + required_ = false; + + state_ = 0; + + if (valueBuilder_ == null) { + value_ = null; + } else { + value_ = null; + valueBuilder_ = null; + } + justCollected_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_ParameterInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo build() { + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo result = + new com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo(this); + result.displayName_ = displayName_; + result.required_ = required_; + result.state_ = state_; + if (valueBuilder_ == null) { + result.value_ = value_; + } else { + result.value_ = valueBuilder_.build(); + } + result.justCollected_ = justCollected_; + 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.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + .getDefaultInstance()) return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.getRequired() != false) { + setRequired(other.getRequired()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasValue()) { + mergeValue(other.getValue()); + } + if (other.getJustCollected() != false) { + setJustCollected(other.getJustCollected()); + } + 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.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+         * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+         * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * The human-readable name of the parameter, unique within the form. This
+         * field cannot be modified by the webhook.
+         * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+         * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * The human-readable name of the parameter, unique within the form. This
+         * field cannot be modified by the webhook.
+         * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+         * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * The human-readable name of the parameter, unique within the form. This
+         * field cannot be modified by the webhook.
+         * 
+ * + * string display_name = 1; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+         * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * The human-readable name of the parameter, unique within the form. This
+         * field cannot be modified by the webhook.
+         * 
+ * + * string display_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+         * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+         * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * The human-readable name of the parameter, unique within the form. This
+         * field cannot be modified by the webhook.
+         * 
+ * + * string display_name = 1; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private boolean required_; + /** + * + * + *
+         * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * Indicates whether the parameter is required. Optional parameters will
+         * not trigger prompts; however, they are filled if the user specifies
+         * them. Required parameters must be filled before form filling concludes.
+         * 
+ * + * bool required = 2; + * + * @return The required. + */ + @java.lang.Override + public boolean getRequired() { + return required_; + } + /** + * + * + *
+         * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * Indicates whether the parameter is required. Optional parameters will
+         * not trigger prompts; however, they are filled if the user specifies
+         * them. Required parameters must be filled before form filling concludes.
+         * 
+ * + * bool required = 2; + * + * @param value The required to set. + * @return This builder for chaining. + */ + public Builder setRequired(boolean value) { + + required_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * Indicates whether the parameter is required. Optional parameters will
+         * not trigger prompts; however, they are filled if the user specifies
+         * them. Required parameters must be filled before form filling concludes.
+         * 
+ * + * bool required = 2; + * + * @return This builder for chaining. + */ + public Builder clearRequired() { + + required_ = false; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+         * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+         * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The state of the parameter. This field can be set
+         * to [INVALID][google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState.INVALID] by
+         * the webhook to invalidate the parameter; other values set by the
+         * webhook will be ignored.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState state = 3; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+         * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+         * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The state of the parameter. This field can be set
+         * to [INVALID][google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState.INVALID] by
+         * the webhook to invalidate the parameter; other values set by the
+         * webhook will be ignored.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState state = 3; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+         * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The state of the parameter. This field can be set
+         * to [INVALID][google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState.INVALID] by
+         * the webhook to invalidate the parameter; other values set by the
+         * webhook will be ignored.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState state = 3; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState + getState() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState + result = + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + .ParameterState.valueOf(state_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + .ParameterState.UNRECOGNIZED + : result; + } + /** + * + * + *
+         * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+         * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The state of the parameter. This field can be set
+         * to [INVALID][google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState.INVALID] by
+         * the webhook to invalidate the parameter; other values set by the
+         * webhook will be ignored.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState state = 3; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState + value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+         * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for
+         * [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The state of the parameter. This field can be set
+         * to [INVALID][google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState.INVALID] by
+         * the webhook to invalidate the parameter; other values set by the
+         * webhook will be ignored.
+         * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState state = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Value value_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + valueBuilder_; + /** + * + * + *
+         * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * The value of the parameter. This field can be set by the webhook to
+         * change the parameter value.
+         * 
+ * + * .google.protobuf.Value value = 4; + * + * @return Whether the value field is set. + */ + public boolean hasValue() { + return valueBuilder_ != null || value_ != null; + } + /** + * + * + *
+         * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * The value of the parameter. This field can be set by the webhook to
+         * change the parameter value.
+         * 
+ * + * .google.protobuf.Value value = 4; + * + * @return The value. + */ + public com.google.protobuf.Value getValue() { + if (valueBuilder_ == null) { + return value_ == null ? com.google.protobuf.Value.getDefaultInstance() : value_; + } else { + return valueBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * The value of the parameter. This field can be set by the webhook to
+         * change the parameter value.
+         * 
+ * + * .google.protobuf.Value value = 4; + */ + public Builder setValue(com.google.protobuf.Value value) { + if (valueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + valueBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+         * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * The value of the parameter. This field can be set by the webhook to
+         * change the parameter value.
+         * 
+ * + * .google.protobuf.Value value = 4; + */ + public Builder setValue(com.google.protobuf.Value.Builder builderForValue) { + if (valueBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + valueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+         * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * The value of the parameter. This field can be set by the webhook to
+         * change the parameter value.
+         * 
+ * + * .google.protobuf.Value value = 4; + */ + public Builder mergeValue(com.google.protobuf.Value value) { + if (valueBuilder_ == null) { + if (value_ != null) { + value_ = com.google.protobuf.Value.newBuilder(value_).mergeFrom(value).buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + valueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+         * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * The value of the parameter. This field can be set by the webhook to
+         * change the parameter value.
+         * 
+ * + * .google.protobuf.Value value = 4; + */ + public Builder clearValue() { + if (valueBuilder_ == null) { + value_ = null; + onChanged(); + } else { + value_ = null; + valueBuilder_ = null; + } + + return this; + } + /** + * + * + *
+         * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * The value of the parameter. This field can be set by the webhook to
+         * change the parameter value.
+         * 
+ * + * .google.protobuf.Value value = 4; + */ + public com.google.protobuf.Value.Builder getValueBuilder() { + + onChanged(); + return getValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * The value of the parameter. This field can be set by the webhook to
+         * change the parameter value.
+         * 
+ * + * .google.protobuf.Value value = 4; + */ + public com.google.protobuf.ValueOrBuilder getValueOrBuilder() { + if (valueBuilder_ != null) { + return valueBuilder_.getMessageOrBuilder(); + } else { + return value_ == null ? com.google.protobuf.Value.getDefaultInstance() : value_; + } + } + /** + * + * + *
+         * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * The value of the parameter. This field can be set by the webhook to
+         * change the parameter value.
+         * 
+ * + * .google.protobuf.Value value = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getValueFieldBuilder() { + if (valueBuilder_ == null) { + valueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getValue(), getParentForChildren(), isClean()); + value_ = null; + } + return valueBuilder_; + } + + private boolean justCollected_; + /** + * + * + *
+         * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * Indicates if the parameter value was just collected on the last
+         * conversation turn.
+         * 
+ * + * bool just_collected = 5; + * + * @return The justCollected. + */ + @java.lang.Override + public boolean getJustCollected() { + return justCollected_; + } + /** + * + * + *
+         * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * Indicates if the parameter value was just collected on the last
+         * conversation turn.
+         * 
+ * + * bool just_collected = 5; + * + * @param value The justCollected to set. + * @return This builder for chaining. + */ + public Builder setJustCollected(boolean value) { + + justCollected_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+         * Indicates if the parameter value was just collected on the last
+         * conversation turn.
+         * 
+ * + * bool just_collected = 5; + * + * @return This builder for chaining. + */ + public Builder clearJustCollected() { + + justCollected_ = 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.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo) + private static final com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ParameterInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ParameterInfo(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.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int PARAMETER_INFO_FIELD_NUMBER = 2; + private java.util.List + parameterInfo_; + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The parameters contained in the form. Note that the webhook cannot add
+     * or remove any form parameter.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + @java.lang.Override + public java.util.List + getParameterInfoList() { + return parameterInfo_; + } + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The parameters contained in the form. Note that the webhook cannot add
+     * or remove any form parameter.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfoOrBuilder> + getParameterInfoOrBuilderList() { + return parameterInfo_; + } + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The parameters contained in the form. Note that the webhook cannot add
+     * or remove any form parameter.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + @java.lang.Override + public int getParameterInfoCount() { + return parameterInfo_.size(); + } + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The parameters contained in the form. Note that the webhook cannot add
+     * or remove any form parameter.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo getParameterInfo( + int index) { + return parameterInfo_.get(index); + } + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The parameters contained in the form. Note that the webhook cannot add
+     * or remove any form parameter.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfoOrBuilder + getParameterInfoOrBuilder(int index) { + return parameterInfo_.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 < parameterInfo_.size(); i++) { + output.writeMessage(2, parameterInfo_.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 < parameterInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, parameterInfo_.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.dialogflow.cx.v3beta1.PageInfo.FormInfo)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo other = + (com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo) obj; + + if (!getParameterInfoList().equals(other.getParameterInfoList())) 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 (getParameterInfoCount() > 0) { + hash = (37 * hash) + PARAMETER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getParameterInfoList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo 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.dialogflow.cx.v3beta1.PageInfo.FormInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo 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.dialogflow.cx.v3beta1.PageInfo.FormInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo 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.dialogflow.cx.v3beta1.PageInfo.FormInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo 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.dialogflow.cx.v3beta1.PageInfo.FormInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo 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.dialogflow.cx.v3beta1.PageInfo.FormInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Represents form information.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo) + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.class, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getParameterInfoFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (parameterInfoBuilder_ == null) { + parameterInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + parameterInfoBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo build() { + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo result = + new com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo(this); + int from_bitField0_ = bitField0_; + if (parameterInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + parameterInfo_ = java.util.Collections.unmodifiableList(parameterInfo_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.parameterInfo_ = parameterInfo_; + } else { + result.parameterInfo_ = parameterInfoBuilder_.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.dialogflow.cx.v3beta1.PageInfo.FormInfo) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.getDefaultInstance()) + return this; + if (parameterInfoBuilder_ == null) { + if (!other.parameterInfo_.isEmpty()) { + if (parameterInfo_.isEmpty()) { + parameterInfo_ = other.parameterInfo_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureParameterInfoIsMutable(); + parameterInfo_.addAll(other.parameterInfo_); + } + onChanged(); + } + } else { + if (!other.parameterInfo_.isEmpty()) { + if (parameterInfoBuilder_.isEmpty()) { + parameterInfoBuilder_.dispose(); + parameterInfoBuilder_ = null; + parameterInfo_ = other.parameterInfo_; + bitField0_ = (bitField0_ & ~0x00000001); + parameterInfoBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getParameterInfoFieldBuilder() + : null; + } else { + parameterInfoBuilder_.addAllMessages(other.parameterInfo_); + } + } + } + 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.dialogflow.cx.v3beta1.PageInfo.FormInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + parameterInfo_ = java.util.Collections.emptyList(); + + private void ensureParameterInfoIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + parameterInfo_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo>( + parameterInfo_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfoOrBuilder> + parameterInfoBuilder_; + + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public java.util.List + getParameterInfoList() { + if (parameterInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(parameterInfo_); + } else { + return parameterInfoBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public int getParameterInfoCount() { + if (parameterInfoBuilder_ == null) { + return parameterInfo_.size(); + } else { + return parameterInfoBuilder_.getCount(); + } + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + getParameterInfo(int index) { + if (parameterInfoBuilder_ == null) { + return parameterInfo_.get(index); + } else { + return parameterInfoBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public Builder setParameterInfo( + int index, com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo value) { + if (parameterInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParameterInfoIsMutable(); + parameterInfo_.set(index, value); + onChanged(); + } else { + parameterInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public Builder setParameterInfo( + int index, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.Builder + builderForValue) { + if (parameterInfoBuilder_ == null) { + ensureParameterInfoIsMutable(); + parameterInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + parameterInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public Builder addParameterInfo( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo value) { + if (parameterInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParameterInfoIsMutable(); + parameterInfo_.add(value); + onChanged(); + } else { + parameterInfoBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public Builder addParameterInfo( + int index, com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo value) { + if (parameterInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParameterInfoIsMutable(); + parameterInfo_.add(index, value); + onChanged(); + } else { + parameterInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public Builder addParameterInfo( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.Builder + builderForValue) { + if (parameterInfoBuilder_ == null) { + ensureParameterInfoIsMutable(); + parameterInfo_.add(builderForValue.build()); + onChanged(); + } else { + parameterInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public Builder addParameterInfo( + int index, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.Builder + builderForValue) { + if (parameterInfoBuilder_ == null) { + ensureParameterInfoIsMutable(); + parameterInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + parameterInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public Builder addAllParameterInfo( + java.lang.Iterable< + ? extends com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo> + values) { + if (parameterInfoBuilder_ == null) { + ensureParameterInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, parameterInfo_); + onChanged(); + } else { + parameterInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public Builder clearParameterInfo() { + if (parameterInfoBuilder_ == null) { + parameterInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + parameterInfoBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public Builder removeParameterInfo(int index) { + if (parameterInfoBuilder_ == null) { + ensureParameterInfoIsMutable(); + parameterInfo_.remove(index); + onChanged(); + } else { + parameterInfoBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.Builder + getParameterInfoBuilder(int index) { + return getParameterInfoFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfoOrBuilder + getParameterInfoOrBuilder(int index) { + if (parameterInfoBuilder_ == null) { + return parameterInfo_.get(index); + } else { + return parameterInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfoOrBuilder> + getParameterInfoOrBuilderList() { + if (parameterInfoBuilder_ != null) { + return parameterInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(parameterInfo_); + } + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.Builder + addParameterInfoBuilder() { + return getParameterInfoFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + .getDefaultInstance()); + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.Builder + addParameterInfoBuilder(int index) { + return getParameterInfoFieldBuilder() + .addBuilder( + index, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo + .getDefaultInstance()); + } + /** + * + * + *
+       * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+       * The parameters contained in the form. Note that the webhook cannot add
+       * or remove any form parameter.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo parameter_info = 2; + * + */ + public java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.Builder> + getParameterInfoBuilderList() { + return getParameterInfoFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfoOrBuilder> + getParameterInfoFieldBuilder() { + if (parameterInfoBuilder_ == null) { + parameterInfoBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfoOrBuilder>( + parameterInfo_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + parameterInfo_ = null; + } + return parameterInfoBuilder_; + } + + @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.dialogflow.cx.v3beta1.PageInfo.FormInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo) + private static final com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FormInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FormInfo(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.dialogflow.cx.v3beta1.PageInfo.FormInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CURRENT_PAGE_FIELD_NUMBER = 1; + private volatile java.lang.Object currentPage_; + /** + * + * + *
+   * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * The unique identifier of the current page.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string current_page = 1 [(.google.api.resource_reference) = { ... } + * + * @return The currentPage. + */ + @java.lang.Override + public java.lang.String getCurrentPage() { + java.lang.Object ref = currentPage_; + 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(); + currentPage_ = s; + return s; + } + } + /** + * + * + *
+   * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * The unique identifier of the current page.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string current_page = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for currentPage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrentPageBytes() { + java.lang.Object ref = currentPage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currentPage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORM_INFO_FIELD_NUMBER = 3; + private com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo formInfo_; + /** + * + * + *
+   * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * Information about the form.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + * + * @return Whether the formInfo field is set. + */ + @java.lang.Override + public boolean hasFormInfo() { + return formInfo_ != null; + } + /** + * + * + *
+   * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * Information about the form.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + * + * @return The formInfo. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo getFormInfo() { + return formInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.getDefaultInstance() + : formInfo_; + } + /** + * + * + *
+   * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * Information about the form.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfoOrBuilder getFormInfoOrBuilder() { + return getFormInfo(); + } + + 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 (!getCurrentPageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, currentPage_); + } + if (formInfo_ != null) { + output.writeMessage(3, getFormInfo()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCurrentPageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, currentPage_); + } + if (formInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFormInfo()); + } + 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.dialogflow.cx.v3beta1.PageInfo)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.PageInfo other = + (com.google.cloud.dialogflow.cx.v3beta1.PageInfo) obj; + + if (!getCurrentPage().equals(other.getCurrentPage())) return false; + if (hasFormInfo() != other.hasFormInfo()) return false; + if (hasFormInfo()) { + if (!getFormInfo().equals(other.getFormInfo())) 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) + CURRENT_PAGE_FIELD_NUMBER; + hash = (53 * hash) + getCurrentPage().hashCode(); + if (hasFormInfo()) { + hash = (37 * hash) + FORM_INFO_FIELD_NUMBER; + hash = (53 * hash) + getFormInfo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo 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.dialogflow.cx.v3beta1.PageInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo 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.dialogflow.cx.v3beta1.PageInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo 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.dialogflow.cx.v3beta1.PageInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo 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.dialogflow.cx.v3beta1.PageInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo 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.dialogflow.cx.v3beta1.PageInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents page information communicated to and from the webhook.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.PageInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.PageInfo) + com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.class, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.PageInfo.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(); + currentPage_ = ""; + + if (formInfoBuilder_ == null) { + formInfo_ = null; + } else { + formInfo_ = null; + formInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.PageInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo build() { + com.google.cloud.dialogflow.cx.v3beta1.PageInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.PageInfo result = + new com.google.cloud.dialogflow.cx.v3beta1.PageInfo(this); + result.currentPage_ = currentPage_; + if (formInfoBuilder_ == null) { + result.formInfo_ = formInfo_; + } else { + result.formInfo_ = formInfoBuilder_.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.dialogflow.cx.v3beta1.PageInfo) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.PageInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.PageInfo other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.PageInfo.getDefaultInstance()) + return this; + if (!other.getCurrentPage().isEmpty()) { + currentPage_ = other.currentPage_; + onChanged(); + } + if (other.hasFormInfo()) { + mergeFormInfo(other.getFormInfo()); + } + 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.dialogflow.cx.v3beta1.PageInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.dialogflow.cx.v3beta1.PageInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object currentPage_ = ""; + /** + * + * + *
+     * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The unique identifier of the current page.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string current_page = 1 [(.google.api.resource_reference) = { ... } + * + * @return The currentPage. + */ + public java.lang.String getCurrentPage() { + java.lang.Object ref = currentPage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currentPage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The unique identifier of the current page.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string current_page = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for currentPage. + */ + public com.google.protobuf.ByteString getCurrentPageBytes() { + java.lang.Object ref = currentPage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currentPage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The unique identifier of the current page.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string current_page = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The currentPage to set. + * @return This builder for chaining. + */ + public Builder setCurrentPage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + currentPage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The unique identifier of the current page.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string current_page = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearCurrentPage() { + + currentPage_ = getDefaultInstance().getCurrentPage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The unique identifier of the current page.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string current_page = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for currentPage to set. + * @return This builder for chaining. + */ + public Builder setCurrentPageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + currentPage_ = value; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo formInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfoOrBuilder> + formInfoBuilder_; + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * Information about the form.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + * + * @return Whether the formInfo field is set. + */ + public boolean hasFormInfo() { + return formInfoBuilder_ != null || formInfo_ != null; + } + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * Information about the form.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + * + * @return The formInfo. + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo getFormInfo() { + if (formInfoBuilder_ == null) { + return formInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.getDefaultInstance() + : formInfo_; + } else { + return formInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * Information about the form.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + */ + public Builder setFormInfo(com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo value) { + if (formInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + formInfo_ = value; + onChanged(); + } else { + formInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * Information about the form.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + */ + public Builder setFormInfo( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.Builder builderForValue) { + if (formInfoBuilder_ == null) { + formInfo_ = builderForValue.build(); + onChanged(); + } else { + formInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * Information about the form.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + */ + public Builder mergeFormInfo(com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo value) { + if (formInfoBuilder_ == null) { + if (formInfo_ != null) { + formInfo_ = + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.newBuilder(formInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + formInfo_ = value; + } + onChanged(); + } else { + formInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * Information about the form.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + */ + public Builder clearFormInfo() { + if (formInfoBuilder_ == null) { + formInfo_ = null; + onChanged(); + } else { + formInfo_ = null; + formInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * Information about the form.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.Builder getFormInfoBuilder() { + + onChanged(); + return getFormInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * Information about the form.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfoOrBuilder + getFormInfoOrBuilder() { + if (formInfoBuilder_ != null) { + return formInfoBuilder_.getMessageOrBuilder(); + } else { + return formInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.getDefaultInstance() + : formInfo_; + } + } + /** + * + * + *
+     * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * Information about the form.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfoOrBuilder> + getFormInfoFieldBuilder() { + if (formInfoBuilder_ == null) { + formInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfoOrBuilder>( + getFormInfo(), getParentForChildren(), isClean()); + formInfo_ = null; + } + return formInfoBuilder_; + } + + @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.dialogflow.cx.v3beta1.PageInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.PageInfo) + private static final com.google.cloud.dialogflow.cx.v3beta1.PageInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.PageInfo(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.PageInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PageInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PageInfo(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.dialogflow.cx.v3beta1.PageInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageInfoOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageInfoOrBuilder.java new file mode 100644 index 000000000..a6608831f --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageInfoOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface PageInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.PageInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * The unique identifier of the current page.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string current_page = 1 [(.google.api.resource_reference) = { ... } + * + * @return The currentPage. + */ + java.lang.String getCurrentPage(); + /** + * + * + *
+   * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * The unique identifier of the current page.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string current_page = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for currentPage. + */ + com.google.protobuf.ByteString getCurrentPageBytes(); + + /** + * + * + *
+   * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * Information about the form.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + * + * @return Whether the formInfo field is set. + */ + boolean hasFormInfo(); + /** + * + * + *
+   * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * Information about the form.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + * + * @return The formInfo. + */ + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo getFormInfo(); + /** + * + * + *
+   * Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * Information about the form.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo form_info = 3; + */ + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfoOrBuilder getFormInfoOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageName.java new file mode 100644 index 000000000..1bcd0c9ad --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageName.java @@ -0,0 +1,268 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 PageName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String agent; + private final String flow; + private final String page; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getFlow() { + return flow; + } + + public String getPage() { + return page; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private PageName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + flow = Preconditions.checkNotNull(builder.getFlow()); + page = Preconditions.checkNotNull(builder.getPage()); + } + + public static PageName of( + String project, String location, String agent, String flow, String page) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setFlow(flow) + .setPage(page) + .build(); + } + + public static String format( + String project, String location, String agent, String flow, String page) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setFlow(flow) + .setPage(page) + .build() + .toString(); + } + + public static PageName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "PageName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("agent"), + matchMap.get("flow"), + matchMap.get("page")); + } + + 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 (PageName 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("agent", agent); + fieldMapBuilder.put("flow", flow); + fieldMapBuilder.put("page", page); + 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, "agent", agent, "flow", flow, "page", page); + } + + /** Builder for PageName. */ + public static class Builder { + + private String project; + private String location; + private String agent; + private String flow; + private String page; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getFlow() { + return flow; + } + + public String getPage() { + return page; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAgent(String agent) { + this.agent = agent; + return this; + } + + public Builder setFlow(String flow) { + this.flow = flow; + return this; + } + + public Builder setPage(String page) { + this.page = page; + return this; + } + + private Builder() {} + + private Builder(PageName pageName) { + project = pageName.project; + location = pageName.location; + agent = pageName.agent; + flow = pageName.flow; + page = pageName.page; + } + + public PageName build() { + return new PageName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PageName) { + PageName that = (PageName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.agent.equals(that.agent)) + && (this.flow.equals(that.flow)) + && (this.page.equals(that.page)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= agent.hashCode(); + h *= 1000003; + h ^= flow.hashCode(); + h *= 1000003; + h ^= page.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageOrBuilder.java new file mode 100644 index 000000000..9ea6020db --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageOrBuilder.java @@ -0,0 +1,403 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface PageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Page) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique identifier of the page.
+   * Required for the [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage] method. [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage]
+   * populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The unique identifier of the page.
+   * Required for the [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage] method. [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage]
+   * populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The human-readable name of the page, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The human-readable name of the page, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The fulfillment to call when the session is entering the page.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + * + * @return Whether the entryFulfillment field is set. + */ + boolean hasEntryFulfillment(); + /** + * + * + *
+   * The fulfillment to call when the session is entering the page.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + * + * @return The entryFulfillment. + */ + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment getEntryFulfillment(); + /** + * + * + *
+   * The fulfillment to call when the session is entering the page.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment entry_fulfillment = 7; + */ + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder getEntryFulfillmentOrBuilder(); + + /** + * + * + *
+   * The form associated with the page, used for collecting parameters
+   * relevant to the page.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + * + * @return Whether the form field is set. + */ + boolean hasForm(); + /** + * + * + *
+   * The form associated with the page, used for collecting parameters
+   * relevant to the page.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + * + * @return The form. + */ + com.google.cloud.dialogflow.cx.v3beta1.Form getForm(); + /** + * + * + *
+   * The form associated with the page, used for collecting parameters
+   * relevant to the page.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Form form = 4; + */ + com.google.cloud.dialogflow.cx.v3beta1.FormOrBuilder getFormOrBuilder(); + + /** + * + * + *
+   * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+   * with the page. Transition route groups must be unique within a page.
+   * *   If multiple transition routes within a page scope refer to the same
+   *     intent, then the precedence order is: page's transition route -> page's
+   *     transition route group -> flow's transition routes.
+   * *   If multiple transition route groups within a page contain the same
+   *     intent, then the first group in the ordered list takes precedence.
+   * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+   * 
+ * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @return A list containing the transitionRouteGroups. + */ + java.util.List getTransitionRouteGroupsList(); + /** + * + * + *
+   * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+   * with the page. Transition route groups must be unique within a page.
+   * *   If multiple transition routes within a page scope refer to the same
+   *     intent, then the precedence order is: page's transition route -> page's
+   *     transition route group -> flow's transition routes.
+   * *   If multiple transition route groups within a page contain the same
+   *     intent, then the first group in the ordered list takes precedence.
+   * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+   * 
+ * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @return The count of transitionRouteGroups. + */ + int getTransitionRouteGroupsCount(); + /** + * + * + *
+   * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+   * with the page. Transition route groups must be unique within a page.
+   * *   If multiple transition routes within a page scope refer to the same
+   *     intent, then the precedence order is: page's transition route -> page's
+   *     transition route group -> flow's transition routes.
+   * *   If multiple transition route groups within a page contain the same
+   *     intent, then the first group in the ordered list takes precedence.
+   * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+   * 
+ * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The transitionRouteGroups at the given index. + */ + java.lang.String getTransitionRouteGroups(int index); + /** + * + * + *
+   * Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated
+   * with the page. Transition route groups must be unique within a page.
+   * *   If multiple transition routes within a page scope refer to the same
+   *     intent, then the precedence order is: page's transition route -> page's
+   *     transition route group -> flow's transition routes.
+   * *   If multiple transition route groups within a page contain the same
+   *     intent, then the first group in the ordered list takes precedence.
+   * Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
+   * 
+ * + * repeated string transition_route_groups = 11 [(.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the transitionRouteGroups at the given index. + */ + com.google.protobuf.ByteString getTransitionRouteGroupsBytes(int index); + + /** + * + * + *
+   * A list of transitions for the transition rules of this page.
+   * They route the conversation to another page in the same flow, or another
+   * flow.
+   * When we are in a certain page, the TransitionRoutes are evalauted in the
+   * following order:
+   * *   TransitionRoutes defined in the page with intent specified.
+   * *   TransitionRoutes defined in the
+   * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+   * *   TransitionRoutes defined in flow with intent specified.
+   * *   TransitionRoutes defined in the page with only condition specified.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + java.util.List getTransitionRoutesList(); + /** + * + * + *
+   * A list of transitions for the transition rules of this page.
+   * They route the conversation to another page in the same flow, or another
+   * flow.
+   * When we are in a certain page, the TransitionRoutes are evalauted in the
+   * following order:
+   * *   TransitionRoutes defined in the page with intent specified.
+   * *   TransitionRoutes defined in the
+   * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+   * *   TransitionRoutes defined in flow with intent specified.
+   * *   TransitionRoutes defined in the page with only condition specified.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute getTransitionRoutes(int index); + /** + * + * + *
+   * A list of transitions for the transition rules of this page.
+   * They route the conversation to another page in the same flow, or another
+   * flow.
+   * When we are in a certain page, the TransitionRoutes are evalauted in the
+   * following order:
+   * *   TransitionRoutes defined in the page with intent specified.
+   * *   TransitionRoutes defined in the
+   * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+   * *   TransitionRoutes defined in flow with intent specified.
+   * *   TransitionRoutes defined in the page with only condition specified.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + int getTransitionRoutesCount(); + /** + * + * + *
+   * A list of transitions for the transition rules of this page.
+   * They route the conversation to another page in the same flow, or another
+   * flow.
+   * When we are in a certain page, the TransitionRoutes are evalauted in the
+   * following order:
+   * *   TransitionRoutes defined in the page with intent specified.
+   * *   TransitionRoutes defined in the
+   * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+   * *   TransitionRoutes defined in flow with intent specified.
+   * *   TransitionRoutes defined in the page with only condition specified.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + java.util.List + getTransitionRoutesOrBuilderList(); + /** + * + * + *
+   * A list of transitions for the transition rules of this page.
+   * They route the conversation to another page in the same flow, or another
+   * flow.
+   * When we are in a certain page, the TransitionRoutes are evalauted in the
+   * following order:
+   * *   TransitionRoutes defined in the page with intent specified.
+   * *   TransitionRoutes defined in the
+   * [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups].
+   * *   TransitionRoutes defined in flow with intent specified.
+   * *   TransitionRoutes defined in the page with only condition specified.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 9; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder getTransitionRoutesOrBuilder( + int index); + + /** + * + * + *
+   * Handlers associated with the page to handle events such as webhook errors,
+   * no match or no input.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + java.util.List getEventHandlersList(); + /** + * + * + *
+   * Handlers associated with the page to handle events such as webhook errors,
+   * no match or no input.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + com.google.cloud.dialogflow.cx.v3beta1.EventHandler getEventHandlers(int index); + /** + * + * + *
+   * Handlers associated with the page to handle events such as webhook errors,
+   * no match or no input.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + int getEventHandlersCount(); + /** + * + * + *
+   * Handlers associated with the page to handle events such as webhook errors,
+   * no match or no input.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + java.util.List + getEventHandlersOrBuilderList(); + /** + * + * + *
+   * Handlers associated with the page to handle events such as webhook errors,
+   * no match or no input.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.EventHandler event_handlers = 10; + */ + com.google.cloud.dialogflow.cx.v3beta1.EventHandlerOrBuilder getEventHandlersOrBuilder(int index); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageProto.java new file mode 100644 index 000000000..e8baeddf8 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageProto.java @@ -0,0 +1,335 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class PageProto { + private PageProto() {} + + 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_dialogflow_cx_v3beta1_Page_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Page_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_FillBehavior_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_FillBehavior_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_EventHandler_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_EventHandler_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRoute_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRoute_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_GetPageRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_GetPageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_CreatePageRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_CreatePageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdatePageRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdatePageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_DeletePageRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_DeletePageRequest_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/dialogflow/cx/v3beta1/pag" + + "e.proto\022\"google.cloud.dialogflow.cx.v3be" + + "ta1\032\034google/api/annotations.proto\032\027googl" + + "e/api/client.proto\032\037google/api/field_beh" + + "avior.proto\032\031google/api/resource.proto\0324" + + "google/cloud/dialogflow/cx/v3beta1/fulfi" + + "llment.proto\032\033google/protobuf/empty.prot" + + "o\032 google/protobuf/field_mask.proto\032\034goo" + + "gle/protobuf/struct.proto\"\232\004\n\004Page\022\014\n\004na" + + "me\030\001 \001(\t\022\031\n\014display_name\030\002 \001(\tB\003\340A\002\022J\n\021e" + + "ntry_fulfillment\030\007 \001(\0132/.google.cloud.di" + + "alogflow.cx.v3beta1.Fulfillment\0226\n\004form\030" + + "\004 \001(\0132(.google.cloud.dialogflow.cx.v3bet" + + "a1.Form\022T\n\027transition_route_groups\030\013 \003(\t" + + "B3\372A0\n.dialogflow.googleapis.com/Transit" + + "ionRouteGroup\022N\n\021transition_routes\030\t \003(\013" + + "23.google.cloud.dialogflow.cx.v3beta1.Tr" + + "ansitionRoute\022H\n\016event_handlers\030\n \003(\01320." + + "google.cloud.dialogflow.cx.v3beta1.Event" + + "Handler:u\352Ar\n\036dialogflow.googleapis.com/" + + "Page\022Pprojects/{project}/locations/{loca" + + "tion}/agents/{agent}/flows/{flow}/pages/" + + "{page}\"\247\004\n\004Form\022F\n\nparameters\030\001 \003(\01322.go" + + "ogle.cloud.dialogflow.cx.v3beta1.Form.Pa" + + "rameter\032\326\003\n\tParameter\022\031\n\014display_name\030\001 " + + "\001(\tB\003\340A\002\022\020\n\010required\030\002 \001(\010\022A\n\013entity_typ" + + "e\030\003 \001(\tB,\340A\002\372A&\n$dialogflow.googleapis.c" + + "om/EntityType\022\017\n\007is_list\030\004 \001(\010\022[\n\rfill_b" + + "ehavior\030\007 \001(\0132?.google.cloud.dialogflow." + + "cx.v3beta1.Form.Parameter.FillBehaviorB\003" + + "\340A\002\022-\n\rdefault_value\030\t \001(\0132\026.google.prot" + + "obuf.Value\032\273\001\n\014FillBehavior\022X\n\032initial_p" + + "rompt_fulfillment\030\003 \001(\0132/.google.cloud.d" + + "ialogflow.cx.v3beta1.FulfillmentB\003\340A\002\022Q\n" + + "\027reprompt_event_handlers\030\005 \003(\01320.google." + + "cloud.dialogflow.cx.v3beta1.EventHandler" + + "\"\205\002\n\014EventHandler\022\021\n\004name\030\006 \001(\tB\003\340A\003\022\022\n\005" + + "event\030\004 \001(\tB\003\340A\002\022L\n\023trigger_fulfillment\030" + + "\005 \001(\0132/.google.cloud.dialogflow.cx.v3bet" + + "a1.Fulfillment\022:\n\013target_page\030\002 \001(\tB#\372A " + + "\n\036dialogflow.googleapis.com/PageH\000\022:\n\013ta" + + "rget_flow\030\003 \001(\tB#\372A \n\036dialogflow.googlea" + + "pis.com/FlowH\000B\010\n\006target\"\276\002\n\017TransitionR" + + "oute\022\021\n\004name\030\006 \001(\tB\003\340A\003\0225\n\006intent\030\001 \001(\tB" + + "%\372A\"\n dialogflow.googleapis.com/Intent\022\021" + + "\n\tcondition\030\002 \001(\t\022L\n\023trigger_fulfillment" + + "\030\003 \001(\0132/.google.cloud.dialogflow.cx.v3be" + + "ta1.Fulfillment\022:\n\013target_page\030\004 \001(\tB#\372A" + + " \n\036dialogflow.googleapis.com/PageH\000\022:\n\013t" + + "arget_flow\030\005 \001(\tB#\372A \n\036dialogflow.google" + + "apis.com/FlowH\000B\010\n\006target\"\210\001\n\020ListPagesR" + + "equest\0226\n\006parent\030\001 \001(\tB&\340A\002\372A \022\036dialogfl" + + "ow.googleapis.com/Page\022\025\n\rlanguage_code\030" + + "\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004" + + " \001(\t\"e\n\021ListPagesResponse\0227\n\005pages\030\001 \003(\013" + + "2(.google.cloud.dialogflow.cx.v3beta1.Pa" + + "ge\022\027\n\017next_page_token\030\002 \001(\t\"]\n\016GetPageRe" + + "quest\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036dialogflow." + + "googleapis.com/Page\022\025\n\rlanguage_code\030\002 \001" + + "(\t\"\237\001\n\021CreatePageRequest\0226\n\006parent\030\001 \001(\t" + + "B&\340A\002\372A \022\036dialogflow.googleapis.com/Page" + + "\022;\n\004page\030\002 \001(\0132(.google.cloud.dialogflow" + + ".cx.v3beta1.PageB\003\340A\002\022\025\n\rlanguage_code\030\003" + + " \001(\t\"\230\001\n\021UpdatePageRequest\022;\n\004page\030\001 \001(\013" + + "2(.google.cloud.dialogflow.cx.v3beta1.Pa" + + "geB\003\340A\002\022\025\n\rlanguage_code\030\002 \001(\t\022/\n\013update" + + "_mask\030\003 \001(\0132\032.google.protobuf.FieldMask\"" + + "X\n\021DeletePageRequest\0224\n\004name\030\001 \001(\tB&\340A\002\372" + + "A \n\036dialogflow.googleapis.com/Page\022\r\n\005fo" + + "rce\030\002 \001(\0102\332\010\n\005Pages\022\312\001\n\tListPages\0224.goog" + + "le.cloud.dialogflow.cx.v3beta1.ListPages" + + "Request\0325.google.cloud.dialogflow.cx.v3b" + + "eta1.ListPagesResponse\"P\202\323\344\223\002A\022?/v3beta1" + + "/{parent=projects/*/locations/*/agents/*" + + "/flows/*}/pages\332A\006parent\022\267\001\n\007GetPage\0222.g" + + "oogle.cloud.dialogflow.cx.v3beta1.GetPag" + + "eRequest\032(.google.cloud.dialogflow.cx.v3" + + "beta1.Page\"N\202\323\344\223\002A\022?/v3beta1/{name=proje" + + "cts/*/locations/*/agents/*/flows/*/pages" + + "/*}\332A\004name\022\312\001\n\nCreatePage\0225.google.cloud" + + ".dialogflow.cx.v3beta1.CreatePageRequest" + + "\032(.google.cloud.dialogflow.cx.v3beta1.Pa" + + "ge\"[\202\323\344\223\002G\"?/v3beta1/{parent=projects/*/" + + "locations/*/agents/*/flows/*}/pages:\004pag" + + "e\332A\013parent,page\022\324\001\n\nUpdatePage\0225.google." + + "cloud.dialogflow.cx.v3beta1.UpdatePageRe" + + "quest\032(.google.cloud.dialogflow.cx.v3bet" + + "a1.Page\"e\202\323\344\223\002L2D/v3beta1/{page.name=pro" + + "jects/*/locations/*/agents/*/flows/*/pag" + + "es/*}:\004page\332A\020page,update_mask\022\253\001\n\nDelet" + + "ePage\0225.google.cloud.dialogflow.cx.v3bet" + + "a1.DeletePageRequest\032\026.google.protobuf.E" + + "mpty\"N\202\323\344\223\002A*?/v3beta1/{name=projects/*/" + + "locations/*/agents/*/flows/*/pages/*}\332A\004" + + "name\032x\312A\031dialogflow.googleapis.com\322AYhtt" + + "ps://www.googleapis.com/auth/cloud-platf" + + "orm,https://www.googleapis.com/auth/dial" + + "ogflowB\250\001\n&com.google.cloud.dialogflow.c" + + "x.v3beta1B\tPageProtoP\001ZDgoogle.golang.or" + + "g/genproto/googleapis/cloud/dialogflow/c" + + "x/v3beta1;cx\370\001\001\242\002\002DF\252\002\"Google.Cloud.Dial" + + "ogflow.Cx.V3Beta1b\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.api.ResourceProto.getDescriptor(), + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Page_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Page_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Page_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "EntryFulfillment", + "Form", + "TransitionRouteGroups", + "TransitionRoutes", + "EventHandlers", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_descriptor, + new java.lang.String[] { + "Parameters", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_descriptor, + new java.lang.String[] { + "DisplayName", "Required", "EntityType", "IsList", "FillBehavior", "DefaultValue", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_FillBehavior_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_FillBehavior_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Form_Parameter_FillBehavior_descriptor, + new java.lang.String[] { + "InitialPromptFulfillment", "RepromptEventHandlers", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_EventHandler_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_dialogflow_cx_v3beta1_EventHandler_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_EventHandler_descriptor, + new java.lang.String[] { + "Name", "Event", "TriggerFulfillment", "TargetPage", "TargetFlow", "Target", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRoute_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRoute_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRoute_descriptor, + new java.lang.String[] { + "Name", + "Intent", + "Condition", + "TriggerFulfillment", + "TargetPage", + "TargetFlow", + "Target", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesRequest_descriptor, + new java.lang.String[] { + "Parent", "LanguageCode", "PageSize", "PageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListPagesResponse_descriptor, + new java.lang.String[] { + "Pages", "NextPageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetPageRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetPageRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_GetPageRequest_descriptor, + new java.lang.String[] { + "Name", "LanguageCode", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreatePageRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreatePageRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_CreatePageRequest_descriptor, + new java.lang.String[] { + "Parent", "Page", "LanguageCode", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdatePageRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdatePageRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdatePageRequest_descriptor, + new java.lang.String[] { + "Page", "LanguageCode", "UpdateMask", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeletePageRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeletePageRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_DeletePageRequest_descriptor, + new java.lang.String[] { + "Name", "Force", + }); + 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.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryInput.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryInput.java new file mode 100644 index 000000000..d43a1c6f8 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryInput.java @@ -0,0 +1,1657 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Represents the query input. It can contain either:
+ * 1.  A conversational query in the form of text.
+ * 2.  An intent query that specifies which intent to trigger.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.QueryInput} + */ +public final class QueryInput extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.QueryInput) + QueryInputOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryInput.newBuilder() to construct. + private QueryInput(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryInput() { + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryInput(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QueryInput( + 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 18: + { + com.google.cloud.dialogflow.cx.v3beta1.TextInput.Builder subBuilder = null; + if (inputCase_ == 2) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.TextInput) input_).toBuilder(); + } + input_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.TextInput.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.TextInput) input_); + input_ = subBuilder.buildPartial(); + } + inputCase_ = 2; + break; + } + case 26: + { + com.google.cloud.dialogflow.cx.v3beta1.IntentInput.Builder subBuilder = null; + if (inputCase_ == 3) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.IntentInput) input_).toBuilder(); + } + input_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.IntentInput.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.IntentInput) input_); + input_ = subBuilder.buildPartial(); + } + inputCase_ = 3; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + case 42: + { + com.google.cloud.dialogflow.cx.v3beta1.AudioInput.Builder subBuilder = null; + if (inputCase_ == 5) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.AudioInput) input_).toBuilder(); + } + input_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.AudioInput.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.AudioInput) input_); + input_ = subBuilder.buildPartial(); + } + inputCase_ = 5; + 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.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.class, + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder.class); + } + + private int inputCase_ = 0; + private java.lang.Object input_; + + public enum InputCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TEXT(2), + INTENT(3), + AUDIO(5), + INPUT_NOT_SET(0); + private final int value; + + private InputCase(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 InputCase valueOf(int value) { + return forNumber(value); + } + + public static InputCase forNumber(int value) { + switch (value) { + case 2: + return TEXT; + case 3: + return INTENT; + case 5: + return AUDIO; + case 0: + return INPUT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public InputCase getInputCase() { + return InputCase.forNumber(inputCase_); + } + + public static final int TEXT_FIELD_NUMBER = 2; + /** + * + * + *
+   * The natural language text to be processed.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + * + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return inputCase_ == 2; + } + /** + * + * + *
+   * The natural language text to be processed.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + * + * @return The text. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TextInput getText() { + if (inputCase_ == 2) { + return (com.google.cloud.dialogflow.cx.v3beta1.TextInput) input_; + } + return com.google.cloud.dialogflow.cx.v3beta1.TextInput.getDefaultInstance(); + } + /** + * + * + *
+   * The natural language text to be processed.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TextInputOrBuilder getTextOrBuilder() { + if (inputCase_ == 2) { + return (com.google.cloud.dialogflow.cx.v3beta1.TextInput) input_; + } + return com.google.cloud.dialogflow.cx.v3beta1.TextInput.getDefaultInstance(); + } + + public static final int INTENT_FIELD_NUMBER = 3; + /** + * + * + *
+   * The intent to be triggered.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + * + * @return Whether the intent field is set. + */ + @java.lang.Override + public boolean hasIntent() { + return inputCase_ == 3; + } + /** + * + * + *
+   * The intent to be triggered.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + * + * @return The intent. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.IntentInput getIntent() { + if (inputCase_ == 3) { + return (com.google.cloud.dialogflow.cx.v3beta1.IntentInput) input_; + } + return com.google.cloud.dialogflow.cx.v3beta1.IntentInput.getDefaultInstance(); + } + /** + * + * + *
+   * The intent to be triggered.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.IntentInputOrBuilder getIntentOrBuilder() { + if (inputCase_ == 3) { + return (com.google.cloud.dialogflow.cx.v3beta1.IntentInput) input_; + } + return com.google.cloud.dialogflow.cx.v3beta1.IntentInput.getDefaultInstance(); + } + + public static final int AUDIO_FIELD_NUMBER = 5; + /** + * + * + *
+   * The natural language speech audio to be processed.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + * + * @return Whether the audio field is set. + */ + @java.lang.Override + public boolean hasAudio() { + return inputCase_ == 5; + } + /** + * + * + *
+   * The natural language speech audio to be processed.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + * + * @return The audio. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.AudioInput getAudio() { + if (inputCase_ == 5) { + return (com.google.cloud.dialogflow.cx.v3beta1.AudioInput) input_; + } + return com.google.cloud.dialogflow.cx.v3beta1.AudioInput.getDefaultInstance(); + } + /** + * + * + *
+   * The natural language speech audio to be processed.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.AudioInputOrBuilder getAudioOrBuilder() { + if (inputCase_ == 5) { + return (com.google.cloud.dialogflow.cx.v3beta1.AudioInput) input_; + } + return com.google.cloud.dialogflow.cx.v3beta1.AudioInput.getDefaultInstance(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 4; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * Required. The language of the input. See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a
+   * list of the currently supported language codes. Note that queries in the
+   * same session do not necessarily need to specify the same language.
+   * 
+ * + * string language_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The language of the input. See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a
+   * list of the currently supported language codes. Note that queries in the
+   * same session do not necessarily need to specify the same language.
+   * 
+ * + * string language_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (inputCase_ == 2) { + output.writeMessage(2, (com.google.cloud.dialogflow.cx.v3beta1.TextInput) input_); + } + if (inputCase_ == 3) { + output.writeMessage(3, (com.google.cloud.dialogflow.cx.v3beta1.IntentInput) input_); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, languageCode_); + } + if (inputCase_ == 5) { + output.writeMessage(5, (com.google.cloud.dialogflow.cx.v3beta1.AudioInput) input_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (inputCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.dialogflow.cx.v3beta1.TextInput) input_); + } + if (inputCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.dialogflow.cx.v3beta1.IntentInput) input_); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, languageCode_); + } + if (inputCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.cloud.dialogflow.cx.v3beta1.AudioInput) input_); + } + 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.dialogflow.cx.v3beta1.QueryInput)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.QueryInput other = + (com.google.cloud.dialogflow.cx.v3beta1.QueryInput) obj; + + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!getInputCase().equals(other.getInputCase())) return false; + switch (inputCase_) { + case 2: + if (!getText().equals(other.getText())) return false; + break; + case 3: + if (!getIntent().equals(other.getIntent())) return false; + break; + case 5: + if (!getAudio().equals(other.getAudio())) 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) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + switch (inputCase_) { + case 2: + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 3: + hash = (37 * hash) + INTENT_FIELD_NUMBER; + hash = (53 * hash) + getIntent().hashCode(); + break; + case 5: + hash = (37 * hash) + AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getAudio().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryInput parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryInput 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.dialogflow.cx.v3beta1.QueryInput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryInput 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.dialogflow.cx.v3beta1.QueryInput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryInput parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryInput parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryInput 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.dialogflow.cx.v3beta1.QueryInput parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryInput 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.dialogflow.cx.v3beta1.QueryInput parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryInput 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.dialogflow.cx.v3beta1.QueryInput prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the query input. It can contain either:
+   * 1.  A conversational query in the form of text.
+   * 2.  An intent query that specifies which intent to trigger.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.QueryInput} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.QueryInput) + com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.class, + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.QueryInput.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(); + languageCode_ = ""; + + inputCase_ = 0; + input_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryInput_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryInput getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.QueryInput.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryInput build() { + com.google.cloud.dialogflow.cx.v3beta1.QueryInput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryInput buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.QueryInput result = + new com.google.cloud.dialogflow.cx.v3beta1.QueryInput(this); + if (inputCase_ == 2) { + if (textBuilder_ == null) { + result.input_ = input_; + } else { + result.input_ = textBuilder_.build(); + } + } + if (inputCase_ == 3) { + if (intentBuilder_ == null) { + result.input_ = input_; + } else { + result.input_ = intentBuilder_.build(); + } + } + if (inputCase_ == 5) { + if (audioBuilder_ == null) { + result.input_ = input_; + } else { + result.input_ = audioBuilder_.build(); + } + } + result.languageCode_ = languageCode_; + result.inputCase_ = inputCase_; + 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.dialogflow.cx.v3beta1.QueryInput) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.QueryInput) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.QueryInput other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.QueryInput.getDefaultInstance()) + return this; + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + switch (other.getInputCase()) { + case TEXT: + { + mergeText(other.getText()); + break; + } + case INTENT: + { + mergeIntent(other.getIntent()); + break; + } + case AUDIO: + { + mergeAudio(other.getAudio()); + break; + } + case INPUT_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.dialogflow.cx.v3beta1.QueryInput parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.QueryInput) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int inputCase_ = 0; + private java.lang.Object input_; + + public InputCase getInputCase() { + return InputCase.forNumber(inputCase_); + } + + public Builder clearInput() { + inputCase_ = 0; + input_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TextInput, + com.google.cloud.dialogflow.cx.v3beta1.TextInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TextInputOrBuilder> + textBuilder_; + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + * + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return inputCase_ == 2; + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + * + * @return The text. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TextInput getText() { + if (textBuilder_ == null) { + if (inputCase_ == 2) { + return (com.google.cloud.dialogflow.cx.v3beta1.TextInput) input_; + } + return com.google.cloud.dialogflow.cx.v3beta1.TextInput.getDefaultInstance(); + } else { + if (inputCase_ == 2) { + return textBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.TextInput.getDefaultInstance(); + } + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + */ + public Builder setText(com.google.cloud.dialogflow.cx.v3beta1.TextInput value) { + if (textBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + input_ = value; + onChanged(); + } else { + textBuilder_.setMessage(value); + } + inputCase_ = 2; + return this; + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + */ + public Builder setText( + com.google.cloud.dialogflow.cx.v3beta1.TextInput.Builder builderForValue) { + if (textBuilder_ == null) { + input_ = builderForValue.build(); + onChanged(); + } else { + textBuilder_.setMessage(builderForValue.build()); + } + inputCase_ = 2; + return this; + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + */ + public Builder mergeText(com.google.cloud.dialogflow.cx.v3beta1.TextInput value) { + if (textBuilder_ == null) { + if (inputCase_ == 2 + && input_ != com.google.cloud.dialogflow.cx.v3beta1.TextInput.getDefaultInstance()) { + input_ = + com.google.cloud.dialogflow.cx.v3beta1.TextInput.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.TextInput) input_) + .mergeFrom(value) + .buildPartial(); + } else { + input_ = value; + } + onChanged(); + } else { + if (inputCase_ == 2) { + textBuilder_.mergeFrom(value); + } + textBuilder_.setMessage(value); + } + inputCase_ = 2; + return this; + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + */ + public Builder clearText() { + if (textBuilder_ == null) { + if (inputCase_ == 2) { + inputCase_ = 0; + input_ = null; + onChanged(); + } + } else { + if (inputCase_ == 2) { + inputCase_ = 0; + input_ = null; + } + textBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.TextInput.Builder getTextBuilder() { + return getTextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TextInputOrBuilder getTextOrBuilder() { + if ((inputCase_ == 2) && (textBuilder_ != null)) { + return textBuilder_.getMessageOrBuilder(); + } else { + if (inputCase_ == 2) { + return (com.google.cloud.dialogflow.cx.v3beta1.TextInput) input_; + } + return com.google.cloud.dialogflow.cx.v3beta1.TextInput.getDefaultInstance(); + } + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TextInput, + com.google.cloud.dialogflow.cx.v3beta1.TextInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TextInputOrBuilder> + getTextFieldBuilder() { + if (textBuilder_ == null) { + if (!(inputCase_ == 2)) { + input_ = com.google.cloud.dialogflow.cx.v3beta1.TextInput.getDefaultInstance(); + } + textBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TextInput, + com.google.cloud.dialogflow.cx.v3beta1.TextInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TextInputOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.TextInput) input_, + getParentForChildren(), + isClean()); + input_ = null; + } + inputCase_ = 2; + onChanged(); + ; + return textBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.IntentInput, + com.google.cloud.dialogflow.cx.v3beta1.IntentInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentInputOrBuilder> + intentBuilder_; + /** + * + * + *
+     * The intent to be triggered.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + * + * @return Whether the intent field is set. + */ + @java.lang.Override + public boolean hasIntent() { + return inputCase_ == 3; + } + /** + * + * + *
+     * The intent to be triggered.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + * + * @return The intent. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.IntentInput getIntent() { + if (intentBuilder_ == null) { + if (inputCase_ == 3) { + return (com.google.cloud.dialogflow.cx.v3beta1.IntentInput) input_; + } + return com.google.cloud.dialogflow.cx.v3beta1.IntentInput.getDefaultInstance(); + } else { + if (inputCase_ == 3) { + return intentBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.IntentInput.getDefaultInstance(); + } + } + /** + * + * + *
+     * The intent to be triggered.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + */ + public Builder setIntent(com.google.cloud.dialogflow.cx.v3beta1.IntentInput value) { + if (intentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + input_ = value; + onChanged(); + } else { + intentBuilder_.setMessage(value); + } + inputCase_ = 3; + return this; + } + /** + * + * + *
+     * The intent to be triggered.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + */ + public Builder setIntent( + com.google.cloud.dialogflow.cx.v3beta1.IntentInput.Builder builderForValue) { + if (intentBuilder_ == null) { + input_ = builderForValue.build(); + onChanged(); + } else { + intentBuilder_.setMessage(builderForValue.build()); + } + inputCase_ = 3; + return this; + } + /** + * + * + *
+     * The intent to be triggered.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + */ + public Builder mergeIntent(com.google.cloud.dialogflow.cx.v3beta1.IntentInput value) { + if (intentBuilder_ == null) { + if (inputCase_ == 3 + && input_ != com.google.cloud.dialogflow.cx.v3beta1.IntentInput.getDefaultInstance()) { + input_ = + com.google.cloud.dialogflow.cx.v3beta1.IntentInput.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.IntentInput) input_) + .mergeFrom(value) + .buildPartial(); + } else { + input_ = value; + } + onChanged(); + } else { + if (inputCase_ == 3) { + intentBuilder_.mergeFrom(value); + } + intentBuilder_.setMessage(value); + } + inputCase_ = 3; + return this; + } + /** + * + * + *
+     * The intent to be triggered.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + */ + public Builder clearIntent() { + if (intentBuilder_ == null) { + if (inputCase_ == 3) { + inputCase_ = 0; + input_ = null; + onChanged(); + } + } else { + if (inputCase_ == 3) { + inputCase_ = 0; + input_ = null; + } + intentBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The intent to be triggered.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + */ + public com.google.cloud.dialogflow.cx.v3beta1.IntentInput.Builder getIntentBuilder() { + return getIntentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The intent to be triggered.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.IntentInputOrBuilder getIntentOrBuilder() { + if ((inputCase_ == 3) && (intentBuilder_ != null)) { + return intentBuilder_.getMessageOrBuilder(); + } else { + if (inputCase_ == 3) { + return (com.google.cloud.dialogflow.cx.v3beta1.IntentInput) input_; + } + return com.google.cloud.dialogflow.cx.v3beta1.IntentInput.getDefaultInstance(); + } + } + /** + * + * + *
+     * The intent to be triggered.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.IntentInput, + com.google.cloud.dialogflow.cx.v3beta1.IntentInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentInputOrBuilder> + getIntentFieldBuilder() { + if (intentBuilder_ == null) { + if (!(inputCase_ == 3)) { + input_ = com.google.cloud.dialogflow.cx.v3beta1.IntentInput.getDefaultInstance(); + } + intentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.IntentInput, + com.google.cloud.dialogflow.cx.v3beta1.IntentInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentInputOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.IntentInput) input_, + getParentForChildren(), + isClean()); + input_ = null; + } + inputCase_ = 3; + onChanged(); + ; + return intentBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.AudioInput, + com.google.cloud.dialogflow.cx.v3beta1.AudioInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.AudioInputOrBuilder> + audioBuilder_; + /** + * + * + *
+     * The natural language speech audio to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + * + * @return Whether the audio field is set. + */ + @java.lang.Override + public boolean hasAudio() { + return inputCase_ == 5; + } + /** + * + * + *
+     * The natural language speech audio to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + * + * @return The audio. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.AudioInput getAudio() { + if (audioBuilder_ == null) { + if (inputCase_ == 5) { + return (com.google.cloud.dialogflow.cx.v3beta1.AudioInput) input_; + } + return com.google.cloud.dialogflow.cx.v3beta1.AudioInput.getDefaultInstance(); + } else { + if (inputCase_ == 5) { + return audioBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.AudioInput.getDefaultInstance(); + } + } + /** + * + * + *
+     * The natural language speech audio to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + */ + public Builder setAudio(com.google.cloud.dialogflow.cx.v3beta1.AudioInput value) { + if (audioBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + input_ = value; + onChanged(); + } else { + audioBuilder_.setMessage(value); + } + inputCase_ = 5; + return this; + } + /** + * + * + *
+     * The natural language speech audio to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + */ + public Builder setAudio( + com.google.cloud.dialogflow.cx.v3beta1.AudioInput.Builder builderForValue) { + if (audioBuilder_ == null) { + input_ = builderForValue.build(); + onChanged(); + } else { + audioBuilder_.setMessage(builderForValue.build()); + } + inputCase_ = 5; + return this; + } + /** + * + * + *
+     * The natural language speech audio to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + */ + public Builder mergeAudio(com.google.cloud.dialogflow.cx.v3beta1.AudioInput value) { + if (audioBuilder_ == null) { + if (inputCase_ == 5 + && input_ != com.google.cloud.dialogflow.cx.v3beta1.AudioInput.getDefaultInstance()) { + input_ = + com.google.cloud.dialogflow.cx.v3beta1.AudioInput.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.AudioInput) input_) + .mergeFrom(value) + .buildPartial(); + } else { + input_ = value; + } + onChanged(); + } else { + if (inputCase_ == 5) { + audioBuilder_.mergeFrom(value); + } + audioBuilder_.setMessage(value); + } + inputCase_ = 5; + return this; + } + /** + * + * + *
+     * The natural language speech audio to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + */ + public Builder clearAudio() { + if (audioBuilder_ == null) { + if (inputCase_ == 5) { + inputCase_ = 0; + input_ = null; + onChanged(); + } + } else { + if (inputCase_ == 5) { + inputCase_ = 0; + input_ = null; + } + audioBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The natural language speech audio to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + */ + public com.google.cloud.dialogflow.cx.v3beta1.AudioInput.Builder getAudioBuilder() { + return getAudioFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The natural language speech audio to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.AudioInputOrBuilder getAudioOrBuilder() { + if ((inputCase_ == 5) && (audioBuilder_ != null)) { + return audioBuilder_.getMessageOrBuilder(); + } else { + if (inputCase_ == 5) { + return (com.google.cloud.dialogflow.cx.v3beta1.AudioInput) input_; + } + return com.google.cloud.dialogflow.cx.v3beta1.AudioInput.getDefaultInstance(); + } + } + /** + * + * + *
+     * The natural language speech audio to be processed.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.AudioInput, + com.google.cloud.dialogflow.cx.v3beta1.AudioInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.AudioInputOrBuilder> + getAudioFieldBuilder() { + if (audioBuilder_ == null) { + if (!(inputCase_ == 5)) { + input_ = com.google.cloud.dialogflow.cx.v3beta1.AudioInput.getDefaultInstance(); + } + audioBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.AudioInput, + com.google.cloud.dialogflow.cx.v3beta1.AudioInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.AudioInputOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.AudioInput) input_, + getParentForChildren(), + isClean()); + input_ = null; + } + inputCase_ = 5; + onChanged(); + ; + return audioBuilder_; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * Required. The language of the input. See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a
+     * list of the currently supported language codes. Note that queries in the
+     * same session do not necessarily need to specify the same language.
+     * 
+ * + * string language_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The language of the input. See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a
+     * list of the currently supported language codes. Note that queries in the
+     * same session do not necessarily need to specify the same language.
+     * 
+ * + * string language_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The language of the input. See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a
+     * list of the currently supported language codes. Note that queries in the
+     * same session do not necessarily need to specify the same language.
+     * 
+ * + * string language_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The language of the input. See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a
+     * list of the currently supported language codes. Note that queries in the
+     * same session do not necessarily need to specify the same language.
+     * 
+ * + * string language_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The language of the input. See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a
+     * list of the currently supported language codes. Note that queries in the
+     * same session do not necessarily need to specify the same language.
+     * 
+ * + * string language_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @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.dialogflow.cx.v3beta1.QueryInput) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.QueryInput) + private static final com.google.cloud.dialogflow.cx.v3beta1.QueryInput DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.QueryInput(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryInput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryInput parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryInput(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.dialogflow.cx.v3beta1.QueryInput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryInputOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryInputOrBuilder.java new file mode 100644 index 000000000..5c7cea29a --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryInputOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface QueryInputOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.QueryInput) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The natural language text to be processed.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + * + * @return Whether the text field is set. + */ + boolean hasText(); + /** + * + * + *
+   * The natural language text to be processed.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + * + * @return The text. + */ + com.google.cloud.dialogflow.cx.v3beta1.TextInput getText(); + /** + * + * + *
+   * The natural language text to be processed.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.TextInput text = 2; + */ + com.google.cloud.dialogflow.cx.v3beta1.TextInputOrBuilder getTextOrBuilder(); + + /** + * + * + *
+   * The intent to be triggered.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + * + * @return Whether the intent field is set. + */ + boolean hasIntent(); + /** + * + * + *
+   * The intent to be triggered.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + * + * @return The intent. + */ + com.google.cloud.dialogflow.cx.v3beta1.IntentInput getIntent(); + /** + * + * + *
+   * The intent to be triggered.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.IntentInput intent = 3; + */ + com.google.cloud.dialogflow.cx.v3beta1.IntentInputOrBuilder getIntentOrBuilder(); + + /** + * + * + *
+   * The natural language speech audio to be processed.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + * + * @return Whether the audio field is set. + */ + boolean hasAudio(); + /** + * + * + *
+   * The natural language speech audio to be processed.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + * + * @return The audio. + */ + com.google.cloud.dialogflow.cx.v3beta1.AudioInput getAudio(); + /** + * + * + *
+   * The natural language speech audio to be processed.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.AudioInput audio = 5; + */ + com.google.cloud.dialogflow.cx.v3beta1.AudioInputOrBuilder getAudioOrBuilder(); + + /** + * + * + *
+   * Required. The language of the input. See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a
+   * list of the currently supported language codes. Note that queries in the
+   * same session do not necessarily need to specify the same language.
+   * 
+ * + * string language_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * Required. The language of the input. See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a
+   * list of the currently supported language codes. Note that queries in the
+   * same session do not necessarily need to specify the same language.
+   * 
+ * + * string language_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + + public com.google.cloud.dialogflow.cx.v3beta1.QueryInput.InputCase getInputCase(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryParameters.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryParameters.java new file mode 100644 index 000000000..bf08e7b37 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryParameters.java @@ -0,0 +1,2255 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Represents the parameters of a conversational query.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.QueryParameters} + */ +public final class QueryParameters extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.QueryParameters) + QueryParametersOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryParameters.newBuilder() to construct. + private QueryParameters(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryParameters() { + timeZone_ = ""; + sessionEntityTypes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryParameters(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QueryParameters( + 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(); + + timeZone_ = s; + break; + } + case 18: + { + com.google.type.LatLng.Builder subBuilder = null; + if (geoLocation_ != null) { + subBuilder = geoLocation_.toBuilder(); + } + geoLocation_ = input.readMessage(com.google.type.LatLng.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(geoLocation_); + geoLocation_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + sessionEntityTypes_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType>(); + mutable_bitField0_ |= 0x00000001; + } + sessionEntityTypes_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.parser(), + extensionRegistry)); + break; + } + case 34: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (payload_ != null) { + subBuilder = payload_.toBuilder(); + } + payload_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(payload_); + payload_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (parameters_ != null) { + subBuilder = parameters_.toBuilder(); + } + parameters_ = + input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(parameters_); + parameters_ = 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)) { + sessionEntityTypes_ = java.util.Collections.unmodifiableList(sessionEntityTypes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.class, + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder.class); + } + + public static final int TIME_ZONE_FIELD_NUMBER = 1; + private volatile java.lang.Object timeZone_; + /** + * + * + *
+   * The time zone of this conversational query from the [time zone
+   * database](https://www.iana.org/time-zones), e.g., America/New_York,
+   * Europe/Paris. If not provided, the time zone specified in the agent is
+   * used.
+   * 
+ * + * string time_zone = 1; + * + * @return The timeZone. + */ + @java.lang.Override + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + 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(); + timeZone_ = s; + return s; + } + } + /** + * + * + *
+   * The time zone of this conversational query from the [time zone
+   * database](https://www.iana.org/time-zones), e.g., America/New_York,
+   * Europe/Paris. If not provided, the time zone specified in the agent is
+   * used.
+   * 
+ * + * string time_zone = 1; + * + * @return The bytes for timeZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GEO_LOCATION_FIELD_NUMBER = 2; + private com.google.type.LatLng geoLocation_; + /** + * + * + *
+   * The geo location of this conversational query.
+   * 
+ * + * .google.type.LatLng geo_location = 2; + * + * @return Whether the geoLocation field is set. + */ + @java.lang.Override + public boolean hasGeoLocation() { + return geoLocation_ != null; + } + /** + * + * + *
+   * The geo location of this conversational query.
+   * 
+ * + * .google.type.LatLng geo_location = 2; + * + * @return The geoLocation. + */ + @java.lang.Override + public com.google.type.LatLng getGeoLocation() { + return geoLocation_ == null ? com.google.type.LatLng.getDefaultInstance() : geoLocation_; + } + /** + * + * + *
+   * The geo location of this conversational query.
+   * 
+ * + * .google.type.LatLng geo_location = 2; + */ + @java.lang.Override + public com.google.type.LatLngOrBuilder getGeoLocationOrBuilder() { + return getGeoLocation(); + } + + public static final int SESSION_ENTITY_TYPES_FIELD_NUMBER = 3; + private java.util.List + sessionEntityTypes_; + /** + * + * + *
+   * Additional session entity types to replace or extend developer entity types
+   * with. The entity synonyms apply to all languages and persist for the
+   * session of this query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + @java.lang.Override + public java.util.List + getSessionEntityTypesList() { + return sessionEntityTypes_; + } + /** + * + * + *
+   * Additional session entity types to replace or extend developer entity types
+   * with. The entity synonyms apply to all languages and persist for the
+   * session of this query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + @java.lang.Override + public java.util.List + getSessionEntityTypesOrBuilderList() { + return sessionEntityTypes_; + } + /** + * + * + *
+   * Additional session entity types to replace or extend developer entity types
+   * with. The entity synonyms apply to all languages and persist for the
+   * session of this query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + @java.lang.Override + public int getSessionEntityTypesCount() { + return sessionEntityTypes_.size(); + } + /** + * + * + *
+   * Additional session entity types to replace or extend developer entity types
+   * with. The entity synonyms apply to all languages and persist for the
+   * session of this query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityTypes(int index) { + return sessionEntityTypes_.get(index); + } + /** + * + * + *
+   * Additional session entity types to replace or extend developer entity types
+   * with. The entity synonyms apply to all languages and persist for the
+   * session of this query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder + getSessionEntityTypesOrBuilder(int index) { + return sessionEntityTypes_.get(index); + } + + public static final int PAYLOAD_FIELD_NUMBER = 4; + private com.google.protobuf.Struct payload_; + /** + * + * + *
+   * This field can be used to pass custom data into the webhook associated with
+   * the agent. Arbitrary JSON objects are supported.
+   * 
+ * + * .google.protobuf.Struct payload = 4; + * + * @return Whether the payload field is set. + */ + @java.lang.Override + public boolean hasPayload() { + return payload_ != null; + } + /** + * + * + *
+   * This field can be used to pass custom data into the webhook associated with
+   * the agent. Arbitrary JSON objects are supported.
+   * 
+ * + * .google.protobuf.Struct payload = 4; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.Struct getPayload() { + return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; + } + /** + * + * + *
+   * This field can be used to pass custom data into the webhook associated with
+   * the agent. Arbitrary JSON objects are supported.
+   * 
+ * + * .google.protobuf.Struct payload = 4; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { + return getPayload(); + } + + public static final int PARAMETERS_FIELD_NUMBER = 5; + private com.google.protobuf.Struct parameters_; + /** + * + * + *
+   * Additional parameters to be put into [session
+   * parameters][SessionInfo.parameters]. To remove a
+   * parameter from the session, clients should explicitly set the parameter
+   * value to null.
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 5; + * + * @return Whether the parameters field is set. + */ + @java.lang.Override + public boolean hasParameters() { + return parameters_ != null; + } + /** + * + * + *
+   * Additional parameters to be put into [session
+   * parameters][SessionInfo.parameters]. To remove a
+   * parameter from the session, clients should explicitly set the parameter
+   * value to null.
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 5; + * + * @return The parameters. + */ + @java.lang.Override + public com.google.protobuf.Struct getParameters() { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } + /** + * + * + *
+   * Additional parameters to be put into [session
+   * parameters][SessionInfo.parameters]. To remove a
+   * parameter from the session, clients should explicitly set the parameter
+   * value to null.
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 5; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getParametersOrBuilder() { + return getParameters(); + } + + 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 (!getTimeZoneBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, timeZone_); + } + if (geoLocation_ != null) { + output.writeMessage(2, getGeoLocation()); + } + for (int i = 0; i < sessionEntityTypes_.size(); i++) { + output.writeMessage(3, sessionEntityTypes_.get(i)); + } + if (payload_ != null) { + output.writeMessage(4, getPayload()); + } + if (parameters_ != null) { + output.writeMessage(5, getParameters()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTimeZoneBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, timeZone_); + } + if (geoLocation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getGeoLocation()); + } + for (int i = 0; i < sessionEntityTypes_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, sessionEntityTypes_.get(i)); + } + if (payload_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getPayload()); + } + if (parameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getParameters()); + } + 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.dialogflow.cx.v3beta1.QueryParameters)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters other = + (com.google.cloud.dialogflow.cx.v3beta1.QueryParameters) obj; + + if (!getTimeZone().equals(other.getTimeZone())) return false; + if (hasGeoLocation() != other.hasGeoLocation()) return false; + if (hasGeoLocation()) { + if (!getGeoLocation().equals(other.getGeoLocation())) return false; + } + if (!getSessionEntityTypesList().equals(other.getSessionEntityTypesList())) return false; + if (hasPayload() != other.hasPayload()) return false; + if (hasPayload()) { + if (!getPayload().equals(other.getPayload())) return false; + } + if (hasParameters() != other.hasParameters()) return false; + if (hasParameters()) { + if (!getParameters().equals(other.getParameters())) 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) + TIME_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getTimeZone().hashCode(); + if (hasGeoLocation()) { + hash = (37 * hash) + GEO_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getGeoLocation().hashCode(); + } + if (getSessionEntityTypesCount() > 0) { + hash = (37 * hash) + SESSION_ENTITY_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getSessionEntityTypesList().hashCode(); + } + if (hasPayload()) { + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + } + if (hasParameters()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParameters().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryParameters parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryParameters 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.dialogflow.cx.v3beta1.QueryParameters parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryParameters 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.dialogflow.cx.v3beta1.QueryParameters parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryParameters parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryParameters parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryParameters 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.dialogflow.cx.v3beta1.QueryParameters parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryParameters 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.dialogflow.cx.v3beta1.QueryParameters parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryParameters 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.dialogflow.cx.v3beta1.QueryParameters prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the parameters of a conversational query.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.QueryParameters} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.QueryParameters) + com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.class, + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSessionEntityTypesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + timeZone_ = ""; + + if (geoLocationBuilder_ == null) { + geoLocation_ = null; + } else { + geoLocation_ = null; + geoLocationBuilder_ = null; + } + if (sessionEntityTypesBuilder_ == null) { + sessionEntityTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + sessionEntityTypesBuilder_.clear(); + } + if (payloadBuilder_ == null) { + payload_ = null; + } else { + payload_ = null; + payloadBuilder_ = null; + } + if (parametersBuilder_ == null) { + parameters_ = null; + } else { + parameters_ = null; + parametersBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryParameters getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryParameters build() { + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryParameters buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters result = + new com.google.cloud.dialogflow.cx.v3beta1.QueryParameters(this); + int from_bitField0_ = bitField0_; + result.timeZone_ = timeZone_; + if (geoLocationBuilder_ == null) { + result.geoLocation_ = geoLocation_; + } else { + result.geoLocation_ = geoLocationBuilder_.build(); + } + if (sessionEntityTypesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sessionEntityTypes_ = java.util.Collections.unmodifiableList(sessionEntityTypes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sessionEntityTypes_ = sessionEntityTypes_; + } else { + result.sessionEntityTypes_ = sessionEntityTypesBuilder_.build(); + } + if (payloadBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = payloadBuilder_.build(); + } + if (parametersBuilder_ == null) { + result.parameters_ = parameters_; + } else { + result.parameters_ = parametersBuilder_.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.dialogflow.cx.v3beta1.QueryParameters) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.QueryParameters) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.QueryParameters other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.getDefaultInstance()) + return this; + if (!other.getTimeZone().isEmpty()) { + timeZone_ = other.timeZone_; + onChanged(); + } + if (other.hasGeoLocation()) { + mergeGeoLocation(other.getGeoLocation()); + } + if (sessionEntityTypesBuilder_ == null) { + if (!other.sessionEntityTypes_.isEmpty()) { + if (sessionEntityTypes_.isEmpty()) { + sessionEntityTypes_ = other.sessionEntityTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.addAll(other.sessionEntityTypes_); + } + onChanged(); + } + } else { + if (!other.sessionEntityTypes_.isEmpty()) { + if (sessionEntityTypesBuilder_.isEmpty()) { + sessionEntityTypesBuilder_.dispose(); + sessionEntityTypesBuilder_ = null; + sessionEntityTypes_ = other.sessionEntityTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + sessionEntityTypesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSessionEntityTypesFieldBuilder() + : null; + } else { + sessionEntityTypesBuilder_.addAllMessages(other.sessionEntityTypes_); + } + } + } + if (other.hasPayload()) { + mergePayload(other.getPayload()); + } + if (other.hasParameters()) { + mergeParameters(other.getParameters()); + } + 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.dialogflow.cx.v3beta1.QueryParameters parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.QueryParameters) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object timeZone_ = ""; + /** + * + * + *
+     * The time zone of this conversational query from the [time zone
+     * database](https://www.iana.org/time-zones), e.g., America/New_York,
+     * Europe/Paris. If not provided, the time zone specified in the agent is
+     * used.
+     * 
+ * + * string time_zone = 1; + * + * @return The timeZone. + */ + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The time zone of this conversational query from the [time zone
+     * database](https://www.iana.org/time-zones), e.g., America/New_York,
+     * Europe/Paris. If not provided, the time zone specified in the agent is
+     * used.
+     * 
+ * + * string time_zone = 1; + * + * @return The bytes for timeZone. + */ + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The time zone of this conversational query from the [time zone
+     * database](https://www.iana.org/time-zones), e.g., America/New_York,
+     * Europe/Paris. If not provided, the time zone specified in the agent is
+     * used.
+     * 
+ * + * string time_zone = 1; + * + * @param value The timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + timeZone_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The time zone of this conversational query from the [time zone
+     * database](https://www.iana.org/time-zones), e.g., America/New_York,
+     * Europe/Paris. If not provided, the time zone specified in the agent is
+     * used.
+     * 
+ * + * string time_zone = 1; + * + * @return This builder for chaining. + */ + public Builder clearTimeZone() { + + timeZone_ = getDefaultInstance().getTimeZone(); + onChanged(); + return this; + } + /** + * + * + *
+     * The time zone of this conversational query from the [time zone
+     * database](https://www.iana.org/time-zones), e.g., America/New_York,
+     * Europe/Paris. If not provided, the time zone specified in the agent is
+     * used.
+     * 
+ * + * string time_zone = 1; + * + * @param value The bytes for timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + timeZone_ = value; + onChanged(); + return this; + } + + private com.google.type.LatLng geoLocation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> + geoLocationBuilder_; + /** + * + * + *
+     * The geo location of this conversational query.
+     * 
+ * + * .google.type.LatLng geo_location = 2; + * + * @return Whether the geoLocation field is set. + */ + public boolean hasGeoLocation() { + return geoLocationBuilder_ != null || geoLocation_ != null; + } + /** + * + * + *
+     * The geo location of this conversational query.
+     * 
+ * + * .google.type.LatLng geo_location = 2; + * + * @return The geoLocation. + */ + public com.google.type.LatLng getGeoLocation() { + if (geoLocationBuilder_ == null) { + return geoLocation_ == null ? com.google.type.LatLng.getDefaultInstance() : geoLocation_; + } else { + return geoLocationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The geo location of this conversational query.
+     * 
+ * + * .google.type.LatLng geo_location = 2; + */ + public Builder setGeoLocation(com.google.type.LatLng value) { + if (geoLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + geoLocation_ = value; + onChanged(); + } else { + geoLocationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The geo location of this conversational query.
+     * 
+ * + * .google.type.LatLng geo_location = 2; + */ + public Builder setGeoLocation(com.google.type.LatLng.Builder builderForValue) { + if (geoLocationBuilder_ == null) { + geoLocation_ = builderForValue.build(); + onChanged(); + } else { + geoLocationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The geo location of this conversational query.
+     * 
+ * + * .google.type.LatLng geo_location = 2; + */ + public Builder mergeGeoLocation(com.google.type.LatLng value) { + if (geoLocationBuilder_ == null) { + if (geoLocation_ != null) { + geoLocation_ = + com.google.type.LatLng.newBuilder(geoLocation_).mergeFrom(value).buildPartial(); + } else { + geoLocation_ = value; + } + onChanged(); + } else { + geoLocationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The geo location of this conversational query.
+     * 
+ * + * .google.type.LatLng geo_location = 2; + */ + public Builder clearGeoLocation() { + if (geoLocationBuilder_ == null) { + geoLocation_ = null; + onChanged(); + } else { + geoLocation_ = null; + geoLocationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The geo location of this conversational query.
+     * 
+ * + * .google.type.LatLng geo_location = 2; + */ + public com.google.type.LatLng.Builder getGeoLocationBuilder() { + + onChanged(); + return getGeoLocationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The geo location of this conversational query.
+     * 
+ * + * .google.type.LatLng geo_location = 2; + */ + public com.google.type.LatLngOrBuilder getGeoLocationOrBuilder() { + if (geoLocationBuilder_ != null) { + return geoLocationBuilder_.getMessageOrBuilder(); + } else { + return geoLocation_ == null ? com.google.type.LatLng.getDefaultInstance() : geoLocation_; + } + } + /** + * + * + *
+     * The geo location of this conversational query.
+     * 
+ * + * .google.type.LatLng geo_location = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> + getGeoLocationFieldBuilder() { + if (geoLocationBuilder_ == null) { + geoLocationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, + com.google.type.LatLng.Builder, + com.google.type.LatLngOrBuilder>( + getGeoLocation(), getParentForChildren(), isClean()); + geoLocation_ = null; + } + return geoLocationBuilder_; + } + + private java.util.List + sessionEntityTypes_ = java.util.Collections.emptyList(); + + private void ensureSessionEntityTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sessionEntityTypes_ = + new java.util.ArrayList( + sessionEntityTypes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder> + sessionEntityTypesBuilder_; + + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public java.util.List + getSessionEntityTypesList() { + if (sessionEntityTypesBuilder_ == null) { + return java.util.Collections.unmodifiableList(sessionEntityTypes_); + } else { + return sessionEntityTypesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public int getSessionEntityTypesCount() { + if (sessionEntityTypesBuilder_ == null) { + return sessionEntityTypes_.size(); + } else { + return sessionEntityTypesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityTypes( + int index) { + if (sessionEntityTypesBuilder_ == null) { + return sessionEntityTypes_.get(index); + } else { + return sessionEntityTypesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public Builder setSessionEntityTypes( + int index, com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType value) { + if (sessionEntityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.set(index, value); + onChanged(); + } else { + sessionEntityTypesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public Builder setSessionEntityTypes( + int index, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder builderForValue) { + if (sessionEntityTypesBuilder_ == null) { + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.set(index, builderForValue.build()); + onChanged(); + } else { + sessionEntityTypesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public Builder addSessionEntityTypes( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType value) { + if (sessionEntityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.add(value); + onChanged(); + } else { + sessionEntityTypesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public Builder addSessionEntityTypes( + int index, com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType value) { + if (sessionEntityTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.add(index, value); + onChanged(); + } else { + sessionEntityTypesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public Builder addSessionEntityTypes( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder builderForValue) { + if (sessionEntityTypesBuilder_ == null) { + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.add(builderForValue.build()); + onChanged(); + } else { + sessionEntityTypesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public Builder addSessionEntityTypes( + int index, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder builderForValue) { + if (sessionEntityTypesBuilder_ == null) { + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.add(index, builderForValue.build()); + onChanged(); + } else { + sessionEntityTypesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public Builder addAllSessionEntityTypes( + java.lang.Iterable + values) { + if (sessionEntityTypesBuilder_ == null) { + ensureSessionEntityTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sessionEntityTypes_); + onChanged(); + } else { + sessionEntityTypesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public Builder clearSessionEntityTypes() { + if (sessionEntityTypesBuilder_ == null) { + sessionEntityTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sessionEntityTypesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public Builder removeSessionEntityTypes(int index) { + if (sessionEntityTypesBuilder_ == null) { + ensureSessionEntityTypesIsMutable(); + sessionEntityTypes_.remove(index); + onChanged(); + } else { + sessionEntityTypesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder + getSessionEntityTypesBuilder(int index) { + return getSessionEntityTypesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder + getSessionEntityTypesOrBuilder(int index) { + if (sessionEntityTypesBuilder_ == null) { + return sessionEntityTypes_.get(index); + } else { + return sessionEntityTypesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder> + getSessionEntityTypesOrBuilderList() { + if (sessionEntityTypesBuilder_ != null) { + return sessionEntityTypesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sessionEntityTypes_); + } + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder + addSessionEntityTypesBuilder() { + return getSessionEntityTypesFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.getDefaultInstance()); + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder + addSessionEntityTypesBuilder(int index) { + return getSessionEntityTypesFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.getDefaultInstance()); + } + /** + * + * + *
+     * Additional session entity types to replace or extend developer entity types
+     * with. The entity synonyms apply to all languages and persist for the
+     * session of this query.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + public java.util.List + getSessionEntityTypesBuilderList() { + return getSessionEntityTypesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder> + getSessionEntityTypesFieldBuilder() { + if (sessionEntityTypesBuilder_ == null) { + sessionEntityTypesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder>( + sessionEntityTypes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + sessionEntityTypes_ = null; + } + return sessionEntityTypesBuilder_; + } + + private com.google.protobuf.Struct payload_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + payloadBuilder_; + /** + * + * + *
+     * This field can be used to pass custom data into the webhook associated with
+     * the agent. Arbitrary JSON objects are supported.
+     * 
+ * + * .google.protobuf.Struct payload = 4; + * + * @return Whether the payload field is set. + */ + public boolean hasPayload() { + return payloadBuilder_ != null || payload_ != null; + } + /** + * + * + *
+     * This field can be used to pass custom data into the webhook associated with
+     * the agent. Arbitrary JSON objects are supported.
+     * 
+ * + * .google.protobuf.Struct payload = 4; + * + * @return The payload. + */ + public com.google.protobuf.Struct getPayload() { + if (payloadBuilder_ == null) { + return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; + } else { + return payloadBuilder_.getMessage(); + } + } + /** + * + * + *
+     * This field can be used to pass custom data into the webhook associated with
+     * the agent. Arbitrary JSON objects are supported.
+     * 
+ * + * .google.protobuf.Struct payload = 4; + */ + public Builder setPayload(com.google.protobuf.Struct value) { + if (payloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + payloadBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * This field can be used to pass custom data into the webhook associated with
+     * the agent. Arbitrary JSON objects are supported.
+     * 
+ * + * .google.protobuf.Struct payload = 4; + */ + public Builder setPayload(com.google.protobuf.Struct.Builder builderForValue) { + if (payloadBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + payloadBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * This field can be used to pass custom data into the webhook associated with
+     * the agent. Arbitrary JSON objects are supported.
+     * 
+ * + * .google.protobuf.Struct payload = 4; + */ + public Builder mergePayload(com.google.protobuf.Struct value) { + if (payloadBuilder_ == null) { + if (payload_ != null) { + payload_ = + com.google.protobuf.Struct.newBuilder(payload_).mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + payloadBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * This field can be used to pass custom data into the webhook associated with
+     * the agent. Arbitrary JSON objects are supported.
+     * 
+ * + * .google.protobuf.Struct payload = 4; + */ + public Builder clearPayload() { + if (payloadBuilder_ == null) { + payload_ = null; + onChanged(); + } else { + payload_ = null; + payloadBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * This field can be used to pass custom data into the webhook associated with
+     * the agent. Arbitrary JSON objects are supported.
+     * 
+ * + * .google.protobuf.Struct payload = 4; + */ + public com.google.protobuf.Struct.Builder getPayloadBuilder() { + + onChanged(); + return getPayloadFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * This field can be used to pass custom data into the webhook associated with
+     * the agent. Arbitrary JSON objects are supported.
+     * 
+ * + * .google.protobuf.Struct payload = 4; + */ + public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { + if (payloadBuilder_ != null) { + return payloadBuilder_.getMessageOrBuilder(); + } else { + return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; + } + } + /** + * + * + *
+     * This field can be used to pass custom data into the webhook associated with
+     * the agent. Arbitrary JSON objects are supported.
+     * 
+ * + * .google.protobuf.Struct payload = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getPayloadFieldBuilder() { + if (payloadBuilder_ == null) { + payloadBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getPayload(), getParentForChildren(), isClean()); + payload_ = null; + } + return payloadBuilder_; + } + + private com.google.protobuf.Struct parameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + parametersBuilder_; + /** + * + * + *
+     * Additional parameters to be put into [session
+     * parameters][SessionInfo.parameters]. To remove a
+     * parameter from the session, clients should explicitly set the parameter
+     * value to null.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 5; + * + * @return Whether the parameters field is set. + */ + public boolean hasParameters() { + return parametersBuilder_ != null || parameters_ != null; + } + /** + * + * + *
+     * Additional parameters to be put into [session
+     * parameters][SessionInfo.parameters]. To remove a
+     * parameter from the session, clients should explicitly set the parameter
+     * value to null.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 5; + * + * @return The parameters. + */ + public com.google.protobuf.Struct getParameters() { + if (parametersBuilder_ == null) { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } else { + return parametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional parameters to be put into [session
+     * parameters][SessionInfo.parameters]. To remove a
+     * parameter from the session, clients should explicitly set the parameter
+     * value to null.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 5; + */ + public Builder setParameters(com.google.protobuf.Struct value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parameters_ = value; + onChanged(); + } else { + parametersBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Additional parameters to be put into [session
+     * parameters][SessionInfo.parameters]. To remove a
+     * parameter from the session, clients should explicitly set the parameter
+     * value to null.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 5; + */ + public Builder setParameters(com.google.protobuf.Struct.Builder builderForValue) { + if (parametersBuilder_ == null) { + parameters_ = builderForValue.build(); + onChanged(); + } else { + parametersBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Additional parameters to be put into [session
+     * parameters][SessionInfo.parameters]. To remove a
+     * parameter from the session, clients should explicitly set the parameter
+     * value to null.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 5; + */ + public Builder mergeParameters(com.google.protobuf.Struct value) { + if (parametersBuilder_ == null) { + if (parameters_ != null) { + parameters_ = + com.google.protobuf.Struct.newBuilder(parameters_).mergeFrom(value).buildPartial(); + } else { + parameters_ = value; + } + onChanged(); + } else { + parametersBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Additional parameters to be put into [session
+     * parameters][SessionInfo.parameters]. To remove a
+     * parameter from the session, clients should explicitly set the parameter
+     * value to null.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 5; + */ + public Builder clearParameters() { + if (parametersBuilder_ == null) { + parameters_ = null; + onChanged(); + } else { + parameters_ = null; + parametersBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Additional parameters to be put into [session
+     * parameters][SessionInfo.parameters]. To remove a
+     * parameter from the session, clients should explicitly set the parameter
+     * value to null.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 5; + */ + public com.google.protobuf.Struct.Builder getParametersBuilder() { + + onChanged(); + return getParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional parameters to be put into [session
+     * parameters][SessionInfo.parameters]. To remove a
+     * parameter from the session, clients should explicitly set the parameter
+     * value to null.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 5; + */ + public com.google.protobuf.StructOrBuilder getParametersOrBuilder() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilder(); + } else { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } + } + /** + * + * + *
+     * Additional parameters to be put into [session
+     * parameters][SessionInfo.parameters]. To remove a
+     * parameter from the session, clients should explicitly set the parameter
+     * value to null.
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getParameters(), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + @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.dialogflow.cx.v3beta1.QueryParameters) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.QueryParameters) + private static final com.google.cloud.dialogflow.cx.v3beta1.QueryParameters DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.QueryParameters(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryParameters getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryParameters parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryParameters(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.dialogflow.cx.v3beta1.QueryParameters getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryParametersOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryParametersOrBuilder.java new file mode 100644 index 000000000..65deafe26 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryParametersOrBuilder.java @@ -0,0 +1,278 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface QueryParametersOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.QueryParameters) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time zone of this conversational query from the [time zone
+   * database](https://www.iana.org/time-zones), e.g., America/New_York,
+   * Europe/Paris. If not provided, the time zone specified in the agent is
+   * used.
+   * 
+ * + * string time_zone = 1; + * + * @return The timeZone. + */ + java.lang.String getTimeZone(); + /** + * + * + *
+   * The time zone of this conversational query from the [time zone
+   * database](https://www.iana.org/time-zones), e.g., America/New_York,
+   * Europe/Paris. If not provided, the time zone specified in the agent is
+   * used.
+   * 
+ * + * string time_zone = 1; + * + * @return The bytes for timeZone. + */ + com.google.protobuf.ByteString getTimeZoneBytes(); + + /** + * + * + *
+   * The geo location of this conversational query.
+   * 
+ * + * .google.type.LatLng geo_location = 2; + * + * @return Whether the geoLocation field is set. + */ + boolean hasGeoLocation(); + /** + * + * + *
+   * The geo location of this conversational query.
+   * 
+ * + * .google.type.LatLng geo_location = 2; + * + * @return The geoLocation. + */ + com.google.type.LatLng getGeoLocation(); + /** + * + * + *
+   * The geo location of this conversational query.
+   * 
+ * + * .google.type.LatLng geo_location = 2; + */ + com.google.type.LatLngOrBuilder getGeoLocationOrBuilder(); + + /** + * + * + *
+   * Additional session entity types to replace or extend developer entity types
+   * with. The entity synonyms apply to all languages and persist for the
+   * session of this query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + java.util.List + getSessionEntityTypesList(); + /** + * + * + *
+   * Additional session entity types to replace or extend developer entity types
+   * with. The entity synonyms apply to all languages and persist for the
+   * session of this query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityTypes(int index); + /** + * + * + *
+   * Additional session entity types to replace or extend developer entity types
+   * with. The entity synonyms apply to all languages and persist for the
+   * session of this query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + int getSessionEntityTypesCount(); + /** + * + * + *
+   * Additional session entity types to replace or extend developer entity types
+   * with. The entity synonyms apply to all languages and persist for the
+   * session of this query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + java.util.List + getSessionEntityTypesOrBuilderList(); + /** + * + * + *
+   * Additional session entity types to replace or extend developer entity types
+   * with. The entity synonyms apply to all languages and persist for the
+   * session of this query.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_types = 3; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder getSessionEntityTypesOrBuilder( + int index); + + /** + * + * + *
+   * This field can be used to pass custom data into the webhook associated with
+   * the agent. Arbitrary JSON objects are supported.
+   * 
+ * + * .google.protobuf.Struct payload = 4; + * + * @return Whether the payload field is set. + */ + boolean hasPayload(); + /** + * + * + *
+   * This field can be used to pass custom data into the webhook associated with
+   * the agent. Arbitrary JSON objects are supported.
+   * 
+ * + * .google.protobuf.Struct payload = 4; + * + * @return The payload. + */ + com.google.protobuf.Struct getPayload(); + /** + * + * + *
+   * This field can be used to pass custom data into the webhook associated with
+   * the agent. Arbitrary JSON objects are supported.
+   * 
+ * + * .google.protobuf.Struct payload = 4; + */ + com.google.protobuf.StructOrBuilder getPayloadOrBuilder(); + + /** + * + * + *
+   * Additional parameters to be put into [session
+   * parameters][SessionInfo.parameters]. To remove a
+   * parameter from the session, clients should explicitly set the parameter
+   * value to null.
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 5; + * + * @return Whether the parameters field is set. + */ + boolean hasParameters(); + /** + * + * + *
+   * Additional parameters to be put into [session
+   * parameters][SessionInfo.parameters]. To remove a
+   * parameter from the session, clients should explicitly set the parameter
+   * value to null.
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 5; + * + * @return The parameters. + */ + com.google.protobuf.Struct getParameters(); + /** + * + * + *
+   * Additional parameters to be put into [session
+   * parameters][SessionInfo.parameters]. To remove a
+   * parameter from the session, clients should explicitly set the parameter
+   * value to null.
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 5; + */ + com.google.protobuf.StructOrBuilder getParametersOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryResult.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryResult.java new file mode 100644 index 000000000..ce42da2a7 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryResult.java @@ -0,0 +1,4911 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Represents the result of a conversational query.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.QueryResult} + */ +public final class QueryResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.QueryResult) + QueryResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryResult.newBuilder() to construct. + private QueryResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryResult() { + languageCode_ = ""; + responseMessages_ = java.util.Collections.emptyList(); + webhookStatuses_ = java.util.Collections.emptyList(); + webhookPayloads_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QueryResult( + 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(); + queryCase_ = 1; + query_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + case 26: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (parameters_ != null) { + subBuilder = parameters_.toBuilder(); + } + parameters_ = + input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(parameters_); + parameters_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + responseMessages_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage>(); + mutable_bitField0_ |= 0x00000001; + } + responseMessages_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.parser(), + extensionRegistry)); + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + webhookPayloads_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + webhookPayloads_.add( + input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry)); + break; + } + case 58: + { + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder subBuilder = null; + if (currentPage_ != null) { + subBuilder = currentPage_.toBuilder(); + } + currentPage_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Page.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(currentPage_); + currentPage_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder subBuilder = null; + if (intent_ != null) { + subBuilder = intent_.toBuilder(); + } + intent_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Intent.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(intent_); + intent_ = subBuilder.buildPartial(); + } + + break; + } + case 77: + { + intentDetectionConfidence_ = input.readFloat(); + break; + } + case 82: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (diagnosticInfo_ != null) { + subBuilder = diagnosticInfo_.toBuilder(); + } + diagnosticInfo_ = + input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(diagnosticInfo_); + diagnosticInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + queryCase_ = 11; + query_ = s; + break; + } + case 98: + { + java.lang.String s = input.readStringRequireUtf8(); + queryCase_ = 12; + query_ = s; + break; + } + case 106: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + webhookStatuses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + webhookStatuses_.add( + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); + break; + } + case 114: + { + java.lang.String s = input.readStringRequireUtf8(); + queryCase_ = 14; + query_ = s; + break; + } + case 122: + { + com.google.cloud.dialogflow.cx.v3beta1.Match.Builder subBuilder = null; + if (match_ != null) { + subBuilder = match_.toBuilder(); + } + match_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Match.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(match_); + match_ = 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)) { + responseMessages_ = java.util.Collections.unmodifiableList(responseMessages_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + webhookPayloads_ = java.util.Collections.unmodifiableList(webhookPayloads_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + webhookStatuses_ = java.util.Collections.unmodifiableList(webhookStatuses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.class, + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.Builder.class); + } + + private int queryCase_ = 0; + private java.lang.Object query_; + + public enum QueryCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TEXT(1), + TRIGGER_INTENT(11), + TRANSCRIPT(12), + TRIGGER_EVENT(14), + QUERY_NOT_SET(0); + private final int value; + + private QueryCase(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 QueryCase valueOf(int value) { + return forNumber(value); + } + + public static QueryCase forNumber(int value) { + switch (value) { + case 1: + return TEXT; + case 11: + return TRIGGER_INTENT; + case 12: + return TRANSCRIPT; + case 14: + return TRIGGER_EVENT; + case 0: + return QUERY_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public QueryCase getQueryCase() { + return QueryCase.forNumber(queryCase_); + } + + public static final int TEXT_FIELD_NUMBER = 1; + /** + * + * + *
+   * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+   * will contain a copy of the text.
+   * 
+ * + * string text = 1; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = ""; + if (queryCase_ == 1) { + ref = query_; + } + 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 (queryCase_ == 1) { + query_ = s; + } + return s; + } + } + /** + * + * + *
+   * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+   * will contain a copy of the text.
+   * 
+ * + * string text = 1; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 1) { + ref = query_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (queryCase_ == 1) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRIGGER_INTENT_FIELD_NUMBER = 11; + /** + * + * + *
+   * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+   * contain a copy of the intent identifier.
+   * 
+ * + * string trigger_intent = 11; + * + * @return The triggerIntent. + */ + public java.lang.String getTriggerIntent() { + java.lang.Object ref = ""; + if (queryCase_ == 11) { + ref = query_; + } + 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 (queryCase_ == 11) { + query_ = s; + } + return s; + } + } + /** + * + * + *
+   * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+   * contain a copy of the intent identifier.
+   * 
+ * + * string trigger_intent = 11; + * + * @return The bytes for triggerIntent. + */ + public com.google.protobuf.ByteString getTriggerIntentBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 11) { + ref = query_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (queryCase_ == 11) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRANSCRIPT_FIELD_NUMBER = 12; + /** + * + * + *
+   * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+   * this field will contain the trascript for the audio.
+   * 
+ * + * string transcript = 12; + * + * @return The transcript. + */ + public java.lang.String getTranscript() { + java.lang.Object ref = ""; + if (queryCase_ == 12) { + ref = query_; + } + 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 (queryCase_ == 12) { + query_ = s; + } + return s; + } + } + /** + * + * + *
+   * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+   * this field will contain the trascript for the audio.
+   * 
+ * + * string transcript = 12; + * + * @return The bytes for transcript. + */ + public com.google.protobuf.ByteString getTranscriptBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 12) { + ref = query_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (queryCase_ == 12) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRIGGER_EVENT_FIELD_NUMBER = 14; + /** + * + * + *
+   * If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided as input, this field will contain
+   * the name of the event.
+   * 
+ * + * string trigger_event = 14; + * + * @return The triggerEvent. + */ + public java.lang.String getTriggerEvent() { + java.lang.Object ref = ""; + if (queryCase_ == 14) { + ref = query_; + } + 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 (queryCase_ == 14) { + query_ = s; + } + return s; + } + } + /** + * + * + *
+   * If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided as input, this field will contain
+   * the name of the event.
+   * 
+ * + * string trigger_event = 14; + * + * @return The bytes for triggerEvent. + */ + public com.google.protobuf.ByteString getTriggerEventBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 14) { + ref = query_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (queryCase_ == 14) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language that was triggered during intent detection.
+   * See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+   * for a list of the currently supported language codes.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language that was triggered during intent detection.
+   * See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+   * for a list of the currently supported language codes.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARAMETERS_FIELD_NUMBER = 3; + private com.google.protobuf.Struct parameters_; + /** + * + * + *
+   * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 3; + * + * @return Whether the parameters field is set. + */ + @java.lang.Override + public boolean hasParameters() { + return parameters_ != null; + } + /** + * + * + *
+   * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 3; + * + * @return The parameters. + */ + @java.lang.Override + public com.google.protobuf.Struct getParameters() { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } + /** + * + * + *
+   * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 3; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getParametersOrBuilder() { + return getParameters(); + } + + public static final int RESPONSE_MESSAGES_FIELD_NUMBER = 4; + private java.util.List responseMessages_; + /** + * + * + *
+   * The list of rich messages returned to the client. Responses vary from
+   * simple text messages to more sophisticated, structured payloads used
+   * to drive complex logic.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + @java.lang.Override + public java.util.List + getResponseMessagesList() { + return responseMessages_; + } + /** + * + * + *
+   * The list of rich messages returned to the client. Responses vary from
+   * simple text messages to more sophisticated, structured payloads used
+   * to drive complex logic.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + @java.lang.Override + public java.util.List + getResponseMessagesOrBuilderList() { + return responseMessages_; + } + /** + * + * + *
+   * The list of rich messages returned to the client. Responses vary from
+   * simple text messages to more sophisticated, structured payloads used
+   * to drive complex logic.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + @java.lang.Override + public int getResponseMessagesCount() { + return responseMessages_.size(); + } + /** + * + * + *
+   * The list of rich messages returned to the client. Responses vary from
+   * simple text messages to more sophisticated, structured payloads used
+   * to drive complex logic.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getResponseMessages(int index) { + return responseMessages_.get(index); + } + /** + * + * + *
+   * The list of rich messages returned to the client. Responses vary from
+   * simple text messages to more sophisticated, structured payloads used
+   * to drive complex logic.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder + getResponseMessagesOrBuilder(int index) { + return responseMessages_.get(index); + } + + public static final int WEBHOOK_STATUSES_FIELD_NUMBER = 13; + private java.util.List webhookStatuses_; + /** + * + * + *
+   * The list of webhook call status in the order of call sequence.
+   * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + @java.lang.Override + public java.util.List getWebhookStatusesList() { + return webhookStatuses_; + } + /** + * + * + *
+   * The list of webhook call status in the order of call sequence.
+   * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + @java.lang.Override + public java.util.List + getWebhookStatusesOrBuilderList() { + return webhookStatuses_; + } + /** + * + * + *
+   * The list of webhook call status in the order of call sequence.
+   * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + @java.lang.Override + public int getWebhookStatusesCount() { + return webhookStatuses_.size(); + } + /** + * + * + *
+   * The list of webhook call status in the order of call sequence.
+   * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + @java.lang.Override + public com.google.rpc.Status getWebhookStatuses(int index) { + return webhookStatuses_.get(index); + } + /** + * + * + *
+   * The list of webhook call status in the order of call sequence.
+   * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getWebhookStatusesOrBuilder(int index) { + return webhookStatuses_.get(index); + } + + public static final int WEBHOOK_PAYLOADS_FIELD_NUMBER = 6; + private java.util.List webhookPayloads_; + /** + * + * + *
+   * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+   * the order of call sequence. If some webhook call fails or doesn't return
+   * any payload, an empty `Struct` would be used instead.
+   * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + @java.lang.Override + public java.util.List getWebhookPayloadsList() { + return webhookPayloads_; + } + /** + * + * + *
+   * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+   * the order of call sequence. If some webhook call fails or doesn't return
+   * any payload, an empty `Struct` would be used instead.
+   * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + @java.lang.Override + public java.util.List + getWebhookPayloadsOrBuilderList() { + return webhookPayloads_; + } + /** + * + * + *
+   * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+   * the order of call sequence. If some webhook call fails or doesn't return
+   * any payload, an empty `Struct` would be used instead.
+   * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + @java.lang.Override + public int getWebhookPayloadsCount() { + return webhookPayloads_.size(); + } + /** + * + * + *
+   * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+   * the order of call sequence. If some webhook call fails or doesn't return
+   * any payload, an empty `Struct` would be used instead.
+   * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + @java.lang.Override + public com.google.protobuf.Struct getWebhookPayloads(int index) { + return webhookPayloads_.get(index); + } + /** + * + * + *
+   * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+   * the order of call sequence. If some webhook call fails or doesn't return
+   * any payload, an empty `Struct` would be used instead.
+   * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getWebhookPayloadsOrBuilder(int index) { + return webhookPayloads_.get(index); + } + + public static final int CURRENT_PAGE_FIELD_NUMBER = 7; + private com.google.cloud.dialogflow.cx.v3beta1.Page currentPage_; + /** + * + * + *
+   * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+   * including but not limited to `name` and `display_name`.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + * + * @return Whether the currentPage field is set. + */ + @java.lang.Override + public boolean hasCurrentPage() { + return currentPage_ != null; + } + /** + * + * + *
+   * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+   * including but not limited to `name` and `display_name`.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + * + * @return The currentPage. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Page getCurrentPage() { + return currentPage_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance() + : currentPage_; + } + /** + * + * + *
+   * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+   * including but not limited to `name` and `display_name`.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getCurrentPageOrBuilder() { + return getCurrentPage(); + } + + public static final int INTENT_FIELD_NUMBER = 8; + private com.google.cloud.dialogflow.cx.v3beta1.Intent intent_; + /** + * + * + *
+   * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+   * are filled in this message, including but not limited to: `name` and
+   * `display_name`.
+   * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + * + * @return Whether the intent field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasIntent() { + return intent_ != null; + } + /** + * + * + *
+   * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+   * are filled in this message, including but not limited to: `name` and
+   * `display_name`.
+   * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + * + * @return The intent. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent() { + return intent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance() + : intent_; + } + /** + * + * + *
+   * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+   * are filled in this message, including but not limited to: `name` and
+   * `display_name`.
+   * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder() { + return getIntent(); + } + + public static final int INTENT_DETECTION_CONFIDENCE_FIELD_NUMBER = 9; + private float intentDetectionConfidence_; + /** + * + * + *
+   * The intent detection confidence. Values range from 0.0 (completely
+   * uncertain) to 1.0 (completely certain).
+   * This value is for informational purpose only and is only used to
+   * help match the best intent within the classification threshold.
+   * This value may change for the same end-user expression at any time due to a
+   * model retraining or change in implementation.
+   * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+   * 
+ * + * float intent_detection_confidence = 9 [deprecated = true]; + * + * @return The intentDetectionConfidence. + */ + @java.lang.Override + @java.lang.Deprecated + public float getIntentDetectionConfidence() { + return intentDetectionConfidence_; + } + + public static final int MATCH_FIELD_NUMBER = 15; + private com.google.cloud.dialogflow.cx.v3beta1.Match match_; + /** + * + * + *
+   * Intent match result, could be an intent or an event.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + * + * @return Whether the match field is set. + */ + @java.lang.Override + public boolean hasMatch() { + return match_ != null; + } + /** + * + * + *
+   * Intent match result, could be an intent or an event.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + * + * @return The match. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Match getMatch() { + return match_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Match.getDefaultInstance() + : match_; + } + /** + * + * + *
+   * Intent match result, could be an intent or an event.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder getMatchOrBuilder() { + return getMatch(); + } + + public static final int DIAGNOSTIC_INFO_FIELD_NUMBER = 10; + private com.google.protobuf.Struct diagnosticInfo_; + /** + * + * + *
+   * The free-form diagnostic info. For example, this field could contain
+   * webhook call latency. The string keys of the Struct's fields map can change
+   * without notice.
+   * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + * + * @return Whether the diagnosticInfo field is set. + */ + @java.lang.Override + public boolean hasDiagnosticInfo() { + return diagnosticInfo_ != null; + } + /** + * + * + *
+   * The free-form diagnostic info. For example, this field could contain
+   * webhook call latency. The string keys of the Struct's fields map can change
+   * without notice.
+   * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + * + * @return The diagnosticInfo. + */ + @java.lang.Override + public com.google.protobuf.Struct getDiagnosticInfo() { + return diagnosticInfo_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : diagnosticInfo_; + } + /** + * + * + *
+   * The free-form diagnostic info. For example, this field could contain
+   * webhook call latency. The string keys of the Struct's fields map can change
+   * without notice.
+   * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getDiagnosticInfoOrBuilder() { + return getDiagnosticInfo(); + } + + 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 (queryCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, query_); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + if (parameters_ != null) { + output.writeMessage(3, getParameters()); + } + for (int i = 0; i < responseMessages_.size(); i++) { + output.writeMessage(4, responseMessages_.get(i)); + } + for (int i = 0; i < webhookPayloads_.size(); i++) { + output.writeMessage(6, webhookPayloads_.get(i)); + } + if (currentPage_ != null) { + output.writeMessage(7, getCurrentPage()); + } + if (intent_ != null) { + output.writeMessage(8, getIntent()); + } + if (intentDetectionConfidence_ != 0F) { + output.writeFloat(9, intentDetectionConfidence_); + } + if (diagnosticInfo_ != null) { + output.writeMessage(10, getDiagnosticInfo()); + } + if (queryCase_ == 11) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, query_); + } + if (queryCase_ == 12) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, query_); + } + for (int i = 0; i < webhookStatuses_.size(); i++) { + output.writeMessage(13, webhookStatuses_.get(i)); + } + if (queryCase_ == 14) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, query_); + } + if (match_ != null) { + output.writeMessage(15, getMatch()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (queryCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, query_); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + if (parameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getParameters()); + } + for (int i = 0; i < responseMessages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, responseMessages_.get(i)); + } + for (int i = 0; i < webhookPayloads_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, webhookPayloads_.get(i)); + } + if (currentPage_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCurrentPage()); + } + if (intent_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getIntent()); + } + if (intentDetectionConfidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(9, intentDetectionConfidence_); + } + if (diagnosticInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getDiagnosticInfo()); + } + if (queryCase_ == 11) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, query_); + } + if (queryCase_ == 12) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, query_); + } + for (int i = 0; i < webhookStatuses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, webhookStatuses_.get(i)); + } + if (queryCase_ == 14) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, query_); + } + if (match_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getMatch()); + } + 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.dialogflow.cx.v3beta1.QueryResult)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.QueryResult other = + (com.google.cloud.dialogflow.cx.v3beta1.QueryResult) obj; + + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (hasParameters() != other.hasParameters()) return false; + if (hasParameters()) { + if (!getParameters().equals(other.getParameters())) return false; + } + if (!getResponseMessagesList().equals(other.getResponseMessagesList())) return false; + if (!getWebhookStatusesList().equals(other.getWebhookStatusesList())) return false; + if (!getWebhookPayloadsList().equals(other.getWebhookPayloadsList())) return false; + if (hasCurrentPage() != other.hasCurrentPage()) return false; + if (hasCurrentPage()) { + if (!getCurrentPage().equals(other.getCurrentPage())) return false; + } + if (hasIntent() != other.hasIntent()) return false; + if (hasIntent()) { + if (!getIntent().equals(other.getIntent())) return false; + } + if (java.lang.Float.floatToIntBits(getIntentDetectionConfidence()) + != java.lang.Float.floatToIntBits(other.getIntentDetectionConfidence())) return false; + if (hasMatch() != other.hasMatch()) return false; + if (hasMatch()) { + if (!getMatch().equals(other.getMatch())) return false; + } + if (hasDiagnosticInfo() != other.hasDiagnosticInfo()) return false; + if (hasDiagnosticInfo()) { + if (!getDiagnosticInfo().equals(other.getDiagnosticInfo())) return false; + } + if (!getQueryCase().equals(other.getQueryCase())) return false; + switch (queryCase_) { + case 1: + if (!getText().equals(other.getText())) return false; + break; + case 11: + if (!getTriggerIntent().equals(other.getTriggerIntent())) return false; + break; + case 12: + if (!getTranscript().equals(other.getTranscript())) return false; + break; + case 14: + if (!getTriggerEvent().equals(other.getTriggerEvent())) 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) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + if (hasParameters()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParameters().hashCode(); + } + if (getResponseMessagesCount() > 0) { + hash = (37 * hash) + RESPONSE_MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getResponseMessagesList().hashCode(); + } + if (getWebhookStatusesCount() > 0) { + hash = (37 * hash) + WEBHOOK_STATUSES_FIELD_NUMBER; + hash = (53 * hash) + getWebhookStatusesList().hashCode(); + } + if (getWebhookPayloadsCount() > 0) { + hash = (37 * hash) + WEBHOOK_PAYLOADS_FIELD_NUMBER; + hash = (53 * hash) + getWebhookPayloadsList().hashCode(); + } + if (hasCurrentPage()) { + hash = (37 * hash) + CURRENT_PAGE_FIELD_NUMBER; + hash = (53 * hash) + getCurrentPage().hashCode(); + } + if (hasIntent()) { + hash = (37 * hash) + INTENT_FIELD_NUMBER; + hash = (53 * hash) + getIntent().hashCode(); + } + hash = (37 * hash) + INTENT_DETECTION_CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getIntentDetectionConfidence()); + if (hasMatch()) { + hash = (37 * hash) + MATCH_FIELD_NUMBER; + hash = (53 * hash) + getMatch().hashCode(); + } + if (hasDiagnosticInfo()) { + hash = (37 * hash) + DIAGNOSTIC_INFO_FIELD_NUMBER; + hash = (53 * hash) + getDiagnosticInfo().hashCode(); + } + switch (queryCase_) { + case 1: + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 11: + hash = (37 * hash) + TRIGGER_INTENT_FIELD_NUMBER; + hash = (53 * hash) + getTriggerIntent().hashCode(); + break; + case 12: + hash = (37 * hash) + TRANSCRIPT_FIELD_NUMBER; + hash = (53 * hash) + getTranscript().hashCode(); + break; + case 14: + hash = (37 * hash) + TRIGGER_EVENT_FIELD_NUMBER; + hash = (53 * hash) + getTriggerEvent().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryResult 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.dialogflow.cx.v3beta1.QueryResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryResult 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.dialogflow.cx.v3beta1.QueryResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryResult 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.dialogflow.cx.v3beta1.QueryResult parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryResult 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.dialogflow.cx.v3beta1.QueryResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryResult 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.dialogflow.cx.v3beta1.QueryResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the result of a conversational query.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.QueryResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.QueryResult) + com.google.cloud.dialogflow.cx.v3beta1.QueryResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.class, + com.google.cloud.dialogflow.cx.v3beta1.QueryResult.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.QueryResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResponseMessagesFieldBuilder(); + getWebhookStatusesFieldBuilder(); + getWebhookPayloadsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + languageCode_ = ""; + + if (parametersBuilder_ == null) { + parameters_ = null; + } else { + parameters_ = null; + parametersBuilder_ = null; + } + if (responseMessagesBuilder_ == null) { + responseMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + responseMessagesBuilder_.clear(); + } + if (webhookStatusesBuilder_ == null) { + webhookStatuses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + webhookStatusesBuilder_.clear(); + } + if (webhookPayloadsBuilder_ == null) { + webhookPayloads_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + webhookPayloadsBuilder_.clear(); + } + if (currentPageBuilder_ == null) { + currentPage_ = null; + } else { + currentPage_ = null; + currentPageBuilder_ = null; + } + if (intentBuilder_ == null) { + intent_ = null; + } else { + intent_ = null; + intentBuilder_ = null; + } + intentDetectionConfidence_ = 0F; + + if (matchBuilder_ == null) { + match_ = null; + } else { + match_ = null; + matchBuilder_ = null; + } + if (diagnosticInfoBuilder_ == null) { + diagnosticInfo_ = null; + } else { + diagnosticInfo_ = null; + diagnosticInfoBuilder_ = null; + } + queryCase_ = 0; + query_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryResult getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.QueryResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryResult build() { + com.google.cloud.dialogflow.cx.v3beta1.QueryResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryResult buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.QueryResult result = + new com.google.cloud.dialogflow.cx.v3beta1.QueryResult(this); + int from_bitField0_ = bitField0_; + if (queryCase_ == 1) { + result.query_ = query_; + } + if (queryCase_ == 11) { + result.query_ = query_; + } + if (queryCase_ == 12) { + result.query_ = query_; + } + if (queryCase_ == 14) { + result.query_ = query_; + } + result.languageCode_ = languageCode_; + if (parametersBuilder_ == null) { + result.parameters_ = parameters_; + } else { + result.parameters_ = parametersBuilder_.build(); + } + if (responseMessagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + responseMessages_ = java.util.Collections.unmodifiableList(responseMessages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.responseMessages_ = responseMessages_; + } else { + result.responseMessages_ = responseMessagesBuilder_.build(); + } + if (webhookStatusesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + webhookStatuses_ = java.util.Collections.unmodifiableList(webhookStatuses_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.webhookStatuses_ = webhookStatuses_; + } else { + result.webhookStatuses_ = webhookStatusesBuilder_.build(); + } + if (webhookPayloadsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + webhookPayloads_ = java.util.Collections.unmodifiableList(webhookPayloads_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.webhookPayloads_ = webhookPayloads_; + } else { + result.webhookPayloads_ = webhookPayloadsBuilder_.build(); + } + if (currentPageBuilder_ == null) { + result.currentPage_ = currentPage_; + } else { + result.currentPage_ = currentPageBuilder_.build(); + } + if (intentBuilder_ == null) { + result.intent_ = intent_; + } else { + result.intent_ = intentBuilder_.build(); + } + result.intentDetectionConfidence_ = intentDetectionConfidence_; + if (matchBuilder_ == null) { + result.match_ = match_; + } else { + result.match_ = matchBuilder_.build(); + } + if (diagnosticInfoBuilder_ == null) { + result.diagnosticInfo_ = diagnosticInfo_; + } else { + result.diagnosticInfo_ = diagnosticInfoBuilder_.build(); + } + result.queryCase_ = queryCase_; + 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.dialogflow.cx.v3beta1.QueryResult) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.QueryResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.QueryResult other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.QueryResult.getDefaultInstance()) + return this; + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + if (other.hasParameters()) { + mergeParameters(other.getParameters()); + } + if (responseMessagesBuilder_ == null) { + if (!other.responseMessages_.isEmpty()) { + if (responseMessages_.isEmpty()) { + responseMessages_ = other.responseMessages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResponseMessagesIsMutable(); + responseMessages_.addAll(other.responseMessages_); + } + onChanged(); + } + } else { + if (!other.responseMessages_.isEmpty()) { + if (responseMessagesBuilder_.isEmpty()) { + responseMessagesBuilder_.dispose(); + responseMessagesBuilder_ = null; + responseMessages_ = other.responseMessages_; + bitField0_ = (bitField0_ & ~0x00000001); + responseMessagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResponseMessagesFieldBuilder() + : null; + } else { + responseMessagesBuilder_.addAllMessages(other.responseMessages_); + } + } + } + if (webhookStatusesBuilder_ == null) { + if (!other.webhookStatuses_.isEmpty()) { + if (webhookStatuses_.isEmpty()) { + webhookStatuses_ = other.webhookStatuses_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureWebhookStatusesIsMutable(); + webhookStatuses_.addAll(other.webhookStatuses_); + } + onChanged(); + } + } else { + if (!other.webhookStatuses_.isEmpty()) { + if (webhookStatusesBuilder_.isEmpty()) { + webhookStatusesBuilder_.dispose(); + webhookStatusesBuilder_ = null; + webhookStatuses_ = other.webhookStatuses_; + bitField0_ = (bitField0_ & ~0x00000002); + webhookStatusesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWebhookStatusesFieldBuilder() + : null; + } else { + webhookStatusesBuilder_.addAllMessages(other.webhookStatuses_); + } + } + } + if (webhookPayloadsBuilder_ == null) { + if (!other.webhookPayloads_.isEmpty()) { + if (webhookPayloads_.isEmpty()) { + webhookPayloads_ = other.webhookPayloads_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureWebhookPayloadsIsMutable(); + webhookPayloads_.addAll(other.webhookPayloads_); + } + onChanged(); + } + } else { + if (!other.webhookPayloads_.isEmpty()) { + if (webhookPayloadsBuilder_.isEmpty()) { + webhookPayloadsBuilder_.dispose(); + webhookPayloadsBuilder_ = null; + webhookPayloads_ = other.webhookPayloads_; + bitField0_ = (bitField0_ & ~0x00000004); + webhookPayloadsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWebhookPayloadsFieldBuilder() + : null; + } else { + webhookPayloadsBuilder_.addAllMessages(other.webhookPayloads_); + } + } + } + if (other.hasCurrentPage()) { + mergeCurrentPage(other.getCurrentPage()); + } + if (other.hasIntent()) { + mergeIntent(other.getIntent()); + } + if (other.getIntentDetectionConfidence() != 0F) { + setIntentDetectionConfidence(other.getIntentDetectionConfidence()); + } + if (other.hasMatch()) { + mergeMatch(other.getMatch()); + } + if (other.hasDiagnosticInfo()) { + mergeDiagnosticInfo(other.getDiagnosticInfo()); + } + switch (other.getQueryCase()) { + case TEXT: + { + queryCase_ = 1; + query_ = other.query_; + onChanged(); + break; + } + case TRIGGER_INTENT: + { + queryCase_ = 11; + query_ = other.query_; + onChanged(); + break; + } + case TRANSCRIPT: + { + queryCase_ = 12; + query_ = other.query_; + onChanged(); + break; + } + case TRIGGER_EVENT: + { + queryCase_ = 14; + query_ = other.query_; + onChanged(); + break; + } + case QUERY_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.dialogflow.cx.v3beta1.QueryResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.QueryResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int queryCase_ = 0; + private java.lang.Object query_; + + public QueryCase getQueryCase() { + return QueryCase.forNumber(queryCase_); + } + + public Builder clearQuery() { + queryCase_ = 0; + query_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+     * will contain a copy of the text.
+     * 
+ * + * string text = 1; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = ""; + if (queryCase_ == 1) { + ref = query_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (queryCase_ == 1) { + query_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+     * will contain a copy of the text.
+     * 
+ * + * string text = 1; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 1) { + ref = query_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (queryCase_ == 1) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+     * will contain a copy of the text.
+     * 
+ * + * string text = 1; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + queryCase_ = 1; + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+     * will contain a copy of the text.
+     * 
+ * + * string text = 1; + * + * @return This builder for chaining. + */ + public Builder clearText() { + if (queryCase_ == 1) { + queryCase_ = 0; + query_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+     * will contain a copy of the text.
+     * 
+ * + * string text = 1; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + queryCase_ = 1; + query_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+     * contain a copy of the intent identifier.
+     * 
+ * + * string trigger_intent = 11; + * + * @return The triggerIntent. + */ + @java.lang.Override + public java.lang.String getTriggerIntent() { + java.lang.Object ref = ""; + if (queryCase_ == 11) { + ref = query_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (queryCase_ == 11) { + query_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+     * contain a copy of the intent identifier.
+     * 
+ * + * string trigger_intent = 11; + * + * @return The bytes for triggerIntent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTriggerIntentBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 11) { + ref = query_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (queryCase_ == 11) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+     * contain a copy of the intent identifier.
+     * 
+ * + * string trigger_intent = 11; + * + * @param value The triggerIntent to set. + * @return This builder for chaining. + */ + public Builder setTriggerIntent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + queryCase_ = 11; + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+     * contain a copy of the intent identifier.
+     * 
+ * + * string trigger_intent = 11; + * + * @return This builder for chaining. + */ + public Builder clearTriggerIntent() { + if (queryCase_ == 11) { + queryCase_ = 0; + query_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+     * contain a copy of the intent identifier.
+     * 
+ * + * string trigger_intent = 11; + * + * @param value The bytes for triggerIntent to set. + * @return This builder for chaining. + */ + public Builder setTriggerIntentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + queryCase_ = 11; + query_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+     * this field will contain the trascript for the audio.
+     * 
+ * + * string transcript = 12; + * + * @return The transcript. + */ + @java.lang.Override + public java.lang.String getTranscript() { + java.lang.Object ref = ""; + if (queryCase_ == 12) { + ref = query_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (queryCase_ == 12) { + query_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+     * this field will contain the trascript for the audio.
+     * 
+ * + * string transcript = 12; + * + * @return The bytes for transcript. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTranscriptBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 12) { + ref = query_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (queryCase_ == 12) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+     * this field will contain the trascript for the audio.
+     * 
+ * + * string transcript = 12; + * + * @param value The transcript to set. + * @return This builder for chaining. + */ + public Builder setTranscript(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + queryCase_ = 12; + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+     * this field will contain the trascript for the audio.
+     * 
+ * + * string transcript = 12; + * + * @return This builder for chaining. + */ + public Builder clearTranscript() { + if (queryCase_ == 12) { + queryCase_ = 0; + query_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+     * this field will contain the trascript for the audio.
+     * 
+ * + * string transcript = 12; + * + * @param value The bytes for transcript to set. + * @return This builder for chaining. + */ + public Builder setTranscriptBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + queryCase_ = 12; + query_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided as input, this field will contain
+     * the name of the event.
+     * 
+ * + * string trigger_event = 14; + * + * @return The triggerEvent. + */ + @java.lang.Override + public java.lang.String getTriggerEvent() { + java.lang.Object ref = ""; + if (queryCase_ == 14) { + ref = query_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (queryCase_ == 14) { + query_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided as input, this field will contain
+     * the name of the event.
+     * 
+ * + * string trigger_event = 14; + * + * @return The bytes for triggerEvent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTriggerEventBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 14) { + ref = query_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (queryCase_ == 14) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided as input, this field will contain
+     * the name of the event.
+     * 
+ * + * string trigger_event = 14; + * + * @param value The triggerEvent to set. + * @return This builder for chaining. + */ + public Builder setTriggerEvent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + queryCase_ = 14; + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided as input, this field will contain
+     * the name of the event.
+     * 
+ * + * string trigger_event = 14; + * + * @return This builder for chaining. + */ + public Builder clearTriggerEvent() { + if (queryCase_ == 14) { + queryCase_ = 0; + query_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided as input, this field will contain
+     * the name of the event.
+     * 
+ * + * string trigger_event = 14; + * + * @param value The bytes for triggerEvent to set. + * @return This builder for chaining. + */ + public Builder setTriggerEventBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + queryCase_ = 14; + query_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language that was triggered during intent detection.
+     * See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language that was triggered during intent detection.
+     * See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language that was triggered during intent detection.
+     * See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * 
+ * + * string language_code = 2; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language that was triggered during intent detection.
+     * See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * 
+ * + * string language_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language that was triggered during intent detection.
+     * See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * 
+ * + * string language_code = 2; + * + * @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.Struct parameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + parametersBuilder_; + /** + * + * + *
+     * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 3; + * + * @return Whether the parameters field is set. + */ + public boolean hasParameters() { + return parametersBuilder_ != null || parameters_ != null; + } + /** + * + * + *
+     * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 3; + * + * @return The parameters. + */ + public com.google.protobuf.Struct getParameters() { + if (parametersBuilder_ == null) { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } else { + return parametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 3; + */ + public Builder setParameters(com.google.protobuf.Struct value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parameters_ = value; + onChanged(); + } else { + parametersBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 3; + */ + public Builder setParameters(com.google.protobuf.Struct.Builder builderForValue) { + if (parametersBuilder_ == null) { + parameters_ = builderForValue.build(); + onChanged(); + } else { + parametersBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 3; + */ + public Builder mergeParameters(com.google.protobuf.Struct value) { + if (parametersBuilder_ == null) { + if (parameters_ != null) { + parameters_ = + com.google.protobuf.Struct.newBuilder(parameters_).mergeFrom(value).buildPartial(); + } else { + parameters_ = value; + } + onChanged(); + } else { + parametersBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 3; + */ + public Builder clearParameters() { + if (parametersBuilder_ == null) { + parameters_ = null; + onChanged(); + } else { + parameters_ = null; + parametersBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 3; + */ + public com.google.protobuf.Struct.Builder getParametersBuilder() { + + onChanged(); + return getParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 3; + */ + public com.google.protobuf.StructOrBuilder getParametersOrBuilder() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilder(); + } else { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } + } + /** + * + * + *
+     * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+     * Depending on your protocol or client library language, this is a
+     * map, associative array, symbol table, dictionary, or JSON object
+     * composed of a collection of (MapKey, MapValue) pairs:
+     * -   MapKey type: string
+     * -   MapKey value: parameter name
+     * -   MapValue type:
+     *     -   If parameter's entity type is a composite entity: map
+     *     -   Else: string or number, depending on parameter value type
+     * -   MapValue value:
+     *     -   If parameter's entity type is a composite entity:
+     *         map from composite entity property names to property values
+     *     -   Else: parameter value
+     * 
+ * + * .google.protobuf.Struct parameters = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getParameters(), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + private java.util.List + responseMessages_ = java.util.Collections.emptyList(); + + private void ensureResponseMessagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + responseMessages_ = + new java.util.ArrayList( + responseMessages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder> + responseMessagesBuilder_; + + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public java.util.List + getResponseMessagesList() { + if (responseMessagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responseMessages_); + } else { + return responseMessagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public int getResponseMessagesCount() { + if (responseMessagesBuilder_ == null) { + return responseMessages_.size(); + } else { + return responseMessagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getResponseMessages(int index) { + if (responseMessagesBuilder_ == null) { + return responseMessages_.get(index); + } else { + return responseMessagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public Builder setResponseMessages( + int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) { + if (responseMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponseMessagesIsMutable(); + responseMessages_.set(index, value); + onChanged(); + } else { + responseMessagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public Builder setResponseMessages( + int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + responseMessages_.set(index, builderForValue.build()); + onChanged(); + } else { + responseMessagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public Builder addResponseMessages( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) { + if (responseMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponseMessagesIsMutable(); + responseMessages_.add(value); + onChanged(); + } else { + responseMessagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public Builder addResponseMessages( + int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) { + if (responseMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponseMessagesIsMutable(); + responseMessages_.add(index, value); + onChanged(); + } else { + responseMessagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public Builder addResponseMessages( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + responseMessages_.add(builderForValue.build()); + onChanged(); + } else { + responseMessagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public Builder addResponseMessages( + int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + responseMessages_.add(index, builderForValue.build()); + onChanged(); + } else { + responseMessagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public Builder addAllResponseMessages( + java.lang.Iterable + values) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responseMessages_); + onChanged(); + } else { + responseMessagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public Builder clearResponseMessages() { + if (responseMessagesBuilder_ == null) { + responseMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + responseMessagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public Builder removeResponseMessages(int index) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + responseMessages_.remove(index); + onChanged(); + } else { + responseMessagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder + getResponseMessagesBuilder(int index) { + return getResponseMessagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder + getResponseMessagesOrBuilder(int index) { + if (responseMessagesBuilder_ == null) { + return responseMessages_.get(index); + } else { + return responseMessagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public java.util.List + getResponseMessagesOrBuilderList() { + if (responseMessagesBuilder_ != null) { + return responseMessagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responseMessages_); + } + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder + addResponseMessagesBuilder() { + return getResponseMessagesFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance()); + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder + addResponseMessagesBuilder(int index) { + return getResponseMessagesFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance()); + } + /** + * + * + *
+     * The list of rich messages returned to the client. Responses vary from
+     * simple text messages to more sophisticated, structured payloads used
+     * to drive complex logic.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + public java.util.List + getResponseMessagesBuilderList() { + return getResponseMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder> + getResponseMessagesFieldBuilder() { + if (responseMessagesBuilder_ == null) { + responseMessagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder>( + responseMessages_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + responseMessages_ = null; + } + return responseMessagesBuilder_; + } + + private java.util.List webhookStatuses_ = + java.util.Collections.emptyList(); + + private void ensureWebhookStatusesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + webhookStatuses_ = new java.util.ArrayList(webhookStatuses_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + webhookStatusesBuilder_; + + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public java.util.List getWebhookStatusesList() { + if (webhookStatusesBuilder_ == null) { + return java.util.Collections.unmodifiableList(webhookStatuses_); + } else { + return webhookStatusesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public int getWebhookStatusesCount() { + if (webhookStatusesBuilder_ == null) { + return webhookStatuses_.size(); + } else { + return webhookStatusesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public com.google.rpc.Status getWebhookStatuses(int index) { + if (webhookStatusesBuilder_ == null) { + return webhookStatuses_.get(index); + } else { + return webhookStatusesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public Builder setWebhookStatuses(int index, com.google.rpc.Status value) { + if (webhookStatusesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWebhookStatusesIsMutable(); + webhookStatuses_.set(index, value); + onChanged(); + } else { + webhookStatusesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public Builder setWebhookStatuses(int index, com.google.rpc.Status.Builder builderForValue) { + if (webhookStatusesBuilder_ == null) { + ensureWebhookStatusesIsMutable(); + webhookStatuses_.set(index, builderForValue.build()); + onChanged(); + } else { + webhookStatusesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public Builder addWebhookStatuses(com.google.rpc.Status value) { + if (webhookStatusesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWebhookStatusesIsMutable(); + webhookStatuses_.add(value); + onChanged(); + } else { + webhookStatusesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public Builder addWebhookStatuses(int index, com.google.rpc.Status value) { + if (webhookStatusesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWebhookStatusesIsMutable(); + webhookStatuses_.add(index, value); + onChanged(); + } else { + webhookStatusesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public Builder addWebhookStatuses(com.google.rpc.Status.Builder builderForValue) { + if (webhookStatusesBuilder_ == null) { + ensureWebhookStatusesIsMutable(); + webhookStatuses_.add(builderForValue.build()); + onChanged(); + } else { + webhookStatusesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public Builder addWebhookStatuses(int index, com.google.rpc.Status.Builder builderForValue) { + if (webhookStatusesBuilder_ == null) { + ensureWebhookStatusesIsMutable(); + webhookStatuses_.add(index, builderForValue.build()); + onChanged(); + } else { + webhookStatusesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public Builder addAllWebhookStatuses( + java.lang.Iterable values) { + if (webhookStatusesBuilder_ == null) { + ensureWebhookStatusesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, webhookStatuses_); + onChanged(); + } else { + webhookStatusesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public Builder clearWebhookStatuses() { + if (webhookStatusesBuilder_ == null) { + webhookStatuses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + webhookStatusesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public Builder removeWebhookStatuses(int index) { + if (webhookStatusesBuilder_ == null) { + ensureWebhookStatusesIsMutable(); + webhookStatuses_.remove(index); + onChanged(); + } else { + webhookStatusesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public com.google.rpc.Status.Builder getWebhookStatusesBuilder(int index) { + return getWebhookStatusesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public com.google.rpc.StatusOrBuilder getWebhookStatusesOrBuilder(int index) { + if (webhookStatusesBuilder_ == null) { + return webhookStatuses_.get(index); + } else { + return webhookStatusesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public java.util.List + getWebhookStatusesOrBuilderList() { + if (webhookStatusesBuilder_ != null) { + return webhookStatusesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(webhookStatuses_); + } + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public com.google.rpc.Status.Builder addWebhookStatusesBuilder() { + return getWebhookStatusesFieldBuilder() + .addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public com.google.rpc.Status.Builder addWebhookStatusesBuilder(int index) { + return getWebhookStatusesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * The list of webhook call status in the order of call sequence.
+     * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + public java.util.List getWebhookStatusesBuilderList() { + return getWebhookStatusesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getWebhookStatusesFieldBuilder() { + if (webhookStatusesBuilder_ == null) { + webhookStatusesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + webhookStatuses_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + webhookStatuses_ = null; + } + return webhookStatusesBuilder_; + } + + private java.util.List webhookPayloads_ = + java.util.Collections.emptyList(); + + private void ensureWebhookPayloadsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + webhookPayloads_ = new java.util.ArrayList(webhookPayloads_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + webhookPayloadsBuilder_; + + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public java.util.List getWebhookPayloadsList() { + if (webhookPayloadsBuilder_ == null) { + return java.util.Collections.unmodifiableList(webhookPayloads_); + } else { + return webhookPayloadsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public int getWebhookPayloadsCount() { + if (webhookPayloadsBuilder_ == null) { + return webhookPayloads_.size(); + } else { + return webhookPayloadsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public com.google.protobuf.Struct getWebhookPayloads(int index) { + if (webhookPayloadsBuilder_ == null) { + return webhookPayloads_.get(index); + } else { + return webhookPayloadsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public Builder setWebhookPayloads(int index, com.google.protobuf.Struct value) { + if (webhookPayloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWebhookPayloadsIsMutable(); + webhookPayloads_.set(index, value); + onChanged(); + } else { + webhookPayloadsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public Builder setWebhookPayloads( + int index, com.google.protobuf.Struct.Builder builderForValue) { + if (webhookPayloadsBuilder_ == null) { + ensureWebhookPayloadsIsMutable(); + webhookPayloads_.set(index, builderForValue.build()); + onChanged(); + } else { + webhookPayloadsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public Builder addWebhookPayloads(com.google.protobuf.Struct value) { + if (webhookPayloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWebhookPayloadsIsMutable(); + webhookPayloads_.add(value); + onChanged(); + } else { + webhookPayloadsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public Builder addWebhookPayloads(int index, com.google.protobuf.Struct value) { + if (webhookPayloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWebhookPayloadsIsMutable(); + webhookPayloads_.add(index, value); + onChanged(); + } else { + webhookPayloadsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public Builder addWebhookPayloads(com.google.protobuf.Struct.Builder builderForValue) { + if (webhookPayloadsBuilder_ == null) { + ensureWebhookPayloadsIsMutable(); + webhookPayloads_.add(builderForValue.build()); + onChanged(); + } else { + webhookPayloadsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public Builder addWebhookPayloads( + int index, com.google.protobuf.Struct.Builder builderForValue) { + if (webhookPayloadsBuilder_ == null) { + ensureWebhookPayloadsIsMutable(); + webhookPayloads_.add(index, builderForValue.build()); + onChanged(); + } else { + webhookPayloadsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public Builder addAllWebhookPayloads( + java.lang.Iterable values) { + if (webhookPayloadsBuilder_ == null) { + ensureWebhookPayloadsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, webhookPayloads_); + onChanged(); + } else { + webhookPayloadsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public Builder clearWebhookPayloads() { + if (webhookPayloadsBuilder_ == null) { + webhookPayloads_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + webhookPayloadsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public Builder removeWebhookPayloads(int index) { + if (webhookPayloadsBuilder_ == null) { + ensureWebhookPayloadsIsMutable(); + webhookPayloads_.remove(index); + onChanged(); + } else { + webhookPayloadsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public com.google.protobuf.Struct.Builder getWebhookPayloadsBuilder(int index) { + return getWebhookPayloadsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public com.google.protobuf.StructOrBuilder getWebhookPayloadsOrBuilder(int index) { + if (webhookPayloadsBuilder_ == null) { + return webhookPayloads_.get(index); + } else { + return webhookPayloadsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public java.util.List + getWebhookPayloadsOrBuilderList() { + if (webhookPayloadsBuilder_ != null) { + return webhookPayloadsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(webhookPayloads_); + } + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public com.google.protobuf.Struct.Builder addWebhookPayloadsBuilder() { + return getWebhookPayloadsFieldBuilder() + .addBuilder(com.google.protobuf.Struct.getDefaultInstance()); + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public com.google.protobuf.Struct.Builder addWebhookPayloadsBuilder(int index) { + return getWebhookPayloadsFieldBuilder() + .addBuilder(index, com.google.protobuf.Struct.getDefaultInstance()); + } + /** + * + * + *
+     * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+     * the order of call sequence. If some webhook call fails or doesn't return
+     * any payload, an empty `Struct` would be used instead.
+     * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + public java.util.List getWebhookPayloadsBuilderList() { + return getWebhookPayloadsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getWebhookPayloadsFieldBuilder() { + if (webhookPayloadsBuilder_ == null) { + webhookPayloadsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + webhookPayloads_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + webhookPayloads_ = null; + } + return webhookPayloadsBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Page currentPage_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder> + currentPageBuilder_; + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + * + * @return Whether the currentPage field is set. + */ + public boolean hasCurrentPage() { + return currentPageBuilder_ != null || currentPage_ != null; + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + * + * @return The currentPage. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Page getCurrentPage() { + if (currentPageBuilder_ == null) { + return currentPage_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance() + : currentPage_; + } else { + return currentPageBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + */ + public Builder setCurrentPage(com.google.cloud.dialogflow.cx.v3beta1.Page value) { + if (currentPageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + currentPage_ = value; + onChanged(); + } else { + currentPageBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + */ + public Builder setCurrentPage( + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder builderForValue) { + if (currentPageBuilder_ == null) { + currentPage_ = builderForValue.build(); + onChanged(); + } else { + currentPageBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + */ + public Builder mergeCurrentPage(com.google.cloud.dialogflow.cx.v3beta1.Page value) { + if (currentPageBuilder_ == null) { + if (currentPage_ != null) { + currentPage_ = + com.google.cloud.dialogflow.cx.v3beta1.Page.newBuilder(currentPage_) + .mergeFrom(value) + .buildPartial(); + } else { + currentPage_ = value; + } + onChanged(); + } else { + currentPageBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + */ + public Builder clearCurrentPage() { + if (currentPageBuilder_ == null) { + currentPage_ = null; + onChanged(); + } else { + currentPage_ = null; + currentPageBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Page.Builder getCurrentPageBuilder() { + + onChanged(); + return getCurrentPageFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getCurrentPageOrBuilder() { + if (currentPageBuilder_ != null) { + return currentPageBuilder_.getMessageOrBuilder(); + } else { + return currentPage_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance() + : currentPage_; + } + } + /** + * + * + *
+     * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+     * including but not limited to `name` and `display_name`.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder> + getCurrentPageFieldBuilder() { + if (currentPageBuilder_ == null) { + currentPageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder>( + getCurrentPage(), getParentForChildren(), isClean()); + currentPage_ = null; + } + return currentPageBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Intent intent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder> + intentBuilder_; + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+     * are filled in this message, including but not limited to: `name` and
+     * `display_name`.
+     * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + * + * @return Whether the intent field is set. + */ + @java.lang.Deprecated + public boolean hasIntent() { + return intentBuilder_ != null || intent_ != null; + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+     * are filled in this message, including but not limited to: `name` and
+     * `display_name`.
+     * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + * + * @return The intent. + */ + @java.lang.Deprecated + public com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent() { + if (intentBuilder_ == null) { + return intent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance() + : intent_; + } else { + return intentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+     * are filled in this message, including but not limited to: `name` and
+     * `display_name`.
+     * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setIntent(com.google.cloud.dialogflow.cx.v3beta1.Intent value) { + if (intentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + intent_ = value; + onChanged(); + } else { + intentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+     * are filled in this message, including but not limited to: `name` and
+     * `display_name`.
+     * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setIntent( + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder builderForValue) { + if (intentBuilder_ == null) { + intent_ = builderForValue.build(); + onChanged(); + } else { + intentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+     * are filled in this message, including but not limited to: `name` and
+     * `display_name`.
+     * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder mergeIntent(com.google.cloud.dialogflow.cx.v3beta1.Intent value) { + if (intentBuilder_ == null) { + if (intent_ != null) { + intent_ = + com.google.cloud.dialogflow.cx.v3beta1.Intent.newBuilder(intent_) + .mergeFrom(value) + .buildPartial(); + } else { + intent_ = value; + } + onChanged(); + } else { + intentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+     * are filled in this message, including but not limited to: `name` and
+     * `display_name`.
+     * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder clearIntent() { + if (intentBuilder_ == null) { + intent_ = null; + onChanged(); + } else { + intent_ = null; + intentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+     * are filled in this message, including but not limited to: `name` and
+     * `display_name`.
+     * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder getIntentBuilder() { + + onChanged(); + return getIntentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+     * are filled in this message, including but not limited to: `name` and
+     * `display_name`.
+     * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder() { + if (intentBuilder_ != null) { + return intentBuilder_.getMessageOrBuilder(); + } else { + return intent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance() + : intent_; + } + } + /** + * + * + *
+     * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+     * are filled in this message, including but not limited to: `name` and
+     * `display_name`.
+     * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder> + getIntentFieldBuilder() { + if (intentBuilder_ == null) { + intentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder>( + getIntent(), getParentForChildren(), isClean()); + intent_ = null; + } + return intentBuilder_; + } + + private float intentDetectionConfidence_; + /** + * + * + *
+     * The intent detection confidence. Values range from 0.0 (completely
+     * uncertain) to 1.0 (completely certain).
+     * This value is for informational purpose only and is only used to
+     * help match the best intent within the classification threshold.
+     * This value may change for the same end-user expression at any time due to a
+     * model retraining or change in implementation.
+     * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+     * 
+ * + * float intent_detection_confidence = 9 [deprecated = true]; + * + * @return The intentDetectionConfidence. + */ + @java.lang.Override + @java.lang.Deprecated + public float getIntentDetectionConfidence() { + return intentDetectionConfidence_; + } + /** + * + * + *
+     * The intent detection confidence. Values range from 0.0 (completely
+     * uncertain) to 1.0 (completely certain).
+     * This value is for informational purpose only and is only used to
+     * help match the best intent within the classification threshold.
+     * This value may change for the same end-user expression at any time due to a
+     * model retraining or change in implementation.
+     * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+     * 
+ * + * float intent_detection_confidence = 9 [deprecated = true]; + * + * @param value The intentDetectionConfidence to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setIntentDetectionConfidence(float value) { + + intentDetectionConfidence_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The intent detection confidence. Values range from 0.0 (completely
+     * uncertain) to 1.0 (completely certain).
+     * This value is for informational purpose only and is only used to
+     * help match the best intent within the classification threshold.
+     * This value may change for the same end-user expression at any time due to a
+     * model retraining or change in implementation.
+     * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+     * 
+ * + * float intent_detection_confidence = 9 [deprecated = true]; + * + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearIntentDetectionConfidence() { + + intentDetectionConfidence_ = 0F; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Match match_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Match, + com.google.cloud.dialogflow.cx.v3beta1.Match.Builder, + com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder> + matchBuilder_; + /** + * + * + *
+     * Intent match result, could be an intent or an event.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + * + * @return Whether the match field is set. + */ + public boolean hasMatch() { + return matchBuilder_ != null || match_ != null; + } + /** + * + * + *
+     * Intent match result, could be an intent or an event.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + * + * @return The match. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Match getMatch() { + if (matchBuilder_ == null) { + return match_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Match.getDefaultInstance() + : match_; + } else { + return matchBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Intent match result, could be an intent or an event.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + */ + public Builder setMatch(com.google.cloud.dialogflow.cx.v3beta1.Match value) { + if (matchBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + match_ = value; + onChanged(); + } else { + matchBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Intent match result, could be an intent or an event.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + */ + public Builder setMatch(com.google.cloud.dialogflow.cx.v3beta1.Match.Builder builderForValue) { + if (matchBuilder_ == null) { + match_ = builderForValue.build(); + onChanged(); + } else { + matchBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Intent match result, could be an intent or an event.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + */ + public Builder mergeMatch(com.google.cloud.dialogflow.cx.v3beta1.Match value) { + if (matchBuilder_ == null) { + if (match_ != null) { + match_ = + com.google.cloud.dialogflow.cx.v3beta1.Match.newBuilder(match_) + .mergeFrom(value) + .buildPartial(); + } else { + match_ = value; + } + onChanged(); + } else { + matchBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Intent match result, could be an intent or an event.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + */ + public Builder clearMatch() { + if (matchBuilder_ == null) { + match_ = null; + onChanged(); + } else { + match_ = null; + matchBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Intent match result, could be an intent or an event.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Match.Builder getMatchBuilder() { + + onChanged(); + return getMatchFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Intent match result, could be an intent or an event.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + */ + public com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder getMatchOrBuilder() { + if (matchBuilder_ != null) { + return matchBuilder_.getMessageOrBuilder(); + } else { + return match_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Match.getDefaultInstance() + : match_; + } + } + /** + * + * + *
+     * Intent match result, could be an intent or an event.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Match, + com.google.cloud.dialogflow.cx.v3beta1.Match.Builder, + com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder> + getMatchFieldBuilder() { + if (matchBuilder_ == null) { + matchBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Match, + com.google.cloud.dialogflow.cx.v3beta1.Match.Builder, + com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder>( + getMatch(), getParentForChildren(), isClean()); + match_ = null; + } + return matchBuilder_; + } + + private com.google.protobuf.Struct diagnosticInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + diagnosticInfoBuilder_; + /** + * + * + *
+     * The free-form diagnostic info. For example, this field could contain
+     * webhook call latency. The string keys of the Struct's fields map can change
+     * without notice.
+     * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + * + * @return Whether the diagnosticInfo field is set. + */ + public boolean hasDiagnosticInfo() { + return diagnosticInfoBuilder_ != null || diagnosticInfo_ != null; + } + /** + * + * + *
+     * The free-form diagnostic info. For example, this field could contain
+     * webhook call latency. The string keys of the Struct's fields map can change
+     * without notice.
+     * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + * + * @return The diagnosticInfo. + */ + public com.google.protobuf.Struct getDiagnosticInfo() { + if (diagnosticInfoBuilder_ == null) { + return diagnosticInfo_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : diagnosticInfo_; + } else { + return diagnosticInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The free-form diagnostic info. For example, this field could contain
+     * webhook call latency. The string keys of the Struct's fields map can change
+     * without notice.
+     * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + */ + public Builder setDiagnosticInfo(com.google.protobuf.Struct value) { + if (diagnosticInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + diagnosticInfo_ = value; + onChanged(); + } else { + diagnosticInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The free-form diagnostic info. For example, this field could contain
+     * webhook call latency. The string keys of the Struct's fields map can change
+     * without notice.
+     * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + */ + public Builder setDiagnosticInfo(com.google.protobuf.Struct.Builder builderForValue) { + if (diagnosticInfoBuilder_ == null) { + diagnosticInfo_ = builderForValue.build(); + onChanged(); + } else { + diagnosticInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The free-form diagnostic info. For example, this field could contain
+     * webhook call latency. The string keys of the Struct's fields map can change
+     * without notice.
+     * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + */ + public Builder mergeDiagnosticInfo(com.google.protobuf.Struct value) { + if (diagnosticInfoBuilder_ == null) { + if (diagnosticInfo_ != null) { + diagnosticInfo_ = + com.google.protobuf.Struct.newBuilder(diagnosticInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + diagnosticInfo_ = value; + } + onChanged(); + } else { + diagnosticInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The free-form diagnostic info. For example, this field could contain
+     * webhook call latency. The string keys of the Struct's fields map can change
+     * without notice.
+     * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + */ + public Builder clearDiagnosticInfo() { + if (diagnosticInfoBuilder_ == null) { + diagnosticInfo_ = null; + onChanged(); + } else { + diagnosticInfo_ = null; + diagnosticInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The free-form diagnostic info. For example, this field could contain
+     * webhook call latency. The string keys of the Struct's fields map can change
+     * without notice.
+     * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + */ + public com.google.protobuf.Struct.Builder getDiagnosticInfoBuilder() { + + onChanged(); + return getDiagnosticInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The free-form diagnostic info. For example, this field could contain
+     * webhook call latency. The string keys of the Struct's fields map can change
+     * without notice.
+     * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + */ + public com.google.protobuf.StructOrBuilder getDiagnosticInfoOrBuilder() { + if (diagnosticInfoBuilder_ != null) { + return diagnosticInfoBuilder_.getMessageOrBuilder(); + } else { + return diagnosticInfo_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : diagnosticInfo_; + } + } + /** + * + * + *
+     * The free-form diagnostic info. For example, this field could contain
+     * webhook call latency. The string keys of the Struct's fields map can change
+     * without notice.
+     * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getDiagnosticInfoFieldBuilder() { + if (diagnosticInfoBuilder_ == null) { + diagnosticInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getDiagnosticInfo(), getParentForChildren(), isClean()); + diagnosticInfo_ = null; + } + return diagnosticInfoBuilder_; + } + + @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.dialogflow.cx.v3beta1.QueryResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.QueryResult) + private static final com.google.cloud.dialogflow.cx.v3beta1.QueryResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.QueryResult(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.QueryResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryResult(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.dialogflow.cx.v3beta1.QueryResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryResultOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryResultOrBuilder.java new file mode 100644 index 000000000..13c0bf7fc --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryResultOrBuilder.java @@ -0,0 +1,598 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface QueryResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.QueryResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+   * will contain a copy of the text.
+   * 
+ * + * string text = 1; + * + * @return The text. + */ + java.lang.String getText(); + /** + * + * + *
+   * If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field
+   * will contain a copy of the text.
+   * 
+ * + * string text = 1; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); + + /** + * + * + *
+   * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+   * contain a copy of the intent identifier.
+   * 
+ * + * string trigger_intent = 11; + * + * @return The triggerIntent. + */ + java.lang.String getTriggerIntent(); + /** + * + * + *
+   * If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will
+   * contain a copy of the intent identifier.
+   * 
+ * + * string trigger_intent = 11; + * + * @return The bytes for triggerIntent. + */ + com.google.protobuf.ByteString getTriggerIntentBytes(); + + /** + * + * + *
+   * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+   * this field will contain the trascript for the audio.
+   * 
+ * + * string transcript = 12; + * + * @return The transcript. + */ + java.lang.String getTranscript(); + /** + * + * + *
+   * If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input,
+   * this field will contain the trascript for the audio.
+   * 
+ * + * string transcript = 12; + * + * @return The bytes for transcript. + */ + com.google.protobuf.ByteString getTranscriptBytes(); + + /** + * + * + *
+   * If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided as input, this field will contain
+   * the name of the event.
+   * 
+ * + * string trigger_event = 14; + * + * @return The triggerEvent. + */ + java.lang.String getTriggerEvent(); + /** + * + * + *
+   * If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided as input, this field will contain
+   * the name of the event.
+   * 
+ * + * string trigger_event = 14; + * + * @return The bytes for triggerEvent. + */ + com.google.protobuf.ByteString getTriggerEventBytes(); + + /** + * + * + *
+   * The language that was triggered during intent detection.
+   * See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+   * for a list of the currently supported language codes.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language that was triggered during intent detection.
+   * See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+   * for a list of the currently supported language codes.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + + /** + * + * + *
+   * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 3; + * + * @return Whether the parameters field is set. + */ + boolean hasParameters(); + /** + * + * + *
+   * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 3; + * + * @return The parameters. + */ + com.google.protobuf.Struct getParameters(); + /** + * + * + *
+   * The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+   * Depending on your protocol or client library language, this is a
+   * map, associative array, symbol table, dictionary, or JSON object
+   * composed of a collection of (MapKey, MapValue) pairs:
+   * -   MapKey type: string
+   * -   MapKey value: parameter name
+   * -   MapValue type:
+   *     -   If parameter's entity type is a composite entity: map
+   *     -   Else: string or number, depending on parameter value type
+   * -   MapValue value:
+   *     -   If parameter's entity type is a composite entity:
+   *         map from composite entity property names to property values
+   *     -   Else: parameter value
+   * 
+ * + * .google.protobuf.Struct parameters = 3; + */ + com.google.protobuf.StructOrBuilder getParametersOrBuilder(); + + /** + * + * + *
+   * The list of rich messages returned to the client. Responses vary from
+   * simple text messages to more sophisticated, structured payloads used
+   * to drive complex logic.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + java.util.List getResponseMessagesList(); + /** + * + * + *
+   * The list of rich messages returned to the client. Responses vary from
+   * simple text messages to more sophisticated, structured payloads used
+   * to drive complex logic.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getResponseMessages(int index); + /** + * + * + *
+   * The list of rich messages returned to the client. Responses vary from
+   * simple text messages to more sophisticated, structured payloads used
+   * to drive complex logic.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + int getResponseMessagesCount(); + /** + * + * + *
+   * The list of rich messages returned to the client. Responses vary from
+   * simple text messages to more sophisticated, structured payloads used
+   * to drive complex logic.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + java.util.List + getResponseMessagesOrBuilderList(); + /** + * + * + *
+   * The list of rich messages returned to the client. Responses vary from
+   * simple text messages to more sophisticated, structured payloads used
+   * to drive complex logic.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage response_messages = 4; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder getResponseMessagesOrBuilder( + int index); + + /** + * + * + *
+   * The list of webhook call status in the order of call sequence.
+   * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + java.util.List getWebhookStatusesList(); + /** + * + * + *
+   * The list of webhook call status in the order of call sequence.
+   * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + com.google.rpc.Status getWebhookStatuses(int index); + /** + * + * + *
+   * The list of webhook call status in the order of call sequence.
+   * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + int getWebhookStatusesCount(); + /** + * + * + *
+   * The list of webhook call status in the order of call sequence.
+   * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + java.util.List getWebhookStatusesOrBuilderList(); + /** + * + * + *
+   * The list of webhook call status in the order of call sequence.
+   * 
+ * + * repeated .google.rpc.Status webhook_statuses = 13; + */ + com.google.rpc.StatusOrBuilder getWebhookStatusesOrBuilder(int index); + + /** + * + * + *
+   * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+   * the order of call sequence. If some webhook call fails or doesn't return
+   * any payload, an empty `Struct` would be used instead.
+   * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + java.util.List getWebhookPayloadsList(); + /** + * + * + *
+   * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+   * the order of call sequence. If some webhook call fails or doesn't return
+   * any payload, an empty `Struct` would be used instead.
+   * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + com.google.protobuf.Struct getWebhookPayloads(int index); + /** + * + * + *
+   * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+   * the order of call sequence. If some webhook call fails or doesn't return
+   * any payload, an empty `Struct` would be used instead.
+   * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + int getWebhookPayloadsCount(); + /** + * + * + *
+   * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+   * the order of call sequence. If some webhook call fails or doesn't return
+   * any payload, an empty `Struct` would be used instead.
+   * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + java.util.List getWebhookPayloadsOrBuilderList(); + /** + * + * + *
+   * The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in
+   * the order of call sequence. If some webhook call fails or doesn't return
+   * any payload, an empty `Struct` would be used instead.
+   * 
+ * + * repeated .google.protobuf.Struct webhook_payloads = 6; + */ + com.google.protobuf.StructOrBuilder getWebhookPayloadsOrBuilder(int index); + + /** + * + * + *
+   * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+   * including but not limited to `name` and `display_name`.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + * + * @return Whether the currentPage field is set. + */ + boolean hasCurrentPage(); + /** + * + * + *
+   * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+   * including but not limited to `name` and `display_name`.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + * + * @return The currentPage. + */ + com.google.cloud.dialogflow.cx.v3beta1.Page getCurrentPage(); + /** + * + * + *
+   * The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message,
+   * including but not limited to `name` and `display_name`.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Page current_page = 7; + */ + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getCurrentPageOrBuilder(); + + /** + * + * + *
+   * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+   * are filled in this message, including but not limited to: `name` and
+   * `display_name`.
+   * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + * + * @return Whether the intent field is set. + */ + @java.lang.Deprecated + boolean hasIntent(); + /** + * + * + *
+   * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+   * are filled in this message, including but not limited to: `name` and
+   * `display_name`.
+   * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + * + * @return The intent. + */ + @java.lang.Deprecated + com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent(); + /** + * + * + *
+   * The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields
+   * are filled in this message, including but not limited to: `name` and
+   * `display_name`.
+   * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 8 [deprecated = true]; + */ + @java.lang.Deprecated + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder(); + + /** + * + * + *
+   * The intent detection confidence. Values range from 0.0 (completely
+   * uncertain) to 1.0 (completely certain).
+   * This value is for informational purpose only and is only used to
+   * help match the best intent within the classification threshold.
+   * This value may change for the same end-user expression at any time due to a
+   * model retraining or change in implementation.
+   * This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead.
+   * 
+ * + * float intent_detection_confidence = 9 [deprecated = true]; + * + * @return The intentDetectionConfidence. + */ + @java.lang.Deprecated + float getIntentDetectionConfidence(); + + /** + * + * + *
+   * Intent match result, could be an intent or an event.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + * + * @return Whether the match field is set. + */ + boolean hasMatch(); + /** + * + * + *
+   * Intent match result, could be an intent or an event.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + * + * @return The match. + */ + com.google.cloud.dialogflow.cx.v3beta1.Match getMatch(); + /** + * + * + *
+   * Intent match result, could be an intent or an event.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Match match = 15; + */ + com.google.cloud.dialogflow.cx.v3beta1.MatchOrBuilder getMatchOrBuilder(); + + /** + * + * + *
+   * The free-form diagnostic info. For example, this field could contain
+   * webhook call latency. The string keys of the Struct's fields map can change
+   * without notice.
+   * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + * + * @return Whether the diagnosticInfo field is set. + */ + boolean hasDiagnosticInfo(); + /** + * + * + *
+   * The free-form diagnostic info. For example, this field could contain
+   * webhook call latency. The string keys of the Struct's fields map can change
+   * without notice.
+   * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + * + * @return The diagnosticInfo. + */ + com.google.protobuf.Struct getDiagnosticInfo(); + /** + * + * + *
+   * The free-form diagnostic info. For example, this field could contain
+   * webhook call latency. The string keys of the Struct's fields map can change
+   * without notice.
+   * 
+ * + * .google.protobuf.Struct diagnostic_info = 10; + */ + com.google.protobuf.StructOrBuilder getDiagnosticInfoOrBuilder(); + + public com.google.cloud.dialogflow.cx.v3beta1.QueryResult.QueryCase getQueryCase(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessage.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessage.java new file mode 100644 index 000000000..704ccc694 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessage.java @@ -0,0 +1,11541 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/response_message.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Represents a response message that can be returned by a conversational agent.
+ * Response messages are also used for output audio synthesis. The approach is
+ * as follows:
+ * * If at least one OutputAudioText response is present, then all
+ *   OutputAudioText responses are linearly concatenated, and the result is used
+ *   for output audio synthesis.
+ * * If the OutputAudioText responses are a mixture of text and SSML, then the
+ *   concatenated result is treated as SSML; otherwise, the result is treated as
+ *   either text or SSML as appropriate. The agent designer should ideally use
+ *   either text or SSML consistently throughout the bot design.
+ * * Otherwise, all Text responses are linearly concatenated, and the result is
+ *   used for output audio synthesis.
+ * This approach allows for more sophisticated user experience scenarios, where
+ * the text displayed to the user may differ from what is heard.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage} + */ +public final class ResponseMessage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage) + ResponseMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResponseMessage.newBuilder() to construct. + private ResponseMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResponseMessage() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResponseMessage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ResponseMessage( + 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.dialogflow.cx.v3beta1.ResponseMessage.Text.Builder subBuilder = null; + if (messageCase_ == 1) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) message_) + .toBuilder(); + } + message_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) message_); + message_ = subBuilder.buildPartial(); + } + messageCase_ = 1; + break; + } + case 18: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (messageCase_ == 2) { + subBuilder = ((com.google.protobuf.Struct) message_).toBuilder(); + } + message_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Struct) message_); + message_ = subBuilder.buildPartial(); + } + messageCase_ = 2; + break; + } + case 50: + { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff.Builder + subBuilder = null; + if (messageCase_ == 6) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) + message_) + .toBuilder(); + } + message_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) + message_); + message_ = subBuilder.buildPartial(); + } + messageCase_ = 6; + break; + } + case 66: + { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.Builder + subBuilder = null; + if (messageCase_ == 8) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) + message_) + .toBuilder(); + } + message_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) + message_); + message_ = subBuilder.buildPartial(); + } + messageCase_ = 8; + break; + } + case 74: + { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.Builder + subBuilder = null; + if (messageCase_ == 9) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) + message_) + .toBuilder(); + } + message_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) + message_); + message_ = subBuilder.buildPartial(); + } + messageCase_ = 9; + break; + } + case 82: + { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.Builder + subBuilder = null; + if (messageCase_ == 10) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) + message_) + .toBuilder(); + } + message_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) + message_); + message_ = subBuilder.buildPartial(); + } + messageCase_ = 10; + break; + } + case 90: + { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.Builder + subBuilder = null; + if (messageCase_ == 11) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + message_) + .toBuilder(); + } + message_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + message_); + message_ = subBuilder.buildPartial(); + } + messageCase_ = 11; + break; + } + case 98: + { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.Builder subBuilder = + null; + if (messageCase_ == 12) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) message_) + .toBuilder(); + } + message_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) message_); + message_ = subBuilder.buildPartial(); + } + messageCase_ = 12; + break; + } + case 106: + { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Builder subBuilder = + null; + if (messageCase_ == 13) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) message_) + .toBuilder(); + } + message_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) message_); + message_ = subBuilder.buildPartial(); + } + messageCase_ = 13; + 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.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder.class); + } + + public interface TextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. A collection of text responses.
+     * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the text. + */ + java.util.List getTextList(); + /** + * + * + *
+     * Required. A collection of text responses.
+     * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of text. + */ + int getTextCount(); + /** + * + * + *
+     * Required. A collection of text responses.
+     * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The text at the given index. + */ + java.lang.String getText(int index); + /** + * + * + *
+     * Required. A collection of text responses.
+     * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the text at the given index. + */ + com.google.protobuf.ByteString getTextBytes(int index); + + /** + * + * + *
+     * Whether the playback of this message can be interrupted by the end
+     * user's speech and the client can then starts the next Dialogflow
+     * request.
+     * 
+ * + * bool allow_playback_interruption = 2; + * + * @return The allowPlaybackInterruption. + */ + boolean getAllowPlaybackInterruption(); + } + /** + * + * + *
+   * The text response message.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text} + */ + public static final class Text extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) + TextOrBuilder { + private static final long serialVersionUID = 0L; + // Use Text.newBuilder() to construct. + private Text(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Text() { + text_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Text(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Text( + 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)) { + text_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + text_.add(s); + break; + } + case 16: + { + allowPlaybackInterruption_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + text_ = text_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_Text_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_Text_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.Builder.class); + } + + public static final int TEXT_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList text_; + /** + * + * + *
+     * Required. A collection of text responses.
+     * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the text. + */ + public com.google.protobuf.ProtocolStringList getTextList() { + return text_; + } + /** + * + * + *
+     * Required. A collection of text responses.
+     * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of text. + */ + public int getTextCount() { + return text_.size(); + } + /** + * + * + *
+     * Required. A collection of text responses.
+     * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The text at the given index. + */ + public java.lang.String getText(int index) { + return text_.get(index); + } + /** + * + * + *
+     * Required. A collection of text responses.
+     * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the text at the given index. + */ + public com.google.protobuf.ByteString getTextBytes(int index) { + return text_.getByteString(index); + } + + public static final int ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER = 2; + private boolean allowPlaybackInterruption_; + /** + * + * + *
+     * Whether the playback of this message can be interrupted by the end
+     * user's speech and the client can then starts the next Dialogflow
+     * request.
+     * 
+ * + * bool allow_playback_interruption = 2; + * + * @return The allowPlaybackInterruption. + */ + @java.lang.Override + public boolean getAllowPlaybackInterruption() { + return allowPlaybackInterruption_; + } + + 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 < text_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, text_.getRaw(i)); + } + if (allowPlaybackInterruption_ != false) { + output.writeBool(2, allowPlaybackInterruption_); + } + 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 < text_.size(); i++) { + dataSize += computeStringSizeNoTag(text_.getRaw(i)); + } + size += dataSize; + size += 1 * getTextList().size(); + } + if (allowPlaybackInterruption_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowPlaybackInterruption_); + } + 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.dialogflow.cx.v3beta1.ResponseMessage.Text)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text other = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) obj; + + if (!getTextList().equals(other.getTextList())) return false; + if (getAllowPlaybackInterruption() != other.getAllowPlaybackInterruption()) 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 (getTextCount() > 0) { + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getTextList().hashCode(); + } + hash = (37 * hash) + ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowPlaybackInterruption()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text 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.dialogflow.cx.v3beta1.ResponseMessage.Text parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text 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.dialogflow.cx.v3beta1.ResponseMessage.Text parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text 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.dialogflow.cx.v3beta1.ResponseMessage.Text parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text 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.dialogflow.cx.v3beta1.ResponseMessage.Text parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text 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.dialogflow.cx.v3beta1.ResponseMessage.Text prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The text response message.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_Text_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_Text_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.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(); + text_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + allowPlaybackInterruption_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_Text_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text build() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text result = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + text_ = text_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.text_ = text_; + result.allowPlaybackInterruption_ = allowPlaybackInterruption_; + 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.dialogflow.cx.v3beta1.ResponseMessage.Text) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.getDefaultInstance()) + return this; + if (!other.text_.isEmpty()) { + if (text_.isEmpty()) { + text_ = other.text_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTextIsMutable(); + text_.addAll(other.text_); + } + onChanged(); + } + if (other.getAllowPlaybackInterruption() != false) { + setAllowPlaybackInterruption(other.getAllowPlaybackInterruption()); + } + 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.dialogflow.cx.v3beta1.ResponseMessage.Text parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList text_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTextIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + text_ = new com.google.protobuf.LazyStringArrayList(text_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Required. A collection of text responses.
+       * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the text. + */ + public com.google.protobuf.ProtocolStringList getTextList() { + return text_.getUnmodifiableView(); + } + /** + * + * + *
+       * Required. A collection of text responses.
+       * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of text. + */ + public int getTextCount() { + return text_.size(); + } + /** + * + * + *
+       * Required. A collection of text responses.
+       * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The text at the given index. + */ + public java.lang.String getText(int index) { + return text_.get(index); + } + /** + * + * + *
+       * Required. A collection of text responses.
+       * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the text at the given index. + */ + public com.google.protobuf.ByteString getTextBytes(int index) { + return text_.getByteString(index); + } + /** + * + * + *
+       * Required. A collection of text responses.
+       * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextIsMutable(); + text_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. A collection of text responses.
+       * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The text to add. + * @return This builder for chaining. + */ + public Builder addText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextIsMutable(); + text_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. A collection of text responses.
+       * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The text to add. + * @return This builder for chaining. + */ + public Builder addAllText(java.lang.Iterable values) { + ensureTextIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, text_); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. A collection of text responses.
+       * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearText() { + text_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. A collection of text responses.
+       * 
+ * + * repeated string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the text to add. + * @return This builder for chaining. + */ + public Builder addTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTextIsMutable(); + text_.add(value); + onChanged(); + return this; + } + + private boolean allowPlaybackInterruption_; + /** + * + * + *
+       * Whether the playback of this message can be interrupted by the end
+       * user's speech and the client can then starts the next Dialogflow
+       * request.
+       * 
+ * + * bool allow_playback_interruption = 2; + * + * @return The allowPlaybackInterruption. + */ + @java.lang.Override + public boolean getAllowPlaybackInterruption() { + return allowPlaybackInterruption_; + } + /** + * + * + *
+       * Whether the playback of this message can be interrupted by the end
+       * user's speech and the client can then starts the next Dialogflow
+       * request.
+       * 
+ * + * bool allow_playback_interruption = 2; + * + * @param value The allowPlaybackInterruption to set. + * @return This builder for chaining. + */ + public Builder setAllowPlaybackInterruption(boolean value) { + + allowPlaybackInterruption_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether the playback of this message can be interrupted by the end
+       * user's speech and the client can then starts the next Dialogflow
+       * request.
+       * 
+ * + * bool allow_playback_interruption = 2; + * + * @return This builder for chaining. + */ + public Builder clearAllowPlaybackInterruption() { + + allowPlaybackInterruption_ = 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.dialogflow.cx.v3beta1.ResponseMessage.Text) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) + private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Text parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Text(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.dialogflow.cx.v3beta1.ResponseMessage.Text getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + @java.lang.Deprecated + public interface HumanAgentHandoffOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return The metadata. + */ + com.google.protobuf.Struct getMetadata(); + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + com.google.protobuf.StructOrBuilder getMetadataOrBuilder(); + } + /** + * + * + *
+   * Indicates that the conversation should be handed off to a human agent.
+   * Dialogflow only uses this to determine which conversations were handed off
+   * to a human agent for measurement purposes. What else to do with this signal
+   * is up to you and your handoff procedures.
+   * You may set this, for example:
+   * * In the [entry_fulfillment][google.cloud.dialogflow.cx.v3beta1.Page.entry_fulfillment] of a [Page][google.cloud.dialogflow.cx.v3beta1.Page] if
+   *   entering the page indicates something went extremely wrong in the
+   *   conversation.
+   * * In a webhook response when you determine that the customer issue can only
+   *   be handled by a human.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff} + */ + @java.lang.Deprecated + public static final class HumanAgentHandoff extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) + HumanAgentHandoffOrBuilder { + private static final long serialVersionUID = 0L; + // Use HumanAgentHandoff.newBuilder() to construct. + private HumanAgentHandoff(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HumanAgentHandoff() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new HumanAgentHandoff(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private HumanAgentHandoff( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (metadata_ != null) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = 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.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_HumanAgentHandoff_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_HumanAgentHandoff_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff.Builder + .class); + } + + public static final int METADATA_FIELD_NUMBER = 1; + private com.google.protobuf.Struct metadata_; + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.Struct getMetadata() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + 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 (metadata_ != null) { + output.writeMessage(1, getMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + 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.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff other = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) obj; + + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) 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 (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + 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.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + 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.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + 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.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + 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.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + 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.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff 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; + } + /** + * + * + *
+     * Indicates that the conversation should be handed off to a human agent.
+     * Dialogflow only uses this to determine which conversations were handed off
+     * to a human agent for measurement purposes. What else to do with this signal
+     * is up to you and your handoff procedures.
+     * You may set this, for example:
+     * * In the [entry_fulfillment][google.cloud.dialogflow.cx.v3beta1.Page.entry_fulfillment] of a [Page][google.cloud.dialogflow.cx.v3beta1.Page] if
+     *   entering the page indicates something went extremely wrong in the
+     *   conversation.
+     * * In a webhook response when you determine that the customer issue can only
+     *   be handled by a human.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoffOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_HumanAgentHandoff_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_HumanAgentHandoff_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_HumanAgentHandoff_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff build() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff result = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff(this); + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.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.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + .getDefaultInstance()) return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + 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.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Struct metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + metadataBuilder_; + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return The metadata. + */ + public com.google.protobuf.Struct getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder setMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder setMetadata(com.google.protobuf.Struct.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder mergeMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = + com.google.protobuf.Struct.newBuilder(metadata_).mergeFrom(value).buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public com.google.protobuf.Struct.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @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.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) + private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HumanAgentHandoff parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HumanAgentHandoff(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.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface LiveAgentHandoffOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return The metadata. + */ + com.google.protobuf.Struct getMetadata(); + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + com.google.protobuf.StructOrBuilder getMetadataOrBuilder(); + } + /** + * + * + *
+   * Indicates that the conversation should be handed off to a live agent.
+   * Dialogflow only uses this to determine which conversations were handed off
+   * to a human agent for measurement purposes. What else to do with this signal
+   * is up to you and your handoff procedures.
+   * You may set this, for example:
+   * * In the [entry_fulfillment][google.cloud.dialogflow.cx.v3beta1.Page.entry_fulfillment] of a [Page][google.cloud.dialogflow.cx.v3beta1.Page] if
+   *   entering the page indicates something went extremely wrong in the
+   *   conversation.
+   * * In a webhook response when you determine that the customer issue can only
+   *   be handled by a human.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff} + */ + public static final class LiveAgentHandoff extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) + LiveAgentHandoffOrBuilder { + private static final long serialVersionUID = 0L; + // Use LiveAgentHandoff.newBuilder() to construct. + private LiveAgentHandoff(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LiveAgentHandoff() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LiveAgentHandoff(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LiveAgentHandoff( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (metadata_ != null) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = 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.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_LiveAgentHandoff_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_LiveAgentHandoff_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.Builder + .class); + } + + public static final int METADATA_FIELD_NUMBER = 1; + private com.google.protobuf.Struct metadata_; + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.Struct getMetadata() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + 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 (metadata_ != null) { + output.writeMessage(1, getMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + 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.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff other = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) obj; + + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) 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 (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff 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.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff 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.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff 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.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + 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.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff 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.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff 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; + } + /** + * + * + *
+     * Indicates that the conversation should be handed off to a live agent.
+     * Dialogflow only uses this to determine which conversations were handed off
+     * to a human agent for measurement purposes. What else to do with this signal
+     * is up to you and your handoff procedures.
+     * You may set this, for example:
+     * * In the [entry_fulfillment][google.cloud.dialogflow.cx.v3beta1.Page.entry_fulfillment] of a [Page][google.cloud.dialogflow.cx.v3beta1.Page] if
+     *   entering the page indicates something went extremely wrong in the
+     *   conversation.
+     * * In a webhook response when you determine that the customer issue can only
+     *   be handled by a human.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoffOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_LiveAgentHandoff_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_LiveAgentHandoff_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_LiveAgentHandoff_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff build() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff result = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff(this); + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.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.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + .getDefaultInstance()) return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + 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.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Struct metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + metadataBuilder_; + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return The metadata. + */ + public com.google.protobuf.Struct getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder setMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder setMetadata(com.google.protobuf.Struct.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder mergeMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = + com.google.protobuf.Struct.newBuilder(metadata_).mergeFrom(value).buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public com.google.protobuf.Struct.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + } + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @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.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) + private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LiveAgentHandoff parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LiveAgentHandoff(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.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConversationSuccessOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Custom metadata. Dialogflow doesn't impose any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+     * Custom metadata. Dialogflow doesn't impose any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return The metadata. + */ + com.google.protobuf.Struct getMetadata(); + /** + * + * + *
+     * Custom metadata. Dialogflow doesn't impose any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + com.google.protobuf.StructOrBuilder getMetadataOrBuilder(); + } + /** + * + * + *
+   * Indicates that the conversation succeeded, i.e., the bot handled the issue
+   * that the customer talked to it about.
+   * Dialogflow only uses this to determine which conversations should be
+   * counted as successful and doesn't process the metadata in this message in
+   * any way. Note that Dialogflow also considers conversations that get to the
+   * conversation end page as successful even if they don't return
+   * [ConversationSuccess][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess].
+   * You may set this, for example:
+   * * In the [entry_fulfillment][google.cloud.dialogflow.cx.v3beta1.Page.entry_fulfillment] of a [Page][google.cloud.dialogflow.cx.v3beta1.Page] if
+   *   entering the page indicates that the conversation succeeded.
+   * * In a webhook response when you determine that you handled the customer
+   *   issue.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess} + */ + public static final class ConversationSuccess extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) + ConversationSuccessOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConversationSuccess.newBuilder() to construct. + private ConversationSuccess(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConversationSuccess() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConversationSuccess(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ConversationSuccess( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (metadata_ != null) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = 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.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_ConversationSuccess_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_ConversationSuccess_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.Builder + .class); + } + + public static final int METADATA_FIELD_NUMBER = 1; + private com.google.protobuf.Struct metadata_; + /** + * + * + *
+     * Custom metadata. Dialogflow doesn't impose any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+     * Custom metadata. Dialogflow doesn't impose any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.Struct getMetadata() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + /** + * + * + *
+     * Custom metadata. Dialogflow doesn't impose any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + 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 (metadata_ != null) { + output.writeMessage(1, getMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + 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.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess other = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) obj; + + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) 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 (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + 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.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + 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.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + 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.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + 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.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + 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.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess 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; + } + /** + * + * + *
+     * Indicates that the conversation succeeded, i.e., the bot handled the issue
+     * that the customer talked to it about.
+     * Dialogflow only uses this to determine which conversations should be
+     * counted as successful and doesn't process the metadata in this message in
+     * any way. Note that Dialogflow also considers conversations that get to the
+     * conversation end page as successful even if they don't return
+     * [ConversationSuccess][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess].
+     * You may set this, for example:
+     * * In the [entry_fulfillment][google.cloud.dialogflow.cx.v3beta1.Page.entry_fulfillment] of a [Page][google.cloud.dialogflow.cx.v3beta1.Page] if
+     *   entering the page indicates that the conversation succeeded.
+     * * In a webhook response when you determine that you handled the customer
+     *   issue.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccessOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_ConversationSuccess_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_ConversationSuccess_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_ConversationSuccess_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess build() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess result = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess(this); + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.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.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + .getDefaultInstance()) return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + 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.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Struct metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + metadataBuilder_; + /** + * + * + *
+       * Custom metadata. Dialogflow doesn't impose any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * + * + *
+       * Custom metadata. Dialogflow doesn't impose any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return The metadata. + */ + public com.google.protobuf.Struct getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Custom metadata. Dialogflow doesn't impose any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder setMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Custom metadata. Dialogflow doesn't impose any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder setMetadata(com.google.protobuf.Struct.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Custom metadata. Dialogflow doesn't impose any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder mergeMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = + com.google.protobuf.Struct.newBuilder(metadata_).mergeFrom(value).buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Custom metadata. Dialogflow doesn't impose any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Custom metadata. Dialogflow doesn't impose any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public com.google.protobuf.Struct.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Custom metadata. Dialogflow doesn't impose any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + } + /** + * + * + *
+       * Custom metadata. Dialogflow doesn't impose any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @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.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) + private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConversationSuccess parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConversationSuccess(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.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PlayAudioOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+     * value. It is specific to the client that reads it.
+     * 
+ * + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The audioUri. + */ + java.lang.String getAudioUri(); + /** + * + * + *
+     * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+     * value. It is specific to the client that reads it.
+     * 
+ * + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for audioUri. + */ + com.google.protobuf.ByteString getAudioUriBytes(); + + /** + * + * + *
+     * Whether the playback of this message can be interrupted by the end
+     * user's speech and the client can then starts the next Dialogflow
+     * request.
+     * 
+ * + * bool allow_playback_interruption = 2; + * + * @return The allowPlaybackInterruption. + */ + boolean getAllowPlaybackInterruption(); + } + /** + * + * + *
+   * Specifies an audio clip to be played by the client as part of the response.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio} + */ + public static final class PlayAudio extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) + PlayAudioOrBuilder { + private static final long serialVersionUID = 0L; + // Use PlayAudio.newBuilder() to construct. + private PlayAudio(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PlayAudio() { + audioUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PlayAudio(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PlayAudio( + 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(); + + audioUri_ = s; + break; + } + case 16: + { + allowPlaybackInterruption_ = 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.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.Builder.class); + } + + public static final int AUDIO_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object audioUri_; + /** + * + * + *
+     * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+     * value. It is specific to the client that reads it.
+     * 
+ * + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The audioUri. + */ + @java.lang.Override + public java.lang.String getAudioUri() { + java.lang.Object ref = audioUri_; + 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(); + audioUri_ = s; + return s; + } + } + /** + * + * + *
+     * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+     * value. It is specific to the client that reads it.
+     * 
+ * + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for audioUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAudioUriBytes() { + java.lang.Object ref = audioUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + audioUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER = 2; + private boolean allowPlaybackInterruption_; + /** + * + * + *
+     * Whether the playback of this message can be interrupted by the end
+     * user's speech and the client can then starts the next Dialogflow
+     * request.
+     * 
+ * + * bool allow_playback_interruption = 2; + * + * @return The allowPlaybackInterruption. + */ + @java.lang.Override + public boolean getAllowPlaybackInterruption() { + return allowPlaybackInterruption_; + } + + 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 (!getAudioUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, audioUri_); + } + if (allowPlaybackInterruption_ != false) { + output.writeBool(2, allowPlaybackInterruption_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getAudioUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, audioUri_); + } + if (allowPlaybackInterruption_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowPlaybackInterruption_); + } + 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.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio other = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) obj; + + if (!getAudioUri().equals(other.getAudioUri())) return false; + if (getAllowPlaybackInterruption() != other.getAllowPlaybackInterruption()) 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) + AUDIO_URI_FIELD_NUMBER; + hash = (53 * hash) + getAudioUri().hashCode(); + hash = (37 * hash) + ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowPlaybackInterruption()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio 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.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio 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.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio 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.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + 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.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio 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.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio 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; + } + /** + * + * + *
+     * Specifies an audio clip to be played by the client as part of the response.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudioOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.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(); + audioUri_ = ""; + + allowPlaybackInterruption_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio build() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio result = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio(this); + result.audioUri_ = audioUri_; + result.allowPlaybackInterruption_ = allowPlaybackInterruption_; + 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.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + .getDefaultInstance()) return this; + if (!other.getAudioUri().isEmpty()) { + audioUri_ = other.audioUri_; + onChanged(); + } + if (other.getAllowPlaybackInterruption() != false) { + setAllowPlaybackInterruption(other.getAllowPlaybackInterruption()); + } + 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.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object audioUri_ = ""; + /** + * + * + *
+       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+       * value. It is specific to the client that reads it.
+       * 
+ * + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The audioUri. + */ + public java.lang.String getAudioUri() { + java.lang.Object ref = audioUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + audioUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+       * value. It is specific to the client that reads it.
+       * 
+ * + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for audioUri. + */ + public com.google.protobuf.ByteString getAudioUriBytes() { + java.lang.Object ref = audioUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + audioUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+       * value. It is specific to the client that reads it.
+       * 
+ * + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The audioUri to set. + * @return This builder for chaining. + */ + public Builder setAudioUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + audioUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+       * value. It is specific to the client that reads it.
+       * 
+ * + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearAudioUri() { + + audioUri_ = getDefaultInstance().getAudioUri(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+       * value. It is specific to the client that reads it.
+       * 
+ * + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for audioUri to set. + * @return This builder for chaining. + */ + public Builder setAudioUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + audioUri_ = value; + onChanged(); + return this; + } + + private boolean allowPlaybackInterruption_; + /** + * + * + *
+       * Whether the playback of this message can be interrupted by the end
+       * user's speech and the client can then starts the next Dialogflow
+       * request.
+       * 
+ * + * bool allow_playback_interruption = 2; + * + * @return The allowPlaybackInterruption. + */ + @java.lang.Override + public boolean getAllowPlaybackInterruption() { + return allowPlaybackInterruption_; + } + /** + * + * + *
+       * Whether the playback of this message can be interrupted by the end
+       * user's speech and the client can then starts the next Dialogflow
+       * request.
+       * 
+ * + * bool allow_playback_interruption = 2; + * + * @param value The allowPlaybackInterruption to set. + * @return This builder for chaining. + */ + public Builder setAllowPlaybackInterruption(boolean value) { + + allowPlaybackInterruption_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether the playback of this message can be interrupted by the end
+       * user's speech and the client can then starts the next Dialogflow
+       * request.
+       * 
+ * + * bool allow_playback_interruption = 2; + * + * @return This builder for chaining. + */ + public Builder clearAllowPlaybackInterruption() { + + allowPlaybackInterruption_ = 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.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) + private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PlayAudio parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PlayAudio(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.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface OutputAudioTextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The raw text to be synthesized.
+     * 
+ * + * string text = 1; + * + * @return The text. + */ + java.lang.String getText(); + /** + * + * + *
+     * The raw text to be synthesized.
+     * 
+ * + * string text = 1; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); + + /** + * + * + *
+     * The SSML text to be synthesized. For more information, see
+     * [SSML](/speech/text-to-speech/docs/ssml).
+     * 
+ * + * string ssml = 2; + * + * @return The ssml. + */ + java.lang.String getSsml(); + /** + * + * + *
+     * The SSML text to be synthesized. For more information, see
+     * [SSML](/speech/text-to-speech/docs/ssml).
+     * 
+ * + * string ssml = 2; + * + * @return The bytes for ssml. + */ + com.google.protobuf.ByteString getSsmlBytes(); + + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.SourceCase + getSourceCase(); + } + /** + * + * + *
+   * A text or ssml response that is preferentially used for TTS output audio
+   * synthesis, as described in the comment on the ResponseMessage message.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText} + */ + public static final class OutputAudioText extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) + OutputAudioTextOrBuilder { + private static final long serialVersionUID = 0L; + // Use OutputAudioText.newBuilder() to construct. + private OutputAudioText(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OutputAudioText() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OutputAudioText(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OutputAudioText( + 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(); + sourceCase_ = 1; + source_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 2; + source_ = 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.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_OutputAudioText_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_OutputAudioText_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.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 { + TEXT(1), + SSML(2), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return TEXT; + case 2: + return SSML; + 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 TEXT_FIELD_NUMBER = 1; + /** + * + * + *
+     * The raw text to be synthesized.
+     * 
+ * + * string text = 1; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = ""; + if (sourceCase_ == 1) { + ref = source_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 1) { + source_ = s; + } + return s; + } + } + /** + * + * + *
+     * The raw text to be synthesized.
+     * 
+ * + * string text = 1; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 1) { + ref = source_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 1) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SSML_FIELD_NUMBER = 2; + /** + * + * + *
+     * The SSML text to be synthesized. For more information, see
+     * [SSML](/speech/text-to-speech/docs/ssml).
+     * 
+ * + * string ssml = 2; + * + * @return The ssml. + */ + public java.lang.String getSsml() { + java.lang.Object ref = ""; + if (sourceCase_ == 2) { + ref = source_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 2) { + source_ = s; + } + return s; + } + } + /** + * + * + *
+     * The SSML text to be synthesized. For more information, see
+     * [SSML](/speech/text-to-speech/docs/ssml).
+     * 
+ * + * string ssml = 2; + * + * @return The bytes for ssml. + */ + public com.google.protobuf.ByteString getSsmlBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 2) { + ref = source_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 2) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, source_); + } + if (sourceCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, 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.GeneratedMessageV3.computeStringSize(1, source_); + } + if (sourceCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, 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.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText other = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getText().equals(other.getText())) return false; + break; + case 2: + if (!getSsml().equals(other.getSsml())) 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) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 2: + hash = (37 * hash) + SSML_FIELD_NUMBER; + hash = (53 * hash) + getSsml().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText 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.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText 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.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText 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.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + 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.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText 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.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText 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 text or ssml response that is preferentially used for TTS output audio
+     * synthesis, as described in the comment on the ResponseMessage message.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioTextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_OutputAudioText_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_OutputAudioText_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.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.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_OutputAudioText_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText build() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText result = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText(this); + if (sourceCase_ == 1) { + result.source_ = source_; + } + if (sourceCase_ == 2) { + result.source_ = source_; + } + 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.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + .getDefaultInstance()) return this; + switch (other.getSourceCase()) { + case TEXT: + { + sourceCase_ = 1; + source_ = other.source_; + onChanged(); + break; + } + case SSML: + { + sourceCase_ = 2; + source_ = other.source_; + onChanged(); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) + 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; + } + + /** + * + * + *
+       * The raw text to be synthesized.
+       * 
+ * + * string text = 1; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = ""; + if (sourceCase_ == 1) { + ref = source_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 1) { + source_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The raw text to be synthesized.
+       * 
+ * + * string text = 1; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 1) { + ref = source_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 1) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The raw text to be synthesized.
+       * 
+ * + * string text = 1; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCase_ = 1; + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The raw text to be synthesized.
+       * 
+ * + * string text = 1; + * + * @return This builder for chaining. + */ + public Builder clearText() { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * The raw text to be synthesized.
+       * 
+ * + * string text = 1; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCase_ = 1; + source_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * The SSML text to be synthesized. For more information, see
+       * [SSML](/speech/text-to-speech/docs/ssml).
+       * 
+ * + * string ssml = 2; + * + * @return The ssml. + */ + @java.lang.Override + public java.lang.String getSsml() { + java.lang.Object ref = ""; + if (sourceCase_ == 2) { + ref = source_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 2) { + source_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The SSML text to be synthesized. For more information, see
+       * [SSML](/speech/text-to-speech/docs/ssml).
+       * 
+ * + * string ssml = 2; + * + * @return The bytes for ssml. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSsmlBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 2) { + ref = source_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 2) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The SSML text to be synthesized. For more information, see
+       * [SSML](/speech/text-to-speech/docs/ssml).
+       * 
+ * + * string ssml = 2; + * + * @param value The ssml to set. + * @return This builder for chaining. + */ + public Builder setSsml(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCase_ = 2; + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The SSML text to be synthesized. For more information, see
+       * [SSML](/speech/text-to-speech/docs/ssml).
+       * 
+ * + * string ssml = 2; + * + * @return This builder for chaining. + */ + public Builder clearSsml() { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * The SSML text to be synthesized. For more information, see
+       * [SSML](/speech/text-to-speech/docs/ssml).
+       * 
+ * + * string ssml = 2; + * + * @param value The bytes for ssml to set. + * @return This builder for chaining. + */ + public Builder setSsmlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCase_ = 2; + source_ = 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.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) + private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OutputAudioText parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OutputAudioText(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.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface EndInteractionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Indicates that interaction with the Dialogflow agent has ended.
+   * This message is generated by Dialogflow only and not supposed to be
+   * defined by the user.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} + */ + public static final class EndInteraction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + EndInteractionOrBuilder { + private static final long serialVersionUID = 0L; + // Use EndInteraction.newBuilder() to construct. + private EndInteraction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EndInteraction() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EndInteraction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EndInteraction( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (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.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction other = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction 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.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction 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.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction 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.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + 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.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction 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.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction 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; + } + /** + * + * + *
+     * Indicates that interaction with the Dialogflow agent has ended.
+     * This message is generated by Dialogflow only and not supposed to be
+     * defined by the user.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteractionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction build() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction result = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EndInteraction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EndInteraction(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.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MixedAudioOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + java.util.List + getSegmentsList(); + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment getSegments( + int index); + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + int getSegmentsCount(); + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder> + getSegmentsOrBuilderList(); + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder + getSegmentsOrBuilder(int index); + } + /** + * + * + *
+   * Represents an audio message that is composed of both segments
+   * synthesized from the Dialogflow agent prompts and ones hosted externally
+   * at the specified URIs.
+   * The external URIs are specified via
+   * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+   * This message is generated by Dialogflow only and not supposed to be
+   * defined by the user.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio} + */ + public static final class MixedAudio extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) + MixedAudioOrBuilder { + private static final long serialVersionUID = 0L; + // Use MixedAudio.newBuilder() to construct. + private MixedAudio(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MixedAudio() { + segments_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MixedAudio(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MixedAudio( + 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)) { + segments_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + .Segment>(); + mutable_bitField0_ |= 0x00000001; + } + segments_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + .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)) { + segments_ = java.util.Collections.unmodifiableList(segments_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Builder.class); + } + + public interface SegmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Raw audio synthesized from the Dialogflow agent's response using
+       * the output config specified in the request.
+       * 
+ * + * bytes audio = 1; + * + * @return The audio. + */ + com.google.protobuf.ByteString getAudio(); + + /** + * + * + *
+       * Client-specific URI that points to an audio clip accessible to the
+       * client. Dialogflow does not impose any validation on it.
+       * 
+ * + * string uri = 2; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+       * Client-specific URI that points to an audio clip accessible to the
+       * client. Dialogflow does not impose any validation on it.
+       * 
+ * + * string uri = 2; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+       * Whether the playback of this segment can be interrupted by the end
+       * user's speech and the client should then start the next Dialogflow
+       * request.
+       * 
+ * + * bool allow_playback_interruption = 3; + * + * @return The allowPlaybackInterruption. + */ + boolean getAllowPlaybackInterruption(); + + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.ContentCase + getContentCase(); + } + /** + * + * + *
+     * Represents one segment of audio.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment} + */ + public static final class Segment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) + SegmentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Segment.newBuilder() to construct. + private Segment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Segment() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Segment(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Segment( + 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: + { + contentCase_ = 1; + content_ = input.readBytes(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + contentCase_ = 2; + content_ = s; + break; + } + case 24: + { + allowPlaybackInterruption_ = 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.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + .class); + } + + private int contentCase_ = 0; + private java.lang.Object content_; + + public enum ContentCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AUDIO(1), + URI(2), + CONTENT_NOT_SET(0); + private final int value; + + private ContentCase(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 ContentCase valueOf(int value) { + return forNumber(value); + } + + public static ContentCase forNumber(int value) { + switch (value) { + case 1: + return AUDIO; + case 2: + return URI; + case 0: + return CONTENT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } + + public static final int AUDIO_FIELD_NUMBER = 1; + /** + * + * + *
+       * Raw audio synthesized from the Dialogflow agent's response using
+       * the output config specified in the request.
+       * 
+ * + * bytes audio = 1; + * + * @return The audio. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAudio() { + if (contentCase_ == 1) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int URI_FIELD_NUMBER = 2; + /** + * + * + *
+       * Client-specific URI that points to an audio clip accessible to the
+       * client. Dialogflow does not impose any validation on it.
+       * 
+ * + * string uri = 2; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (contentCase_ == 2) { + ref = content_; + } + 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 (contentCase_ == 2) { + content_ = s; + } + return s; + } + } + /** + * + * + *
+       * Client-specific URI that points to an audio clip accessible to the
+       * client. Dialogflow does not impose any validation on it.
+       * 
+ * + * string uri = 2; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 2) { + ref = content_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (contentCase_ == 2) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER = 3; + private boolean allowPlaybackInterruption_; + /** + * + * + *
+       * Whether the playback of this segment can be interrupted by the end
+       * user's speech and the client should then start the next Dialogflow
+       * request.
+       * 
+ * + * bool allow_playback_interruption = 3; + * + * @return The allowPlaybackInterruption. + */ + @java.lang.Override + public boolean getAllowPlaybackInterruption() { + return allowPlaybackInterruption_; + } + + 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 (contentCase_ == 1) { + output.writeBytes(1, (com.google.protobuf.ByteString) content_); + } + if (contentCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, content_); + } + if (allowPlaybackInterruption_ != false) { + output.writeBool(3, allowPlaybackInterruption_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (contentCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 1, (com.google.protobuf.ByteString) content_); + } + if (contentCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, content_); + } + if (allowPlaybackInterruption_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(3, allowPlaybackInterruption_); + } + 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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment other = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) obj; + + if (getAllowPlaybackInterruption() != other.getAllowPlaybackInterruption()) return false; + if (!getContentCase().equals(other.getContentCase())) return false; + switch (contentCase_) { + case 1: + if (!getAudio().equals(other.getAudio())) return false; + break; + case 2: + if (!getUri().equals(other.getUri())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowPlaybackInterruption()); + switch (contentCase_) { + case 1: + hash = (37 * hash) + AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getAudio().hashCode(); + break; + case 2: + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + 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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + 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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + 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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + 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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + 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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Represents one segment of audio.
+       * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.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(); + allowPlaybackInterruption_ = false; + + contentCase_ = 0; + content_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment build() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment result = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment(this); + if (contentCase_ == 1) { + result.content_ = content_; + } + if (contentCase_ == 2) { + result.content_ = content_; + } + result.allowPlaybackInterruption_ = allowPlaybackInterruption_; + result.contentCase_ = contentCase_; + 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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + .getDefaultInstance()) return this; + if (other.getAllowPlaybackInterruption() != false) { + setAllowPlaybackInterruption(other.getAllowPlaybackInterruption()); + } + switch (other.getContentCase()) { + case AUDIO: + { + setAudio(other.getAudio()); + break; + } + case URI: + { + contentCase_ = 2; + content_ = other.content_; + onChanged(); + break; + } + case CONTENT_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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int contentCase_ = 0; + private java.lang.Object content_; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } + + public Builder clearContent() { + contentCase_ = 0; + content_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+         * Raw audio synthesized from the Dialogflow agent's response using
+         * the output config specified in the request.
+         * 
+ * + * bytes audio = 1; + * + * @return The audio. + */ + public com.google.protobuf.ByteString getAudio() { + if (contentCase_ == 1) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+         * Raw audio synthesized from the Dialogflow agent's response using
+         * the output config specified in the request.
+         * 
+ * + * bytes audio = 1; + * + * @param value The audio to set. + * @return This builder for chaining. + */ + public Builder setAudio(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 1; + content_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Raw audio synthesized from the Dialogflow agent's response using
+         * the output config specified in the request.
+         * 
+ * + * bytes audio = 1; + * + * @return This builder for chaining. + */ + public Builder clearAudio() { + if (contentCase_ == 1) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client. Dialogflow does not impose any validation on it.
+         * 
+ * + * string uri = 2; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (contentCase_ == 2) { + ref = content_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (contentCase_ == 2) { + content_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client. Dialogflow does not impose any validation on it.
+         * 
+ * + * string uri = 2; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 2) { + ref = content_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (contentCase_ == 2) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client. Dialogflow does not impose any validation on it.
+         * 
+ * + * string uri = 2; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 2; + content_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client. Dialogflow does not impose any validation on it.
+         * 
+ * + * string uri = 2; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + if (contentCase_ == 2) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client. Dialogflow does not impose any validation on it.
+         * 
+ * + * string uri = 2; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + contentCase_ = 2; + content_ = value; + onChanged(); + return this; + } + + private boolean allowPlaybackInterruption_; + /** + * + * + *
+         * Whether the playback of this segment can be interrupted by the end
+         * user's speech and the client should then start the next Dialogflow
+         * request.
+         * 
+ * + * bool allow_playback_interruption = 3; + * + * @return The allowPlaybackInterruption. + */ + @java.lang.Override + public boolean getAllowPlaybackInterruption() { + return allowPlaybackInterruption_; + } + /** + * + * + *
+         * Whether the playback of this segment can be interrupted by the end
+         * user's speech and the client should then start the next Dialogflow
+         * request.
+         * 
+ * + * bool allow_playback_interruption = 3; + * + * @param value The allowPlaybackInterruption to set. + * @return This builder for chaining. + */ + public Builder setAllowPlaybackInterruption(boolean value) { + + allowPlaybackInterruption_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Whether the playback of this segment can be interrupted by the end
+         * user's speech and the client should then start the next Dialogflow
+         * request.
+         * 
+ * + * bool allow_playback_interruption = 3; + * + * @return This builder for chaining. + */ + public Builder clearAllowPlaybackInterruption() { + + allowPlaybackInterruption_ = 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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) + private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Segment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Segment(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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int SEGMENTS_FIELD_NUMBER = 1; + private java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment> + segments_; + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + @java.lang.Override + public java.util.List + getSegmentsList() { + return segments_; + } + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder> + getSegmentsOrBuilderList() { + return segments_; + } + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + @java.lang.Override + public int getSegmentsCount() { + return segments_.size(); + } + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment getSegments( + int index) { + return segments_.get(index); + } + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder + getSegmentsOrBuilder(int index) { + return segments_.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 < segments_.size(); i++) { + output.writeMessage(1, segments_.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 < segments_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, segments_.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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio other = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) obj; + + if (!getSegmentsList().equals(other.getSegmentsList())) 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 (getSegmentsCount() > 0) { + hash = (37 * hash) + SEGMENTS_FIELD_NUMBER; + hash = (53 * hash) + getSegmentsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio 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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio 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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio 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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + 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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio 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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Represents an audio message that is composed of both segments
+     * synthesized from the Dialogflow agent prompts and ones hosted externally
+     * at the specified URIs.
+     * The external URIs are specified via
+     * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+     * This message is generated by Dialogflow only and not supposed to be
+     * defined by the user.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudioOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSegmentsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (segmentsBuilder_ == null) { + segments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + segmentsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio build() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio result = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio(this); + int from_bitField0_ = bitField0_; + if (segmentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + segments_ = java.util.Collections.unmodifiableList(segments_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.segments_ = segments_; + } else { + result.segments_ = segmentsBuilder_.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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + .getDefaultInstance()) return this; + if (segmentsBuilder_ == null) { + if (!other.segments_.isEmpty()) { + if (segments_.isEmpty()) { + segments_ = other.segments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSegmentsIsMutable(); + segments_.addAll(other.segments_); + } + onChanged(); + } + } else { + if (!other.segments_.isEmpty()) { + if (segmentsBuilder_.isEmpty()) { + segmentsBuilder_.dispose(); + segmentsBuilder_ = null; + segments_ = other.segments_; + bitField0_ = (bitField0_ & ~0x00000001); + segmentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSegmentsFieldBuilder() + : null; + } else { + segmentsBuilder_.addAllMessages(other.segments_); + } + } + } + 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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment> + segments_ = java.util.Collections.emptyList(); + + private void ensureSegmentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + segments_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment>( + segments_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder> + segmentsBuilder_; + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment> + getSegmentsList() { + if (segmentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(segments_); + } else { + return segmentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public int getSegmentsCount() { + if (segmentsBuilder_ == null) { + return segments_.size(); + } else { + return segmentsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment getSegments( + int index) { + if (segmentsBuilder_ == null) { + return segments_.get(index); + } else { + return segmentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder setSegments( + int index, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.set(index, value); + onChanged(); + } else { + segmentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder setSegments( + int index, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.set(index, builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder addSegments( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.add(value); + onChanged(); + } else { + segmentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder addSegments( + int index, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.add(index, value); + onChanged(); + } else { + segmentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder addSegments( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.add(builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder addSegments( + int index, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.add(index, builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder addAllSegments( + java.lang.Iterable< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment> + values) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, segments_); + onChanged(); + } else { + segmentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder clearSegments() { + if (segmentsBuilder_ == null) { + segments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + segmentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder removeSegments(int index) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.remove(index); + onChanged(); + } else { + segmentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + getSegmentsBuilder(int index) { + return getSegmentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder + getSegmentsOrBuilder(int index) { + if (segmentsBuilder_ == null) { + return segments_.get(index); + } else { + return segmentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + .SegmentOrBuilder> + getSegmentsOrBuilderList() { + if (segmentsBuilder_ != null) { + return segmentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(segments_); + } + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + addSegmentsBuilder() { + return getSegmentsFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + .getDefaultInstance()); + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + addSegmentsBuilder(int index) { + return getSegmentsFieldBuilder() + .addBuilder( + index, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + .getDefaultInstance()); + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder> + getSegmentsBuilderList() { + return getSegmentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder> + getSegmentsFieldBuilder() { + if (segmentsBuilder_ == null) { + segmentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + .SegmentOrBuilder>( + segments_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + segments_ = null; + } + return segmentsBuilder_; + } + + @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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) + private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MixedAudio parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MixedAudio(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.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int messageCase_ = 0; + private java.lang.Object message_; + + public enum MessageCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TEXT(1), + PAYLOAD(2), + @java.lang.Deprecated + HUMAN_AGENT_HANDOFF(6), + CONVERSATION_SUCCESS(9), + OUTPUT_AUDIO_TEXT(8), + LIVE_AGENT_HANDOFF(10), + END_INTERACTION(11), + PLAY_AUDIO(12), + MIXED_AUDIO(13), + MESSAGE_NOT_SET(0); + private final int value; + + private MessageCase(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 MessageCase valueOf(int value) { + return forNumber(value); + } + + public static MessageCase forNumber(int value) { + switch (value) { + case 1: + return TEXT; + case 2: + return PAYLOAD; + case 6: + return HUMAN_AGENT_HANDOFF; + case 9: + return CONVERSATION_SUCCESS; + case 8: + return OUTPUT_AUDIO_TEXT; + case 10: + return LIVE_AGENT_HANDOFF; + case 11: + return END_INTERACTION; + case 12: + return PLAY_AUDIO; + case 13: + return MIXED_AUDIO; + case 0: + return MESSAGE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MessageCase getMessageCase() { + return MessageCase.forNumber(messageCase_); + } + + public static final int TEXT_FIELD_NUMBER = 1; + /** + * + * + *
+   * Returns a text response.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + * + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return messageCase_ == 1; + } + /** + * + * + *
+   * Returns a text response.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + * + * @return The text. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text getText() { + if (messageCase_ == 1) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.getDefaultInstance(); + } + /** + * + * + *
+   * Returns a text response.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TextOrBuilder getTextOrBuilder() { + if (messageCase_ == 1) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.getDefaultInstance(); + } + + public static final int PAYLOAD_FIELD_NUMBER = 2; + /** + * + * + *
+   * Returns a response containing a custom, platform-specific payload.
+   * 
+ * + * .google.protobuf.Struct payload = 2; + * + * @return Whether the payload field is set. + */ + @java.lang.Override + public boolean hasPayload() { + return messageCase_ == 2; + } + /** + * + * + *
+   * Returns a response containing a custom, platform-specific payload.
+   * 
+ * + * .google.protobuf.Struct payload = 2; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.Struct getPayload() { + if (messageCase_ == 2) { + return (com.google.protobuf.Struct) message_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + /** + * + * + *
+   * Returns a response containing a custom, platform-specific payload.
+   * 
+ * + * .google.protobuf.Struct payload = 2; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { + if (messageCase_ == 2) { + return (com.google.protobuf.Struct) message_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + + public static final int HUMAN_AGENT_HANDOFF_FIELD_NUMBER = 6; + /** + * + * + *
+   * Hands off conversation to a human agent.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + * + * @return Whether the humanAgentHandoff field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasHumanAgentHandoff() { + return messageCase_ == 6; + } + /** + * + * + *
+   * Hands off conversation to a human agent.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + * + * @return The humanAgentHandoff. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + getHumanAgentHandoff() { + if (messageCase_ == 6) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + .getDefaultInstance(); + } + /** + * + * + *
+   * Hands off conversation to a human agent.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoffOrBuilder + getHumanAgentHandoffOrBuilder() { + if (messageCase_ == 6) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + .getDefaultInstance(); + } + + public static final int CONVERSATION_SUCCESS_FIELD_NUMBER = 9; + /** + * + * + *
+   * Indicates that the conversation succeeded.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + * + * @return Whether the conversationSuccess field is set. + */ + @java.lang.Override + public boolean hasConversationSuccess() { + return messageCase_ == 9; + } + /** + * + * + *
+   * Indicates that the conversation succeeded.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + * + * @return The conversationSuccess. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + getConversationSuccess() { + if (messageCase_ == 9) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + .getDefaultInstance(); + } + /** + * + * + *
+   * Indicates that the conversation succeeded.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccessOrBuilder + getConversationSuccessOrBuilder() { + if (messageCase_ == 9) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + .getDefaultInstance(); + } + + public static final int OUTPUT_AUDIO_TEXT_FIELD_NUMBER = 8; + /** + * + * + *
+   * A text or ssml response that is preferentially used for TTS output audio
+   * synthesis, as described in the comment on the ResponseMessage message.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + * + * @return Whether the outputAudioText field is set. + */ + @java.lang.Override + public boolean hasOutputAudioText() { + return messageCase_ == 8; + } + /** + * + * + *
+   * A text or ssml response that is preferentially used for TTS output audio
+   * synthesis, as described in the comment on the ResponseMessage message.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + * + * @return The outputAudioText. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + getOutputAudioText() { + if (messageCase_ == 8) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + .getDefaultInstance(); + } + /** + * + * + *
+   * A text or ssml response that is preferentially used for TTS output audio
+   * synthesis, as described in the comment on the ResponseMessage message.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioTextOrBuilder + getOutputAudioTextOrBuilder() { + if (messageCase_ == 8) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + .getDefaultInstance(); + } + + public static final int LIVE_AGENT_HANDOFF_FIELD_NUMBER = 10; + /** + * + * + *
+   * Hands off conversation to a human agent.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + * + * @return Whether the liveAgentHandoff field is set. + */ + @java.lang.Override + public boolean hasLiveAgentHandoff() { + return messageCase_ == 10; + } + /** + * + * + *
+   * Hands off conversation to a human agent.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + * + * @return The liveAgentHandoff. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + getLiveAgentHandoff() { + if (messageCase_ == 10) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + .getDefaultInstance(); + } + /** + * + * + *
+   * Hands off conversation to a human agent.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoffOrBuilder + getLiveAgentHandoffOrBuilder() { + if (messageCase_ == 10) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + .getDefaultInstance(); + } + + public static final int END_INTERACTION_FIELD_NUMBER = 11; + /** + * + * + *
+   * Output only. A signal that indicates the interaction with the Dialogflow agent has
+   * ended.
+   * This message is generated by Dialogflow only when the conversation
+   * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+   * defined by the user.
+   * It's guaranteed that there is at most one such message in each response.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endInteraction field is set. + */ + @java.lang.Override + public boolean hasEndInteraction() { + return messageCase_ == 11; + } + /** + * + * + *
+   * Output only. A signal that indicates the interaction with the Dialogflow agent has
+   * ended.
+   * This message is generated by Dialogflow only when the conversation
+   * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+   * defined by the user.
+   * It's guaranteed that there is at most one such message in each response.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endInteraction. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction getEndInteraction() { + if (messageCase_ == 11) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + .getDefaultInstance(); + } + /** + * + * + *
+   * Output only. A signal that indicates the interaction with the Dialogflow agent has
+   * ended.
+   * This message is generated by Dialogflow only when the conversation
+   * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+   * defined by the user.
+   * It's guaranteed that there is at most one such message in each response.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteractionOrBuilder + getEndInteractionOrBuilder() { + if (messageCase_ == 11) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + .getDefaultInstance(); + } + + public static final int PLAY_AUDIO_FIELD_NUMBER = 12; + /** + * + * + *
+   * Signal that the client should play an audio clip hosted at a
+   * client-specific URI. Dialogflow uses this to construct
+   * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+   * does not try to read or process the URI in any way.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + * + * @return Whether the playAudio field is set. + */ + @java.lang.Override + public boolean hasPlayAudio() { + return messageCase_ == 12; + } + /** + * + * + *
+   * Signal that the client should play an audio clip hosted at a
+   * client-specific URI. Dialogflow uses this to construct
+   * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+   * does not try to read or process the URI in any way.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + * + * @return The playAudio. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio getPlayAudio() { + if (messageCase_ == 12) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.getDefaultInstance(); + } + /** + * + * + *
+   * Signal that the client should play an audio clip hosted at a
+   * client-specific URI. Dialogflow uses this to construct
+   * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+   * does not try to read or process the URI in any way.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudioOrBuilder + getPlayAudioOrBuilder() { + if (messageCase_ == 12) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.getDefaultInstance(); + } + + public static final int MIXED_AUDIO_FIELD_NUMBER = 13; + /** + * + * + *
+   * Output only. An audio response message composed of both the synthesized Dialogflow
+   * agent responses and responses defined via
+   * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+   * This message is generated by Dialogflow only and not supposed to be
+   * defined by the user.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the mixedAudio field is set. + */ + @java.lang.Override + public boolean hasMixedAudio() { + return messageCase_ == 13; + } + /** + * + * + *
+   * Output only. An audio response message composed of both the synthesized Dialogflow
+   * agent responses and responses defined via
+   * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+   * This message is generated by Dialogflow only and not supposed to be
+   * defined by the user.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The mixedAudio. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio getMixedAudio() { + if (messageCase_ == 13) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.getDefaultInstance(); + } + /** + * + * + *
+   * Output only. An audio response message composed of both the synthesized Dialogflow
+   * agent responses and responses defined via
+   * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+   * This message is generated by Dialogflow only and not supposed to be
+   * defined by the user.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudioOrBuilder + getMixedAudioOrBuilder() { + if (messageCase_ == 13) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.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 (messageCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) message_); + } + if (messageCase_ == 2) { + output.writeMessage(2, (com.google.protobuf.Struct) message_); + } + if (messageCase_ == 6) { + output.writeMessage( + 6, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) message_); + } + if (messageCase_ == 8) { + output.writeMessage( + 8, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) message_); + } + if (messageCase_ == 9) { + output.writeMessage( + 9, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) message_); + } + if (messageCase_ == 10) { + output.writeMessage( + 10, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) message_); + } + if (messageCase_ == 11) { + output.writeMessage( + 11, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) message_); + } + if (messageCase_ == 12) { + output.writeMessage( + 12, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) message_); + } + if (messageCase_ == 13) { + output.writeMessage( + 13, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) message_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (messageCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) message_); + } + if (messageCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.protobuf.Struct) message_); + } + if (messageCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) message_); + } + if (messageCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) message_); + } + if (messageCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) + message_); + } + if (messageCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) message_); + } + if (messageCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) message_); + } + if (messageCase_ == 12) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 12, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) message_); + } + if (messageCase_ == 13) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 13, (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) message_); + } + 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.dialogflow.cx.v3beta1.ResponseMessage)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage other = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage) obj; + + if (!getMessageCase().equals(other.getMessageCase())) return false; + switch (messageCase_) { + case 1: + if (!getText().equals(other.getText())) return false; + break; + case 2: + if (!getPayload().equals(other.getPayload())) return false; + break; + case 6: + if (!getHumanAgentHandoff().equals(other.getHumanAgentHandoff())) return false; + break; + case 9: + if (!getConversationSuccess().equals(other.getConversationSuccess())) return false; + break; + case 8: + if (!getOutputAudioText().equals(other.getOutputAudioText())) return false; + break; + case 10: + if (!getLiveAgentHandoff().equals(other.getLiveAgentHandoff())) return false; + break; + case 11: + if (!getEndInteraction().equals(other.getEndInteraction())) return false; + break; + case 12: + if (!getPlayAudio().equals(other.getPlayAudio())) return false; + break; + case 13: + if (!getMixedAudio().equals(other.getMixedAudio())) 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 (messageCase_) { + case 1: + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 2: + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + break; + case 6: + hash = (37 * hash) + HUMAN_AGENT_HANDOFF_FIELD_NUMBER; + hash = (53 * hash) + getHumanAgentHandoff().hashCode(); + break; + case 9: + hash = (37 * hash) + CONVERSATION_SUCCESS_FIELD_NUMBER; + hash = (53 * hash) + getConversationSuccess().hashCode(); + break; + case 8: + hash = (37 * hash) + OUTPUT_AUDIO_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getOutputAudioText().hashCode(); + break; + case 10: + hash = (37 * hash) + LIVE_AGENT_HANDOFF_FIELD_NUMBER; + hash = (53 * hash) + getLiveAgentHandoff().hashCode(); + break; + case 11: + hash = (37 * hash) + END_INTERACTION_FIELD_NUMBER; + hash = (53 * hash) + getEndInteraction().hashCode(); + break; + case 12: + hash = (37 * hash) + PLAY_AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getPlayAudio().hashCode(); + break; + case 13: + hash = (37 * hash) + MIXED_AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getMixedAudio().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage 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.dialogflow.cx.v3beta1.ResponseMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage 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.dialogflow.cx.v3beta1.ResponseMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage 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.dialogflow.cx.v3beta1.ResponseMessage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage 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.dialogflow.cx.v3beta1.ResponseMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage 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.dialogflow.cx.v3beta1.ResponseMessage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents a response message that can be returned by a conversational agent.
+   * Response messages are also used for output audio synthesis. The approach is
+   * as follows:
+   * * If at least one OutputAudioText response is present, then all
+   *   OutputAudioText responses are linearly concatenated, and the result is used
+   *   for output audio synthesis.
+   * * If the OutputAudioText responses are a mixture of text and SSML, then the
+   *   concatenated result is treated as SSML; otherwise, the result is treated as
+   *   either text or SSML as appropriate. The agent designer should ideally use
+   *   either text or SSML consistently throughout the bot design.
+   * * Otherwise, all Text responses are linearly concatenated, and the result is
+   *   used for output audio synthesis.
+   * This approach allows for more sophisticated user experience scenarios, where
+   * the text displayed to the user may differ from what is heard.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage) + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.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(); + messageCase_ = 0; + message_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage build() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage result = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage(this); + if (messageCase_ == 1) { + if (textBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = textBuilder_.build(); + } + } + if (messageCase_ == 2) { + if (payloadBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = payloadBuilder_.build(); + } + } + if (messageCase_ == 6) { + if (humanAgentHandoffBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = humanAgentHandoffBuilder_.build(); + } + } + if (messageCase_ == 9) { + if (conversationSuccessBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = conversationSuccessBuilder_.build(); + } + } + if (messageCase_ == 8) { + if (outputAudioTextBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = outputAudioTextBuilder_.build(); + } + } + if (messageCase_ == 10) { + if (liveAgentHandoffBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = liveAgentHandoffBuilder_.build(); + } + } + if (messageCase_ == 11) { + if (endInteractionBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = endInteractionBuilder_.build(); + } + } + if (messageCase_ == 12) { + if (playAudioBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = playAudioBuilder_.build(); + } + } + if (messageCase_ == 13) { + if (mixedAudioBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = mixedAudioBuilder_.build(); + } + } + result.messageCase_ = messageCase_; + 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.dialogflow.cx.v3beta1.ResponseMessage) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance()) + return this; + switch (other.getMessageCase()) { + case TEXT: + { + mergeText(other.getText()); + break; + } + case PAYLOAD: + { + mergePayload(other.getPayload()); + break; + } + case HUMAN_AGENT_HANDOFF: + { + mergeHumanAgentHandoff(other.getHumanAgentHandoff()); + break; + } + case CONVERSATION_SUCCESS: + { + mergeConversationSuccess(other.getConversationSuccess()); + break; + } + case OUTPUT_AUDIO_TEXT: + { + mergeOutputAudioText(other.getOutputAudioText()); + break; + } + case LIVE_AGENT_HANDOFF: + { + mergeLiveAgentHandoff(other.getLiveAgentHandoff()); + break; + } + case END_INTERACTION: + { + mergeEndInteraction(other.getEndInteraction()); + break; + } + case PLAY_AUDIO: + { + mergePlayAudio(other.getPlayAudio()); + break; + } + case MIXED_AUDIO: + { + mergeMixedAudio(other.getMixedAudio()); + break; + } + case MESSAGE_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.dialogflow.cx.v3beta1.ResponseMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int messageCase_ = 0; + private java.lang.Object message_; + + public MessageCase getMessageCase() { + return MessageCase.forNumber(messageCase_); + } + + public Builder clearMessage() { + messageCase_ = 0; + message_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TextOrBuilder> + textBuilder_; + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + * + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return messageCase_ == 1; + } + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + * + * @return The text. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text getText() { + if (textBuilder_ == null) { + if (messageCase_ == 1) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.getDefaultInstance(); + } else { + if (messageCase_ == 1) { + return textBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.getDefaultInstance(); + } + } + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + */ + public Builder setText(com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text value) { + if (textBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + textBuilder_.setMessage(value); + } + messageCase_ = 1; + return this; + } + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + */ + public Builder setText( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.Builder builderForValue) { + if (textBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + textBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 1; + return this; + } + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + */ + public Builder mergeText(com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text value) { + if (textBuilder_ == null) { + if (messageCase_ == 1 + && message_ + != com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text + .getDefaultInstance()) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 1) { + textBuilder_.mergeFrom(value); + } + textBuilder_.setMessage(value); + } + messageCase_ = 1; + return this; + } + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + */ + public Builder clearText() { + if (textBuilder_ == null) { + if (messageCase_ == 1) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 1) { + messageCase_ = 0; + message_ = null; + } + textBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.Builder getTextBuilder() { + return getTextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TextOrBuilder getTextOrBuilder() { + if ((messageCase_ == 1) && (textBuilder_ != null)) { + return textBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 1) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.getDefaultInstance(); + } + } + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TextOrBuilder> + getTextFieldBuilder() { + if (textBuilder_ == null) { + if (!(messageCase_ == 1)) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.getDefaultInstance(); + } + textBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TextOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 1; + onChanged(); + ; + return textBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + payloadBuilder_; + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + * + * @return Whether the payload field is set. + */ + @java.lang.Override + public boolean hasPayload() { + return messageCase_ == 2; + } + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.Struct getPayload() { + if (payloadBuilder_ == null) { + if (messageCase_ == 2) { + return (com.google.protobuf.Struct) message_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } else { + if (messageCase_ == 2) { + return payloadBuilder_.getMessage(); + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + } + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + */ + public Builder setPayload(com.google.protobuf.Struct value) { + if (payloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + payloadBuilder_.setMessage(value); + } + messageCase_ = 2; + return this; + } + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + */ + public Builder setPayload(com.google.protobuf.Struct.Builder builderForValue) { + if (payloadBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + payloadBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 2; + return this; + } + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + */ + public Builder mergePayload(com.google.protobuf.Struct value) { + if (payloadBuilder_ == null) { + if (messageCase_ == 2 && message_ != com.google.protobuf.Struct.getDefaultInstance()) { + message_ = + com.google.protobuf.Struct.newBuilder((com.google.protobuf.Struct) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 2) { + payloadBuilder_.mergeFrom(value); + } + payloadBuilder_.setMessage(value); + } + messageCase_ = 2; + return this; + } + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + */ + public Builder clearPayload() { + if (payloadBuilder_ == null) { + if (messageCase_ == 2) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 2) { + messageCase_ = 0; + message_ = null; + } + payloadBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + */ + public com.google.protobuf.Struct.Builder getPayloadBuilder() { + return getPayloadFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { + if ((messageCase_ == 2) && (payloadBuilder_ != null)) { + return payloadBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 2) { + return (com.google.protobuf.Struct) message_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + } + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getPayloadFieldBuilder() { + if (payloadBuilder_ == null) { + if (!(messageCase_ == 2)) { + message_ = com.google.protobuf.Struct.getDefaultInstance(); + } + payloadBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + (com.google.protobuf.Struct) message_, getParentForChildren(), isClean()); + message_ = null; + } + messageCase_ = 2; + onChanged(); + ; + return payloadBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoffOrBuilder> + humanAgentHandoffBuilder_; + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + * + * @return Whether the humanAgentHandoff field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasHumanAgentHandoff() { + return messageCase_ == 6; + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + * + * @return The humanAgentHandoff. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + getHumanAgentHandoff() { + if (humanAgentHandoffBuilder_ == null) { + if (messageCase_ == 6) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) + message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + .getDefaultInstance(); + } else { + if (messageCase_ == 6) { + return humanAgentHandoffBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setHumanAgentHandoff( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff value) { + if (humanAgentHandoffBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + humanAgentHandoffBuilder_.setMessage(value); + } + messageCase_ = 6; + return this; + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setHumanAgentHandoff( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff.Builder + builderForValue) { + if (humanAgentHandoffBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + humanAgentHandoffBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 6; + return this; + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder mergeHumanAgentHandoff( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff value) { + if (humanAgentHandoffBuilder_ == null) { + if (messageCase_ == 6 + && message_ + != com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + .getDefaultInstance()) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) + message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 6) { + humanAgentHandoffBuilder_.mergeFrom(value); + } + humanAgentHandoffBuilder_.setMessage(value); + } + messageCase_ = 6; + return this; + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder clearHumanAgentHandoff() { + if (humanAgentHandoffBuilder_ == null) { + if (messageCase_ == 6) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 6) { + messageCase_ = 0; + message_ = null; + } + humanAgentHandoffBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff.Builder + getHumanAgentHandoffBuilder() { + return getHumanAgentHandoffFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoffOrBuilder + getHumanAgentHandoffOrBuilder() { + if ((messageCase_ == 6) && (humanAgentHandoffBuilder_ != null)) { + return humanAgentHandoffBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 6) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) + message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoffOrBuilder> + getHumanAgentHandoffFieldBuilder() { + if (humanAgentHandoffBuilder_ == null) { + if (!(messageCase_ == 6)) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff + .getDefaultInstance(); + } + humanAgentHandoffBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoffOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 6; + onChanged(); + ; + return humanAgentHandoffBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccessOrBuilder> + conversationSuccessBuilder_; + /** + * + * + *
+     * Indicates that the conversation succeeded.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + * + * @return Whether the conversationSuccess field is set. + */ + @java.lang.Override + public boolean hasConversationSuccess() { + return messageCase_ == 9; + } + /** + * + * + *
+     * Indicates that the conversation succeeded.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + * + * @return The conversationSuccess. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + getConversationSuccess() { + if (conversationSuccessBuilder_ == null) { + if (messageCase_ == 9) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) + message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + .getDefaultInstance(); + } else { + if (messageCase_ == 9) { + return conversationSuccessBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Indicates that the conversation succeeded.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + */ + public Builder setConversationSuccess( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess value) { + if (conversationSuccessBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + conversationSuccessBuilder_.setMessage(value); + } + messageCase_ = 9; + return this; + } + /** + * + * + *
+     * Indicates that the conversation succeeded.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + */ + public Builder setConversationSuccess( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.Builder + builderForValue) { + if (conversationSuccessBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + conversationSuccessBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 9; + return this; + } + /** + * + * + *
+     * Indicates that the conversation succeeded.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + */ + public Builder mergeConversationSuccess( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess value) { + if (conversationSuccessBuilder_ == null) { + if (messageCase_ == 9 + && message_ + != com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + .getDefaultInstance()) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) + message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 9) { + conversationSuccessBuilder_.mergeFrom(value); + } + conversationSuccessBuilder_.setMessage(value); + } + messageCase_ = 9; + return this; + } + /** + * + * + *
+     * Indicates that the conversation succeeded.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + */ + public Builder clearConversationSuccess() { + if (conversationSuccessBuilder_ == null) { + if (messageCase_ == 9) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 9) { + messageCase_ = 0; + message_ = null; + } + conversationSuccessBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Indicates that the conversation succeeded.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.Builder + getConversationSuccessBuilder() { + return getConversationSuccessFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates that the conversation succeeded.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccessOrBuilder + getConversationSuccessOrBuilder() { + if ((messageCase_ == 9) && (conversationSuccessBuilder_ != null)) { + return conversationSuccessBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 9) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) + message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Indicates that the conversation succeeded.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccessOrBuilder> + getConversationSuccessFieldBuilder() { + if (conversationSuccessBuilder_ == null) { + if (!(messageCase_ == 9)) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + .getDefaultInstance(); + } + conversationSuccessBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage + .ConversationSuccessOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess) + message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 9; + onChanged(); + ; + return conversationSuccessBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioTextOrBuilder> + outputAudioTextBuilder_; + /** + * + * + *
+     * A text or ssml response that is preferentially used for TTS output audio
+     * synthesis, as described in the comment on the ResponseMessage message.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + * + * @return Whether the outputAudioText field is set. + */ + @java.lang.Override + public boolean hasOutputAudioText() { + return messageCase_ == 8; + } + /** + * + * + *
+     * A text or ssml response that is preferentially used for TTS output audio
+     * synthesis, as described in the comment on the ResponseMessage message.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + * + * @return The outputAudioText. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + getOutputAudioText() { + if (outputAudioTextBuilder_ == null) { + if (messageCase_ == 8) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + .getDefaultInstance(); + } else { + if (messageCase_ == 8) { + return outputAudioTextBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + .getDefaultInstance(); + } + } + /** + * + * + *
+     * A text or ssml response that is preferentially used for TTS output audio
+     * synthesis, as described in the comment on the ResponseMessage message.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + */ + public Builder setOutputAudioText( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText value) { + if (outputAudioTextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + outputAudioTextBuilder_.setMessage(value); + } + messageCase_ = 8; + return this; + } + /** + * + * + *
+     * A text or ssml response that is preferentially used for TTS output audio
+     * synthesis, as described in the comment on the ResponseMessage message.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + */ + public Builder setOutputAudioText( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.Builder + builderForValue) { + if (outputAudioTextBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + outputAudioTextBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 8; + return this; + } + /** + * + * + *
+     * A text or ssml response that is preferentially used for TTS output audio
+     * synthesis, as described in the comment on the ResponseMessage message.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + */ + public Builder mergeOutputAudioText( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText value) { + if (outputAudioTextBuilder_ == null) { + if (messageCase_ == 8 + && message_ + != com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + .getDefaultInstance()) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) + message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 8) { + outputAudioTextBuilder_.mergeFrom(value); + } + outputAudioTextBuilder_.setMessage(value); + } + messageCase_ = 8; + return this; + } + /** + * + * + *
+     * A text or ssml response that is preferentially used for TTS output audio
+     * synthesis, as described in the comment on the ResponseMessage message.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + */ + public Builder clearOutputAudioText() { + if (outputAudioTextBuilder_ == null) { + if (messageCase_ == 8) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 8) { + messageCase_ = 0; + message_ = null; + } + outputAudioTextBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A text or ssml response that is preferentially used for TTS output audio
+     * synthesis, as described in the comment on the ResponseMessage message.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.Builder + getOutputAudioTextBuilder() { + return getOutputAudioTextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A text or ssml response that is preferentially used for TTS output audio
+     * synthesis, as described in the comment on the ResponseMessage message.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioTextOrBuilder + getOutputAudioTextOrBuilder() { + if ((messageCase_ == 8) && (outputAudioTextBuilder_ != null)) { + return outputAudioTextBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 8) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + .getDefaultInstance(); + } + } + /** + * + * + *
+     * A text or ssml response that is preferentially used for TTS output audio
+     * synthesis, as described in the comment on the ResponseMessage message.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioTextOrBuilder> + getOutputAudioTextFieldBuilder() { + if (outputAudioTextBuilder_ == null) { + if (!(messageCase_ == 8)) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText + .getDefaultInstance(); + } + outputAudioTextBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioTextOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 8; + onChanged(); + ; + return outputAudioTextBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoffOrBuilder> + liveAgentHandoffBuilder_; + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + * + * @return Whether the liveAgentHandoff field is set. + */ + @java.lang.Override + public boolean hasLiveAgentHandoff() { + return messageCase_ == 10; + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + * + * @return The liveAgentHandoff. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + getLiveAgentHandoff() { + if (liveAgentHandoffBuilder_ == null) { + if (messageCase_ == 10) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + .getDefaultInstance(); + } else { + if (messageCase_ == 10) { + return liveAgentHandoffBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + */ + public Builder setLiveAgentHandoff( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff value) { + if (liveAgentHandoffBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + liveAgentHandoffBuilder_.setMessage(value); + } + messageCase_ = 10; + return this; + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + */ + public Builder setLiveAgentHandoff( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.Builder + builderForValue) { + if (liveAgentHandoffBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + liveAgentHandoffBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 10; + return this; + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + */ + public Builder mergeLiveAgentHandoff( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff value) { + if (liveAgentHandoffBuilder_ == null) { + if (messageCase_ == 10 + && message_ + != com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + .getDefaultInstance()) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) + message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 10) { + liveAgentHandoffBuilder_.mergeFrom(value); + } + liveAgentHandoffBuilder_.setMessage(value); + } + messageCase_ = 10; + return this; + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + */ + public Builder clearLiveAgentHandoff() { + if (liveAgentHandoffBuilder_ == null) { + if (messageCase_ == 10) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 10) { + messageCase_ = 0; + message_ = null; + } + liveAgentHandoffBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.Builder + getLiveAgentHandoffBuilder() { + return getLiveAgentHandoffFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoffOrBuilder + getLiveAgentHandoffOrBuilder() { + if ((messageCase_ == 10) && (liveAgentHandoffBuilder_ != null)) { + return liveAgentHandoffBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 10) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Hands off conversation to a human agent.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoffOrBuilder> + getLiveAgentHandoffFieldBuilder() { + if (liveAgentHandoffBuilder_ == null) { + if (!(messageCase_ == 10)) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff + .getDefaultInstance(); + } + liveAgentHandoffBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoffOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 10; + onChanged(); + ; + return liveAgentHandoffBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteractionOrBuilder> + endInteractionBuilder_; + /** + * + * + *
+     * Output only. A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * This message is generated by Dialogflow only when the conversation
+     * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+     * defined by the user.
+     * It's guaranteed that there is at most one such message in each response.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endInteraction field is set. + */ + @java.lang.Override + public boolean hasEndInteraction() { + return messageCase_ == 11; + } + /** + * + * + *
+     * Output only. A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * This message is generated by Dialogflow only when the conversation
+     * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+     * defined by the user.
+     * It's guaranteed that there is at most one such message in each response.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endInteraction. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + getEndInteraction() { + if (endInteractionBuilder_ == null) { + if (messageCase_ == 11) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + .getDefaultInstance(); + } else { + if (messageCase_ == 11) { + return endInteractionBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * This message is generated by Dialogflow only when the conversation
+     * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+     * defined by the user.
+     * It's guaranteed that there is at most one such message in each response.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndInteraction( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction value) { + if (endInteractionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + endInteractionBuilder_.setMessage(value); + } + messageCase_ = 11; + return this; + } + /** + * + * + *
+     * Output only. A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * This message is generated by Dialogflow only when the conversation
+     * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+     * defined by the user.
+     * It's guaranteed that there is at most one such message in each response.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndInteraction( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.Builder + builderForValue) { + if (endInteractionBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + endInteractionBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 11; + return this; + } + /** + * + * + *
+     * Output only. A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * This message is generated by Dialogflow only when the conversation
+     * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+     * defined by the user.
+     * It's guaranteed that there is at most one such message in each response.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndInteraction( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction value) { + if (endInteractionBuilder_ == null) { + if (messageCase_ == 11 + && message_ + != com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + .getDefaultInstance()) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 11) { + endInteractionBuilder_.mergeFrom(value); + } + endInteractionBuilder_.setMessage(value); + } + messageCase_ = 11; + return this; + } + /** + * + * + *
+     * Output only. A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * This message is generated by Dialogflow only when the conversation
+     * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+     * defined by the user.
+     * It's guaranteed that there is at most one such message in each response.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndInteraction() { + if (endInteractionBuilder_ == null) { + if (messageCase_ == 11) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 11) { + messageCase_ = 0; + message_ = null; + } + endInteractionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * This message is generated by Dialogflow only when the conversation
+     * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+     * defined by the user.
+     * It's guaranteed that there is at most one such message in each response.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.Builder + getEndInteractionBuilder() { + return getEndInteractionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * This message is generated by Dialogflow only when the conversation
+     * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+     * defined by the user.
+     * It's guaranteed that there is at most one such message in each response.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteractionOrBuilder + getEndInteractionOrBuilder() { + if ((messageCase_ == 11) && (endInteractionBuilder_ != null)) { + return endInteractionBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 11) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * This message is generated by Dialogflow only when the conversation
+     * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+     * defined by the user.
+     * It's guaranteed that there is at most one such message in each response.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteractionOrBuilder> + getEndInteractionFieldBuilder() { + if (endInteractionBuilder_ == null) { + if (!(messageCase_ == 11)) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + .getDefaultInstance(); + } + endInteractionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteractionOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 11; + onChanged(); + ; + return endInteractionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudioOrBuilder> + playAudioBuilder_; + /** + * + * + *
+     * Signal that the client should play an audio clip hosted at a
+     * client-specific URI. Dialogflow uses this to construct
+     * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+     * does not try to read or process the URI in any way.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + * + * @return Whether the playAudio field is set. + */ + @java.lang.Override + public boolean hasPlayAudio() { + return messageCase_ == 12; + } + /** + * + * + *
+     * Signal that the client should play an audio clip hosted at a
+     * client-specific URI. Dialogflow uses this to construct
+     * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+     * does not try to read or process the URI in any way.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + * + * @return The playAudio. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio getPlayAudio() { + if (playAudioBuilder_ == null) { + if (messageCase_ == 12) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + .getDefaultInstance(); + } else { + if (messageCase_ == 12) { + return playAudioBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Signal that the client should play an audio clip hosted at a
+     * client-specific URI. Dialogflow uses this to construct
+     * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+     * does not try to read or process the URI in any way.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + */ + public Builder setPlayAudio( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio value) { + if (playAudioBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + playAudioBuilder_.setMessage(value); + } + messageCase_ = 12; + return this; + } + /** + * + * + *
+     * Signal that the client should play an audio clip hosted at a
+     * client-specific URI. Dialogflow uses this to construct
+     * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+     * does not try to read or process the URI in any way.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + */ + public Builder setPlayAudio( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.Builder builderForValue) { + if (playAudioBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + playAudioBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 12; + return this; + } + /** + * + * + *
+     * Signal that the client should play an audio clip hosted at a
+     * client-specific URI. Dialogflow uses this to construct
+     * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+     * does not try to read or process the URI in any way.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + */ + public Builder mergePlayAudio( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio value) { + if (playAudioBuilder_ == null) { + if (messageCase_ == 12 + && message_ + != com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + .getDefaultInstance()) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 12) { + playAudioBuilder_.mergeFrom(value); + } + playAudioBuilder_.setMessage(value); + } + messageCase_ = 12; + return this; + } + /** + * + * + *
+     * Signal that the client should play an audio clip hosted at a
+     * client-specific URI. Dialogflow uses this to construct
+     * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+     * does not try to read or process the URI in any way.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + */ + public Builder clearPlayAudio() { + if (playAudioBuilder_ == null) { + if (messageCase_ == 12) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 12) { + messageCase_ = 0; + message_ = null; + } + playAudioBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Signal that the client should play an audio clip hosted at a
+     * client-specific URI. Dialogflow uses this to construct
+     * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+     * does not try to read or process the URI in any way.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.Builder + getPlayAudioBuilder() { + return getPlayAudioFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Signal that the client should play an audio clip hosted at a
+     * client-specific URI. Dialogflow uses this to construct
+     * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+     * does not try to read or process the URI in any way.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudioOrBuilder + getPlayAudioOrBuilder() { + if ((messageCase_ == 12) && (playAudioBuilder_ != null)) { + return playAudioBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 12) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Signal that the client should play an audio clip hosted at a
+     * client-specific URI. Dialogflow uses this to construct
+     * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+     * does not try to read or process the URI in any way.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudioOrBuilder> + getPlayAudioFieldBuilder() { + if (playAudioBuilder_ == null) { + if (!(messageCase_ == 12)) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.getDefaultInstance(); + } + playAudioBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudioOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 12; + onChanged(); + ; + return playAudioBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudioOrBuilder> + mixedAudioBuilder_; + /** + * + * + *
+     * Output only. An audio response message composed of both the synthesized Dialogflow
+     * agent responses and responses defined via
+     * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+     * This message is generated by Dialogflow only and not supposed to be
+     * defined by the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the mixedAudio field is set. + */ + @java.lang.Override + public boolean hasMixedAudio() { + return messageCase_ == 13; + } + /** + * + * + *
+     * Output only. An audio response message composed of both the synthesized Dialogflow
+     * agent responses and responses defined via
+     * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+     * This message is generated by Dialogflow only and not supposed to be
+     * defined by the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The mixedAudio. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio getMixedAudio() { + if (mixedAudioBuilder_ == null) { + if (messageCase_ == 13) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + .getDefaultInstance(); + } else { + if (messageCase_ == 13) { + return mixedAudioBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. An audio response message composed of both the synthesized Dialogflow
+     * agent responses and responses defined via
+     * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+     * This message is generated by Dialogflow only and not supposed to be
+     * defined by the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMixedAudio( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio value) { + if (mixedAudioBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + mixedAudioBuilder_.setMessage(value); + } + messageCase_ = 13; + return this; + } + /** + * + * + *
+     * Output only. An audio response message composed of both the synthesized Dialogflow
+     * agent responses and responses defined via
+     * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+     * This message is generated by Dialogflow only and not supposed to be
+     * defined by the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMixedAudio( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Builder builderForValue) { + if (mixedAudioBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + mixedAudioBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 13; + return this; + } + /** + * + * + *
+     * Output only. An audio response message composed of both the synthesized Dialogflow
+     * agent responses and responses defined via
+     * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+     * This message is generated by Dialogflow only and not supposed to be
+     * defined by the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMixedAudio( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio value) { + if (mixedAudioBuilder_ == null) { + if (messageCase_ == 13 + && message_ + != com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + .getDefaultInstance()) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 13) { + mixedAudioBuilder_.mergeFrom(value); + } + mixedAudioBuilder_.setMessage(value); + } + messageCase_ = 13; + return this; + } + /** + * + * + *
+     * Output only. An audio response message composed of both the synthesized Dialogflow
+     * agent responses and responses defined via
+     * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+     * This message is generated by Dialogflow only and not supposed to be
+     * defined by the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMixedAudio() { + if (mixedAudioBuilder_ == null) { + if (messageCase_ == 13) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 13) { + messageCase_ = 0; + message_ = null; + } + mixedAudioBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. An audio response message composed of both the synthesized Dialogflow
+     * agent responses and responses defined via
+     * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+     * This message is generated by Dialogflow only and not supposed to be
+     * defined by the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Builder + getMixedAudioBuilder() { + return getMixedAudioFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. An audio response message composed of both the synthesized Dialogflow
+     * agent responses and responses defined via
+     * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+     * This message is generated by Dialogflow only and not supposed to be
+     * defined by the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudioOrBuilder + getMixedAudioOrBuilder() { + if ((messageCase_ == 13) && (mixedAudioBuilder_ != null)) { + return mixedAudioBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 13) { + return (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) message_; + } + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Output only. An audio response message composed of both the synthesized Dialogflow
+     * agent responses and responses defined via
+     * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+     * This message is generated by Dialogflow only and not supposed to be
+     * defined by the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudioOrBuilder> + getMixedAudioFieldBuilder() { + if (mixedAudioBuilder_ == null) { + if (!(messageCase_ == 13)) { + message_ = + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + .getDefaultInstance(); + } + mixedAudioBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudioOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 13; + onChanged(); + ; + return mixedAudioBuilder_; + } + + @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.dialogflow.cx.v3beta1.ResponseMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage) + private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResponseMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ResponseMessage(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.dialogflow.cx.v3beta1.ResponseMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessageOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessageOrBuilder.java new file mode 100644 index 000000000..2e6687971 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessageOrBuilder.java @@ -0,0 +1,427 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/response_message.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface ResponseMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Returns a text response.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + * + * @return Whether the text field is set. + */ + boolean hasText(); + /** + * + * + *
+   * Returns a text response.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + * + * @return The text. + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text getText(); + /** + * + * + *
+   * Returns a text response.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text text = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.TextOrBuilder getTextOrBuilder(); + + /** + * + * + *
+   * Returns a response containing a custom, platform-specific payload.
+   * 
+ * + * .google.protobuf.Struct payload = 2; + * + * @return Whether the payload field is set. + */ + boolean hasPayload(); + /** + * + * + *
+   * Returns a response containing a custom, platform-specific payload.
+   * 
+ * + * .google.protobuf.Struct payload = 2; + * + * @return The payload. + */ + com.google.protobuf.Struct getPayload(); + /** + * + * + *
+   * Returns a response containing a custom, platform-specific payload.
+   * 
+ * + * .google.protobuf.Struct payload = 2; + */ + com.google.protobuf.StructOrBuilder getPayloadOrBuilder(); + + /** + * + * + *
+   * Hands off conversation to a human agent.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + * + * @return Whether the humanAgentHandoff field is set. + */ + @java.lang.Deprecated + boolean hasHumanAgentHandoff(); + /** + * + * + *
+   * Hands off conversation to a human agent.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + * + * @return The humanAgentHandoff. + */ + @java.lang.Deprecated + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff getHumanAgentHandoff(); + /** + * + * + *
+   * Hands off conversation to a human agent.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + * + */ + @java.lang.Deprecated + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.HumanAgentHandoffOrBuilder + getHumanAgentHandoffOrBuilder(); + + /** + * + * + *
+   * Indicates that the conversation succeeded.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + * + * @return Whether the conversationSuccess field is set. + */ + boolean hasConversationSuccess(); + /** + * + * + *
+   * Indicates that the conversation succeeded.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + * + * @return The conversationSuccess. + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess + getConversationSuccess(); + /** + * + * + *
+   * Indicates that the conversation succeeded.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess conversation_success = 9; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccessOrBuilder + getConversationSuccessOrBuilder(); + + /** + * + * + *
+   * A text or ssml response that is preferentially used for TTS output audio
+   * synthesis, as described in the comment on the ResponseMessage message.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + * + * @return Whether the outputAudioText field is set. + */ + boolean hasOutputAudioText(); + /** + * + * + *
+   * A text or ssml response that is preferentially used for TTS output audio
+   * synthesis, as described in the comment on the ResponseMessage message.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + * + * @return The outputAudioText. + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText getOutputAudioText(); + /** + * + * + *
+   * A text or ssml response that is preferentially used for TTS output audio
+   * synthesis, as described in the comment on the ResponseMessage message.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioText output_audio_text = 8; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.OutputAudioTextOrBuilder + getOutputAudioTextOrBuilder(); + + /** + * + * + *
+   * Hands off conversation to a human agent.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + * + * @return Whether the liveAgentHandoff field is set. + */ + boolean hasLiveAgentHandoff(); + /** + * + * + *
+   * Hands off conversation to a human agent.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + * + * @return The liveAgentHandoff. + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff getLiveAgentHandoff(); + /** + * + * + *
+   * Hands off conversation to a human agent.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoff live_agent_handoff = 10; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.LiveAgentHandoffOrBuilder + getLiveAgentHandoffOrBuilder(); + + /** + * + * + *
+   * Output only. A signal that indicates the interaction with the Dialogflow agent has
+   * ended.
+   * This message is generated by Dialogflow only when the conversation
+   * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+   * defined by the user.
+   * It's guaranteed that there is at most one such message in each response.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endInteraction field is set. + */ + boolean hasEndInteraction(); + /** + * + * + *
+   * Output only. A signal that indicates the interaction with the Dialogflow agent has
+   * ended.
+   * This message is generated by Dialogflow only when the conversation
+   * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+   * defined by the user.
+   * It's guaranteed that there is at most one such message in each response.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endInteraction. + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction getEndInteraction(); + /** + * + * + *
+   * Output only. A signal that indicates the interaction with the Dialogflow agent has
+   * ended.
+   * This message is generated by Dialogflow only when the conversation
+   * reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be
+   * defined by the user.
+   * It's guaranteed that there is at most one such message in each response.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction end_interaction = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteractionOrBuilder + getEndInteractionOrBuilder(); + + /** + * + * + *
+   * Signal that the client should play an audio clip hosted at a
+   * client-specific URI. Dialogflow uses this to construct
+   * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+   * does not try to read or process the URI in any way.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + * + * @return Whether the playAudio field is set. + */ + boolean hasPlayAudio(); + /** + * + * + *
+   * Signal that the client should play an audio clip hosted at a
+   * client-specific URI. Dialogflow uses this to construct
+   * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+   * does not try to read or process the URI in any way.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + * + * @return The playAudio. + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio getPlayAudio(); + /** + * + * + *
+   * Signal that the client should play an audio clip hosted at a
+   * client-specific URI. Dialogflow uses this to construct
+   * [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself
+   * does not try to read or process the URI in any way.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio play_audio = 12; + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudioOrBuilder getPlayAudioOrBuilder(); + + /** + * + * + *
+   * Output only. An audio response message composed of both the synthesized Dialogflow
+   * agent responses and responses defined via
+   * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+   * This message is generated by Dialogflow only and not supposed to be
+   * defined by the user.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the mixedAudio field is set. + */ + boolean hasMixedAudio(); + /** + * + * + *
+   * Output only. An audio response message composed of both the synthesized Dialogflow
+   * agent responses and responses defined via
+   * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+   * This message is generated by Dialogflow only and not supposed to be
+   * defined by the user.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The mixedAudio. + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio getMixedAudio(); + /** + * + * + *
+   * Output only. An audio response message composed of both the synthesized Dialogflow
+   * agent responses and responses defined via
+   * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+   * This message is generated by Dialogflow only and not supposed to be
+   * defined by the user.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio mixed_audio = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudioOrBuilder + getMixedAudioOrBuilder(); + + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MessageCase getMessageCase(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessageProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessageProto.java new file mode 100644 index 000000000..ede4b546f --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessageProto.java @@ -0,0 +1,250 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/response_message.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class ResponseMessageProto { + private ResponseMessageProto() {} + + 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_dialogflow_cx_v3beta1_ResponseMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_Text_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_Text_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_HumanAgentHandoff_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_HumanAgentHandoff_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_LiveAgentHandoff_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_LiveAgentHandoff_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_ConversationSuccess_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_ConversationSuccess_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_OutputAudioText_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_OutputAudioText_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n9google/cloud/dialogflow/cx/v3beta1/res" + + "ponse_message.proto\022\"google.cloud.dialog" + + "flow.cx.v3beta1\032\037google/api/field_behavi" + + "or.proto\032\034google/protobuf/struct.proto\032\034" + + "google/api/annotations.proto\"\242\013\n\017Respons" + + "eMessage\022H\n\004text\030\001 \001(\01328.google.cloud.di" + + "alogflow.cx.v3beta1.ResponseMessage.Text" + + "H\000\022*\n\007payload\030\002 \001(\0132\027.google.protobuf.St" + + "ructH\000\022h\n\023human_agent_handoff\030\006 \001(\0132E.go" + + "ogle.cloud.dialogflow.cx.v3beta1.Respons" + + "eMessage.HumanAgentHandoffB\002\030\001H\000\022g\n\024conv" + + "ersation_success\030\t \001(\0132G.google.cloud.di" + + "alogflow.cx.v3beta1.ResponseMessage.Conv" + + "ersationSuccessH\000\022`\n\021output_audio_text\030\010" + + " \001(\0132C.google.cloud.dialogflow.cx.v3beta" + + "1.ResponseMessage.OutputAudioTextH\000\022b\n\022l" + + "ive_agent_handoff\030\n \001(\0132D.google.cloud.d" + + "ialogflow.cx.v3beta1.ResponseMessage.Liv" + + "eAgentHandoffH\000\022b\n\017end_interaction\030\013 \001(\013" + + "2B.google.cloud.dialogflow.cx.v3beta1.Re" + + "sponseMessage.EndInteractionB\003\340A\003H\000\022S\n\np" + + "lay_audio\030\014 \001(\0132=.google.cloud.dialogflo" + + "w.cx.v3beta1.ResponseMessage.PlayAudioH\000" + + "\022Z\n\013mixed_audio\030\r \001(\0132>.google.cloud.dia" + + "logflow.cx.v3beta1.ResponseMessage.Mixed" + + "AudioB\003\340A\003H\000\032>\n\004Text\022\021\n\004text\030\001 \003(\tB\003\340A\002\022" + + "#\n\033allow_playback_interruption\030\002 \001(\010\032B\n\021" + + "HumanAgentHandoff\022)\n\010metadata\030\001 \001(\0132\027.go" + + "ogle.protobuf.Struct:\002\030\001\032=\n\020LiveAgentHan" + + "doff\022)\n\010metadata\030\001 \001(\0132\027.google.protobuf" + + ".Struct\032@\n\023ConversationSuccess\022)\n\010metada" + + "ta\030\001 \001(\0132\027.google.protobuf.Struct\032H\n\tPla" + + "yAudio\022\026\n\taudio_uri\030\001 \001(\tB\003\340A\002\022#\n\033allow_" + + "playback_interruption\030\002 \001(\010\032;\n\017OutputAud" + + "ioText\022\016\n\004text\030\001 \001(\tH\000\022\016\n\004ssml\030\002 \001(\tH\000B\010" + + "\n\006source\032\020\n\016EndInteraction\032\301\001\n\nMixedAudi" + + "o\022X\n\010segments\030\001 \003(\0132F.google.cloud.dialo" + + "gflow.cx.v3beta1.ResponseMessage.MixedAu" + + "dio.Segment\032Y\n\007Segment\022\017\n\005audio\030\001 \001(\014H\000\022" + + "\r\n\003uri\030\002 \001(\tH\000\022#\n\033allow_playback_interru" + + "ption\030\003 \001(\010B\t\n\007contentB\t\n\007messageB\263\001\n&co" + + "m.google.cloud.dialogflow.cx.v3beta1B\024Re" + + "sponseMessageProtoP\001ZDgoogle.golang.org/" + + "genproto/googleapis/cloud/dialogflow/cx/" + + "v3beta1;cx\370\001\001\242\002\002DF\252\002\"Google.Cloud.Dialog" + + "flow.Cx.V3Beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor, + new java.lang.String[] { + "Text", + "Payload", + "HumanAgentHandoff", + "ConversationSuccess", + "OutputAudioText", + "LiveAgentHandoff", + "EndInteraction", + "PlayAudio", + "MixedAudio", + "Message", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_Text_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_Text_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_Text_descriptor, + new java.lang.String[] { + "Text", "AllowPlaybackInterruption", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_HumanAgentHandoff_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_HumanAgentHandoff_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_HumanAgentHandoff_descriptor, + new java.lang.String[] { + "Metadata", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_LiveAgentHandoff_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_LiveAgentHandoff_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_LiveAgentHandoff_descriptor, + new java.lang.String[] { + "Metadata", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_ConversationSuccess_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_ConversationSuccess_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_ConversationSuccess_descriptor, + new java.lang.String[] { + "Metadata", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor + .getNestedTypes() + .get(4); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor, + new java.lang.String[] { + "AudioUri", "AllowPlaybackInterruption", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_OutputAudioText_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor + .getNestedTypes() + .get(5); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_OutputAudioText_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_OutputAudioText_descriptor, + new java.lang.String[] { + "Text", "Ssml", "Source", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor + .getNestedTypes() + .get(6); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor + .getNestedTypes() + .get(7); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor, + new java.lang.String[] { + "Segments", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor, + new java.lang.String[] { + "Audio", "Uri", "AllowPlaybackInterruption", "Content", + }); + 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.protobuf.StructProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/RestoreAgentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/RestoreAgentRequest.java new file mode 100644 index 000000000..ea4141050 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/RestoreAgentRequest.java @@ -0,0 +1,1063 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Agents.RestoreAgent][google.cloud.dialogflow.cx.v3beta1.Agents.RestoreAgent].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest} + */ +public final class RestoreAgentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest) + RestoreAgentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RestoreAgentRequest.newBuilder() to construct. + private RestoreAgentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestoreAgentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestoreAgentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RestoreAgentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + agentCase_ = 2; + agent_ = s; + break; + } + case 26: + { + agentCase_ = 3; + agent_ = input.readBytes(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_RestoreAgentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_RestoreAgentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.Builder.class); + } + + private int agentCase_ = 0; + private java.lang.Object agent_; + + public enum AgentCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AGENT_URI(2), + AGENT_CONTENT(3), + AGENT_NOT_SET(0); + private final int value; + + private AgentCase(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 AgentCase valueOf(int value) { + return forNumber(value); + } + + public static AgentCase forNumber(int value) { + switch (value) { + case 2: + return AGENT_URI; + case 3: + return AGENT_CONTENT; + case 0: + return AGENT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public AgentCase getAgentCase() { + return AgentCase.forNumber(agentCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the agent to restore into.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the agent to restore into.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AGENT_URI_FIELD_NUMBER = 2; + /** + * + * + *
+   * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
+   * to restore agent from. The format of this URI must be
+   * `gs://<bucket-name>/<object-name>`.
+   * 
+ * + * string agent_uri = 2; + * + * @return The agentUri. + */ + public java.lang.String getAgentUri() { + java.lang.Object ref = ""; + if (agentCase_ == 2) { + ref = agent_; + } + 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 (agentCase_ == 2) { + agent_ = s; + } + return s; + } + } + /** + * + * + *
+   * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
+   * to restore agent from. The format of this URI must be
+   * `gs://<bucket-name>/<object-name>`.
+   * 
+ * + * string agent_uri = 2; + * + * @return The bytes for agentUri. + */ + public com.google.protobuf.ByteString getAgentUriBytes() { + java.lang.Object ref = ""; + if (agentCase_ == 2) { + ref = agent_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (agentCase_ == 2) { + agent_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AGENT_CONTENT_FIELD_NUMBER = 3; + /** + * + * + *
+   * Uncompressed raw byte content for agent.
+   * 
+ * + * bytes agent_content = 3; + * + * @return The agentContent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAgentContent() { + if (agentCase_ == 3) { + return (com.google.protobuf.ByteString) agent_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (agentCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, agent_); + } + if (agentCase_ == 3) { + output.writeBytes(3, (com.google.protobuf.ByteString) agent_); + } + 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 (agentCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, agent_); + } + if (agentCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 3, (com.google.protobuf.ByteString) agent_); + } + 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.dialogflow.cx.v3beta1.RestoreAgentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAgentCase().equals(other.getAgentCase())) return false; + switch (agentCase_) { + case 2: + if (!getAgentUri().equals(other.getAgentUri())) return false; + break; + case 3: + if (!getAgentContent().equals(other.getAgentContent())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + switch (agentCase_) { + case 2: + hash = (37 * hash) + AGENT_URI_FIELD_NUMBER; + hash = (53 * hash) + getAgentUri().hashCode(); + break; + case 3: + hash = (37 * hash) + AGENT_CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getAgentContent().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest 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.dialogflow.cx.v3beta1.RestoreAgentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest 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.dialogflow.cx.v3beta1.RestoreAgentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest 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.dialogflow.cx.v3beta1.RestoreAgentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest 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.dialogflow.cx.v3beta1.RestoreAgentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest 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.dialogflow.cx.v3beta1.RestoreAgentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Agents.RestoreAgent][google.cloud.dialogflow.cx.v3beta1.Agents.RestoreAgent].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest) + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_RestoreAgentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_RestoreAgentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.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_ = ""; + + agentCase_ = 0; + agent_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_RestoreAgentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest(this); + result.name_ = name_; + if (agentCase_ == 2) { + result.agent_ = agent_; + } + if (agentCase_ == 3) { + result.agent_ = agent_; + } + result.agentCase_ = agentCase_; + 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.dialogflow.cx.v3beta1.RestoreAgentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + switch (other.getAgentCase()) { + case AGENT_URI: + { + agentCase_ = 2; + agent_ = other.agent_; + onChanged(); + break; + } + case AGENT_CONTENT: + { + setAgentContent(other.getAgentContent()); + break; + } + case AGENT_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.dialogflow.cx.v3beta1.RestoreAgentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int agentCase_ = 0; + private java.lang.Object agent_; + + public AgentCase getAgentCase() { + return AgentCase.forNumber(agentCase_); + } + + public Builder clearAgent() { + agentCase_ = 0; + agent_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the agent to restore into.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the agent to restore into.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the agent to restore into.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 name of the agent to restore into.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the agent to restore into.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + + /** + * + * + *
+     * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
+     * to restore agent from. The format of this URI must be
+     * `gs://<bucket-name>/<object-name>`.
+     * 
+ * + * string agent_uri = 2; + * + * @return The agentUri. + */ + @java.lang.Override + public java.lang.String getAgentUri() { + java.lang.Object ref = ""; + if (agentCase_ == 2) { + ref = agent_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (agentCase_ == 2) { + agent_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
+     * to restore agent from. The format of this URI must be
+     * `gs://<bucket-name>/<object-name>`.
+     * 
+ * + * string agent_uri = 2; + * + * @return The bytes for agentUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAgentUriBytes() { + java.lang.Object ref = ""; + if (agentCase_ == 2) { + ref = agent_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (agentCase_ == 2) { + agent_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
+     * to restore agent from. The format of this URI must be
+     * `gs://<bucket-name>/<object-name>`.
+     * 
+ * + * string agent_uri = 2; + * + * @param value The agentUri to set. + * @return This builder for chaining. + */ + public Builder setAgentUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + agentCase_ = 2; + agent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
+     * to restore agent from. The format of this URI must be
+     * `gs://<bucket-name>/<object-name>`.
+     * 
+ * + * string agent_uri = 2; + * + * @return This builder for chaining. + */ + public Builder clearAgentUri() { + if (agentCase_ == 2) { + agentCase_ = 0; + agent_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
+     * to restore agent from. The format of this URI must be
+     * `gs://<bucket-name>/<object-name>`.
+     * 
+ * + * string agent_uri = 2; + * + * @param value The bytes for agentUri to set. + * @return This builder for chaining. + */ + public Builder setAgentUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + agentCase_ = 2; + agent_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Uncompressed raw byte content for agent.
+     * 
+ * + * bytes agent_content = 3; + * + * @return The agentContent. + */ + public com.google.protobuf.ByteString getAgentContent() { + if (agentCase_ == 3) { + return (com.google.protobuf.ByteString) agent_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+     * Uncompressed raw byte content for agent.
+     * 
+ * + * bytes agent_content = 3; + * + * @param value The agentContent to set. + * @return This builder for chaining. + */ + public Builder setAgentContent(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + agentCase_ = 3; + agent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Uncompressed raw byte content for agent.
+     * 
+ * + * bytes agent_content = 3; + * + * @return This builder for chaining. + */ + public Builder clearAgentContent() { + if (agentCase_ == 3) { + agentCase_ = 0; + agent_ = null; + onChanged(); + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestoreAgentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RestoreAgentRequest(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.dialogflow.cx.v3beta1.RestoreAgentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/RestoreAgentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/RestoreAgentRequestOrBuilder.java new file mode 100644 index 000000000..8ed3e2c97 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/RestoreAgentRequestOrBuilder.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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface RestoreAgentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the agent to restore into.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the agent to restore into.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
+   * to restore agent from. The format of this URI must be
+   * `gs://<bucket-name>/<object-name>`.
+   * 
+ * + * string agent_uri = 2; + * + * @return The agentUri. + */ + java.lang.String getAgentUri(); + /** + * + * + *
+   * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
+   * to restore agent from. The format of this URI must be
+   * `gs://<bucket-name>/<object-name>`.
+   * 
+ * + * string agent_uri = 2; + * + * @return The bytes for agentUri. + */ + com.google.protobuf.ByteString getAgentUriBytes(); + + /** + * + * + *
+   * Uncompressed raw byte content for agent.
+   * 
+ * + * bytes agent_content = 3; + * + * @return The agentContent. + */ + com.google.protobuf.ByteString getAgentContent(); + + public com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest.AgentCase getAgentCase(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityType.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityType.java new file mode 100644 index 000000000..f6490a028 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityType.java @@ -0,0 +1,1621 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Session entity types are referred to as **User** entity types and are
+ * entities that are built for an individual user such as favorites,
+ * preferences, playlists, and so on.
+ * You can redefine a session entity type at the session level to extend or
+ * replace a [custom entity type][google.cloud.dialogflow.cx.v3beta1.EntityType] at the user session level (we
+ * refer to the entity types defined at the agent level as "custom entity
+ * types").
+ * Note: session entity types apply to all queries, regardless of the language.
+ * For more information about entity types, see the [Dialogflow
+ * documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.SessionEntityType} + */ +public final class SessionEntityType extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.SessionEntityType) + SessionEntityTypeOrBuilder { + private static final long serialVersionUID = 0L; + // Use SessionEntityType.newBuilder() to construct. + private SessionEntityType(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SessionEntityType() { + name_ = ""; + entityOverrideMode_ = 0; + entities_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SessionEntityType(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SessionEntityType( + 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 24: + { + int rawValue = input.readEnum(); + + entityOverrideMode_ = rawValue; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + entities_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity>(); + mutable_bitField0_ |= 0x00000001; + } + entities_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.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)) { + entities_ = java.util.Collections.unmodifiableList(entities_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SessionEntityType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SessionEntityType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.class, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder.class); + } + + /** + * + * + *
+   * The types of modifications for the session entity type.
+   * 
+ * + * Protobuf enum {@code google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode} + */ + public enum EntityOverrideMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. This value should be never used.
+     * 
+ * + * ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0; + */ + ENTITY_OVERRIDE_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * The collection of session entities overrides the collection of entities
+     * in the corresponding custom entity type.
+     * 
+ * + * ENTITY_OVERRIDE_MODE_OVERRIDE = 1; + */ + ENTITY_OVERRIDE_MODE_OVERRIDE(1), + /** + * + * + *
+     * The collection of session entities extends the collection of entities in
+     * the corresponding custom entity type.
+     * Note: Even in this override mode calls to `ListSessionEntityTypes`,
+     * `GetSessionEntityType`, `CreateSessionEntityType` and
+     * `UpdateSessionEntityType` only return the additional entities added in
+     * this session entity type. If you want to get the supplemented list,
+     * please call [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityType] on the custom entity type
+     * and merge.
+     * 
+ * + * ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2; + */ + ENTITY_OVERRIDE_MODE_SUPPLEMENT(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. This value should be never used.
+     * 
+ * + * ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0; + */ + public static final int ENTITY_OVERRIDE_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The collection of session entities overrides the collection of entities
+     * in the corresponding custom entity type.
+     * 
+ * + * ENTITY_OVERRIDE_MODE_OVERRIDE = 1; + */ + public static final int ENTITY_OVERRIDE_MODE_OVERRIDE_VALUE = 1; + /** + * + * + *
+     * The collection of session entities extends the collection of entities in
+     * the corresponding custom entity type.
+     * Note: Even in this override mode calls to `ListSessionEntityTypes`,
+     * `GetSessionEntityType`, `CreateSessionEntityType` and
+     * `UpdateSessionEntityType` only return the additional entities added in
+     * this session entity type. If you want to get the supplemented list,
+     * please call [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityType] on the custom entity type
+     * and merge.
+     * 
+ * + * ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2; + */ + public static final int ENTITY_OVERRIDE_MODE_SUPPLEMENT_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EntityOverrideMode 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 EntityOverrideMode forNumber(int value) { + switch (value) { + case 0: + return ENTITY_OVERRIDE_MODE_UNSPECIFIED; + case 1: + return ENTITY_OVERRIDE_MODE_OVERRIDE; + case 2: + return ENTITY_OVERRIDE_MODE_SUPPLEMENT; + 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 EntityOverrideMode findValueByNumber(int number) { + return EntityOverrideMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final EntityOverrideMode[] VALUES = values(); + + public static EntityOverrideMode 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 EntityOverrideMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The unique identifier of the session entity type.
+   * Format: `projects/<Project ID>/locations/<Location
+   * ID>/agents/<Agent ID>/sessions/<Session ID>/entityTypes/<Entity Type
+   * ID>`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The unique identifier of the session entity type.
+   * Format: `projects/<Project ID>/locations/<Location
+   * ID>/agents/<Agent ID>/sessions/<Session ID>/entityTypes/<Entity Type
+   * ID>`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTITY_OVERRIDE_MODE_FIELD_NUMBER = 3; + private int entityOverrideMode_; + /** + * + * + *
+   * Required. Indicates whether the additional data should override or supplement the
+   * custom entity type definition.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode entity_override_mode = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for entityOverrideMode. + */ + @java.lang.Override + public int getEntityOverrideModeValue() { + return entityOverrideMode_; + } + /** + * + * + *
+   * Required. Indicates whether the additional data should override or supplement the
+   * custom entity type definition.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode entity_override_mode = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The entityOverrideMode. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode + getEntityOverrideMode() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode result = + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode.valueOf( + entityOverrideMode_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode.UNRECOGNIZED + : result; + } + + public static final int ENTITIES_FIELD_NUMBER = 4; + private java.util.List entities_; + /** + * + * + *
+   * Required. The collection of entities to override or supplement the custom entity
+   * type.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getEntitiesList() { + return entities_; + } + /** + * + * + *
+   * Required. The collection of entities to override or supplement the custom entity
+   * type.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getEntitiesOrBuilderList() { + return entities_; + } + /** + * + * + *
+   * Required. The collection of entities to override or supplement the custom entity
+   * type.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getEntitiesCount() { + return entities_.size(); + } + /** + * + * + *
+   * Required. The collection of entities to override or supplement the custom entity
+   * type.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity getEntities(int index) { + return entities_.get(index); + } + /** + * + * + *
+   * Required. The collection of entities to override or supplement the custom entity
+   * type.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder getEntitiesOrBuilder( + int index) { + return entities_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (entityOverrideMode_ + != com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode + .ENTITY_OVERRIDE_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, entityOverrideMode_); + } + for (int i = 0; i < entities_.size(); i++) { + output.writeMessage(4, entities_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (entityOverrideMode_ + != com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode + .ENTITY_OVERRIDE_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, entityOverrideMode_); + } + for (int i = 0; i < entities_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, entities_.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.dialogflow.cx.v3beta1.SessionEntityType)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType other = + (com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType) obj; + + if (!getName().equals(other.getName())) return false; + if (entityOverrideMode_ != other.entityOverrideMode_) return false; + if (!getEntitiesList().equals(other.getEntitiesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ENTITY_OVERRIDE_MODE_FIELD_NUMBER; + hash = (53 * hash) + entityOverrideMode_; + if (getEntitiesCount() > 0) { + hash = (37 * hash) + ENTITIES_FIELD_NUMBER; + hash = (53 * hash) + getEntitiesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType 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.dialogflow.cx.v3beta1.SessionEntityType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType 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.dialogflow.cx.v3beta1.SessionEntityType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType 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.dialogflow.cx.v3beta1.SessionEntityType parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType 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.dialogflow.cx.v3beta1.SessionEntityType parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType 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.dialogflow.cx.v3beta1.SessionEntityType 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; + } + /** + * + * + *
+   * Session entity types are referred to as **User** entity types and are
+   * entities that are built for an individual user such as favorites,
+   * preferences, playlists, and so on.
+   * You can redefine a session entity type at the session level to extend or
+   * replace a [custom entity type][google.cloud.dialogflow.cx.v3beta1.EntityType] at the user session level (we
+   * refer to the entity types defined at the agent level as "custom entity
+   * types").
+   * Note: session entity types apply to all queries, regardless of the language.
+   * For more information about entity types, see the [Dialogflow
+   * documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.SessionEntityType} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.SessionEntityType) + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SessionEntityType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SessionEntityType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.class, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEntitiesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + entityOverrideMode_ = 0; + + if (entitiesBuilder_ == null) { + entities_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + entitiesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SessionEntityType_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType build() { + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType result = + new com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.entityOverrideMode_ = entityOverrideMode_; + if (entitiesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + entities_ = java.util.Collections.unmodifiableList(entities_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.entities_ = entities_; + } else { + result.entities_ = entitiesBuilder_.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.dialogflow.cx.v3beta1.SessionEntityType) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.entityOverrideMode_ != 0) { + setEntityOverrideModeValue(other.getEntityOverrideModeValue()); + } + if (entitiesBuilder_ == null) { + if (!other.entities_.isEmpty()) { + if (entities_.isEmpty()) { + entities_ = other.entities_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEntitiesIsMutable(); + entities_.addAll(other.entities_); + } + onChanged(); + } + } else { + if (!other.entities_.isEmpty()) { + if (entitiesBuilder_.isEmpty()) { + entitiesBuilder_.dispose(); + entitiesBuilder_ = null; + entities_ = other.entities_; + bitField0_ = (bitField0_ & ~0x00000001); + entitiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEntitiesFieldBuilder() + : null; + } else { + entitiesBuilder_.addAllMessages(other.entities_); + } + } + } + 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.dialogflow.cx.v3beta1.SessionEntityType parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The unique identifier of the session entity type.
+     * Format: `projects/<Project ID>/locations/<Location
+     * ID>/agents/<Agent ID>/sessions/<Session ID>/entityTypes/<Entity Type
+     * 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. The unique identifier of the session entity type.
+     * Format: `projects/<Project ID>/locations/<Location
+     * ID>/agents/<Agent ID>/sessions/<Session ID>/entityTypes/<Entity Type
+     * 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. The unique identifier of the session entity type.
+     * Format: `projects/<Project ID>/locations/<Location
+     * ID>/agents/<Agent ID>/sessions/<Session ID>/entityTypes/<Entity Type
+     * 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. The unique identifier of the session entity type.
+     * Format: `projects/<Project ID>/locations/<Location
+     * ID>/agents/<Agent ID>/sessions/<Session ID>/entityTypes/<Entity Type
+     * ID>`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The unique identifier of the session entity type.
+     * Format: `projects/<Project ID>/locations/<Location
+     * ID>/agents/<Agent ID>/sessions/<Session ID>/entityTypes/<Entity Type
+     * 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 int entityOverrideMode_ = 0; + /** + * + * + *
+     * Required. Indicates whether the additional data should override or supplement the
+     * custom entity type definition.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode entity_override_mode = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for entityOverrideMode. + */ + @java.lang.Override + public int getEntityOverrideModeValue() { + return entityOverrideMode_; + } + /** + * + * + *
+     * Required. Indicates whether the additional data should override or supplement the
+     * custom entity type definition.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode entity_override_mode = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for entityOverrideMode to set. + * @return This builder for chaining. + */ + public Builder setEntityOverrideModeValue(int value) { + + entityOverrideMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Indicates whether the additional data should override or supplement the
+     * custom entity type definition.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode entity_override_mode = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The entityOverrideMode. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode + getEntityOverrideMode() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode result = + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode.valueOf( + entityOverrideMode_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. Indicates whether the additional data should override or supplement the
+     * custom entity type definition.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode entity_override_mode = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The entityOverrideMode to set. + * @return This builder for chaining. + */ + public Builder setEntityOverrideMode( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode value) { + if (value == null) { + throw new NullPointerException(); + } + + entityOverrideMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Indicates whether the additional data should override or supplement the
+     * custom entity type definition.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode entity_override_mode = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearEntityOverrideMode() { + + entityOverrideMode_ = 0; + onChanged(); + return this; + } + + private java.util.List entities_ = + java.util.Collections.emptyList(); + + private void ensureEntitiesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + entities_ = + new java.util.ArrayList( + entities_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder> + entitiesBuilder_; + + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getEntitiesList() { + if (entitiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entities_); + } else { + return entitiesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getEntitiesCount() { + if (entitiesBuilder_ == null) { + return entities_.size(); + } else { + return entitiesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity getEntities(int index) { + if (entitiesBuilder_ == null) { + return entities_.get(index); + } else { + return entitiesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEntities( + int index, com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity value) { + if (entitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntitiesIsMutable(); + entities_.set(index, value); + onChanged(); + } else { + entitiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEntities( + int index, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder builderForValue) { + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + entities_.set(index, builderForValue.build()); + onChanged(); + } else { + entitiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addEntities(com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity value) { + if (entitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntitiesIsMutable(); + entities_.add(value); + onChanged(); + } else { + entitiesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addEntities( + int index, com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity value) { + if (entitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntitiesIsMutable(); + entities_.add(index, value); + onChanged(); + } else { + entitiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addEntities( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder builderForValue) { + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + entities_.add(builderForValue.build()); + onChanged(); + } else { + entitiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addEntities( + int index, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder builderForValue) { + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + entities_.add(index, builderForValue.build()); + onChanged(); + } else { + entitiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllEntities( + java.lang.Iterable + values) { + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entities_); + onChanged(); + } else { + entitiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearEntities() { + if (entitiesBuilder_ == null) { + entities_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + entitiesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeEntities(int index) { + if (entitiesBuilder_ == null) { + ensureEntitiesIsMutable(); + entities_.remove(index); + onChanged(); + } else { + entitiesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder getEntitiesBuilder( + int index) { + return getEntitiesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder getEntitiesOrBuilder( + int index) { + if (entitiesBuilder_ == null) { + return entities_.get(index); + } else { + return entitiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder> + getEntitiesOrBuilderList() { + if (entitiesBuilder_ != null) { + return entitiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entities_); + } + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder addEntitiesBuilder() { + return getEntitiesFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.getDefaultInstance()); + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder addEntitiesBuilder( + int index) { + return getEntitiesFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.getDefaultInstance()); + } + /** + * + * + *
+     * Required. The collection of entities to override or supplement the custom entity
+     * type.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getEntitiesBuilderList() { + return getEntitiesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder> + getEntitiesFieldBuilder() { + if (entitiesBuilder_ == null) { + entitiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder>( + entities_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + entities_ = null; + } + return entitiesBuilder_; + } + + @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.dialogflow.cx.v3beta1.SessionEntityType) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.SessionEntityType) + private static final com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionEntityType parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SessionEntityType(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.dialogflow.cx.v3beta1.SessionEntityType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeName.java new file mode 100644 index 000000000..85ff5e53e --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeName.java @@ -0,0 +1,488 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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; +import java.util.Objects; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class SessionEntityTypeName implements ResourceName { + + @Deprecated + protected SessionEntityTypeName() {} + + private static final PathTemplate PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}"); + private static final PathTemplate + PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}"); + + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + + private String project; + private String location; + private String agent; + private String session; + private String entityType; + private String environment; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getSession() { + return session; + } + + public String getEntityType() { + return entityType; + } + + public String getEnvironment() { + return environment; + } + + private SessionEntityTypeName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + session = Preconditions.checkNotNull(builder.getSession()); + entityType = Preconditions.checkNotNull(builder.getEntityType()); + pathTemplate = PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE; + } + + private SessionEntityTypeName(ProjectLocationAgentEnvironmentSessionEntityTypeBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + environment = Preconditions.checkNotNull(builder.getEnvironment()); + session = Preconditions.checkNotNull(builder.getSession()); + entityType = Preconditions.checkNotNull(builder.getEntityType()); + pathTemplate = PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationAgentSessionEntityTypeBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationAgentEnvironmentSessionEntityTypeBuilder + newProjectLocationAgentEnvironmentSessionEntityTypeBuilder() { + return new ProjectLocationAgentEnvironmentSessionEntityTypeBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SessionEntityTypeName of( + String project, String location, String agent, String session, String entityType) { + return newProjectLocationAgentSessionEntityTypeBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setSession(session) + .setEntityType(entityType) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static SessionEntityTypeName ofProjectLocationAgentSessionEntityTypeName( + String project, String location, String agent, String session, String entityType) { + return newProjectLocationAgentSessionEntityTypeBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setSession(session) + .setEntityType(entityType) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static SessionEntityTypeName ofProjectLocationAgentEnvironmentSessionEntityTypeName( + String project, + String location, + String agent, + String environment, + String session, + String entityType) { + return newProjectLocationAgentEnvironmentSessionEntityTypeBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setEnvironment(environment) + .setSession(session) + .setEntityType(entityType) + .build(); + } + + public static String format( + String project, String location, String agent, String session, String entityType) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setSession(session) + .setEntityType(entityType) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationAgentSessionEntityTypeName( + String project, String location, String agent, String session, String entityType) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setSession(session) + .setEntityType(entityType) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationAgentEnvironmentSessionEntityTypeName( + String project, + String location, + String agent, + String environment, + String session, + String entityType) { + return newProjectLocationAgentEnvironmentSessionEntityTypeBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setEnvironment(environment) + .setSession(session) + .setEntityType(entityType) + .build() + .toString(); + } + + public static SessionEntityTypeName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.match(formattedString); + return ofProjectLocationAgentSessionEntityTypeName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("agent"), + matchMap.get("session"), + matchMap.get("entity_type")); + } else if (PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.matches( + formattedString)) { + Map matchMap = + PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.match( + formattedString); + return ofProjectLocationAgentEnvironmentSessionEntityTypeName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("agent"), + matchMap.get("environment"), + matchMap.get("session"), + matchMap.get("entity_type")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); + } + + 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 (SessionEntityTypeName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.matches(formattedString) + || PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.matches( + formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (agent != null) { + fieldMapBuilder.put("agent", agent); + } + if (session != null) { + fieldMapBuilder.put("session", session); + } + if (entityType != null) { + fieldMapBuilder.put("entity_type", entityType); + } + if (environment != null) { + fieldMapBuilder.put("environment", environment); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + /** + * Builder for + * projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}. + */ + public static class Builder { + + private String project; + private String location; + private String agent; + private String session; + private String entityType; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getSession() { + return session; + } + + public String getEntityType() { + return entityType; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAgent(String agent) { + this.agent = agent; + return this; + } + + public Builder setSession(String session) { + this.session = session; + return this; + } + + public Builder setEntityType(String entityType) { + this.entityType = entityType; + return this; + } + + private Builder(SessionEntityTypeName sessionEntityTypeName) { + Preconditions.checkArgument( + sessionEntityTypeName.pathTemplate + == PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE, + "toBuilder is only supported when SessionEntityTypeName has the pattern of " + + "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}."); + project = sessionEntityTypeName.project; + location = sessionEntityTypeName.location; + agent = sessionEntityTypeName.agent; + session = sessionEntityTypeName.session; + entityType = sessionEntityTypeName.entityType; + } + + public SessionEntityTypeName build() { + return new SessionEntityTypeName(this); + } + } + + /** + * Builder for + * projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationAgentEnvironmentSessionEntityTypeBuilder { + + private String project; + private String location; + private String agent; + private String environment; + private String session; + private String entityType; + + private ProjectLocationAgentEnvironmentSessionEntityTypeBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getEnvironment() { + return environment; + } + + public String getSession() { + return session; + } + + public String getEntityType() { + return entityType; + } + + public ProjectLocationAgentEnvironmentSessionEntityTypeBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationAgentEnvironmentSessionEntityTypeBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationAgentEnvironmentSessionEntityTypeBuilder setAgent(String agent) { + this.agent = agent; + return this; + } + + public ProjectLocationAgentEnvironmentSessionEntityTypeBuilder setEnvironment( + String environment) { + this.environment = environment; + return this; + } + + public ProjectLocationAgentEnvironmentSessionEntityTypeBuilder setSession(String session) { + this.session = session; + return this; + } + + public ProjectLocationAgentEnvironmentSessionEntityTypeBuilder setEntityType( + String entityType) { + this.entityType = entityType; + return this; + } + + public SessionEntityTypeName build() { + return new SessionEntityTypeName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SessionEntityTypeName that = (SessionEntityTypeName) o; + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.location, that.location)) + && (Objects.equals(this.agent, that.agent)) + && (Objects.equals(this.session, that.session)) + && (Objects.equals(this.entityType, that.entityType)) + && (Objects.equals(this.environment, that.environment)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(session); + h *= 1000003; + h ^= Objects.hashCode(entityType); + h *= 1000003; + h ^= Objects.hashCode(environment); + return h; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeOrBuilder.java new file mode 100644 index 000000000..d46398e56 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface SessionEntityTypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.SessionEntityType) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique identifier of the session entity type.
+   * Format: `projects/<Project ID>/locations/<Location
+   * ID>/agents/<Agent ID>/sessions/<Session ID>/entityTypes/<Entity Type
+   * ID>`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The unique identifier of the session entity type.
+   * Format: `projects/<Project ID>/locations/<Location
+   * ID>/agents/<Agent ID>/sessions/<Session ID>/entityTypes/<Entity Type
+   * ID>`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Indicates whether the additional data should override or supplement the
+   * custom entity type definition.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode entity_override_mode = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for entityOverrideMode. + */ + int getEntityOverrideModeValue(); + /** + * + * + *
+   * Required. Indicates whether the additional data should override or supplement the
+   * custom entity type definition.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode entity_override_mode = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The entityOverrideMode. + */ + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.EntityOverrideMode + getEntityOverrideMode(); + + /** + * + * + *
+   * Required. The collection of entities to override or supplement the custom entity
+   * type.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getEntitiesList(); + /** + * + * + *
+   * Required. The collection of entities to override or supplement the custom entity
+   * type.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Entity getEntities(int index); + /** + * + * + *
+   * Required. The collection of entities to override or supplement the custom entity
+   * type.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getEntitiesCount(); + /** + * + * + *
+   * Required. The collection of entities to override or supplement the custom entity
+   * type.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getEntitiesOrBuilderList(); + /** + * + * + *
+   * Required. The collection of entities to override or supplement the custom entity
+   * type.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.EntityType.Entity entities = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.EntityType.EntityOrBuilder getEntitiesOrBuilder(int index); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeProto.java new file mode 100644 index 000000000..4fddf3689 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeProto.java @@ -0,0 +1,244 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class SessionEntityTypeProto { + private SessionEntityTypeProto() {} + + 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_dialogflow_cx_v3beta1_SessionEntityType_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_SessionEntityType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListSessionEntityTypesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListSessionEntityTypesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListSessionEntityTypesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListSessionEntityTypesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_GetSessionEntityTypeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_GetSessionEntityTypeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateSessionEntityTypeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateSessionEntityTypeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateSessionEntityTypeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateSessionEntityTypeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteSessionEntityTypeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteSessionEntityTypeRequest_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 + * Represents session information communicated to and from the webhook. + * + * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.SessionInfo} + */ +public final class SessionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.SessionInfo) + SessionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use SessionInfo.newBuilder() to construct. + private SessionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SessionInfo() { + session_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SessionInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SessionInfo( + 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(); + + session_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + parameters_ = + com.google.protobuf.MapField.newMapField( + ParametersDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + parameters__ = + input.readMessage( + ParametersDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + parameters_.getMutableMap().put(parameters__.getKey(), parameters__.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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetParameters(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.class, + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder.class); + } + + public static final int SESSION_FIELD_NUMBER = 1; + private volatile java.lang.Object session_; + /** + * + * + *
+   * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * The unique identifier of the [session][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.session]. This
+   * field can be used by the webhook to identify a user.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @return The session. + */ + @java.lang.Override + public java.lang.String getSession() { + java.lang.Object ref = session_; + 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(); + session_ = s; + return s; + } + } + /** + * + * + *
+   * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * The unique identifier of the [session][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.session]. This
+   * field can be used by the webhook to identify a user.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for session. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSessionBytes() { + java.lang.Object ref = session_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + session_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARAMETERS_FIELD_NUMBER = 2; + + private static final class ParametersDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_ParametersEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField parameters_; + + private com.google.protobuf.MapField + internalGetParameters() { + if (parameters_ == null) { + return com.google.protobuf.MapField.emptyMapField(ParametersDefaultEntryHolder.defaultEntry); + } + return parameters_; + } + + public int getParametersCount() { + return internalGetParameters().getMap().size(); + } + /** + * + * + *
+   * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * All parameters collected from forms and intents during the session.
+   * Parameters can be created, updated, or removed by the webhook. To remove a
+   * parameter from the session, the webhook should explicitly set the parameter
+   * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+   * display names.
+   * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + @java.lang.Override + public boolean containsParameters(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetParameters().getMap().containsKey(key); + } + /** Use {@link #getParametersMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getParameters() { + return getParametersMap(); + } + /** + * + * + *
+   * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * All parameters collected from forms and intents during the session.
+   * Parameters can be created, updated, or removed by the webhook. To remove a
+   * parameter from the session, the webhook should explicitly set the parameter
+   * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+   * display names.
+   * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + @java.lang.Override + public java.util.Map getParametersMap() { + return internalGetParameters().getMap(); + } + /** + * + * + *
+   * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * All parameters collected from forms and intents during the session.
+   * Parameters can be created, updated, or removed by the webhook. To remove a
+   * parameter from the session, the webhook should explicitly set the parameter
+   * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+   * display names.
+   * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + @java.lang.Override + public com.google.protobuf.Value getParametersOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetParameters().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * All parameters collected from forms and intents during the session.
+   * Parameters can be created, updated, or removed by the webhook. To remove a
+   * parameter from the session, the webhook should explicitly set the parameter
+   * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+   * display names.
+   * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + @java.lang.Override + public com.google.protobuf.Value getParametersOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetParameters().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 (!getSessionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, session_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetParameters(), ParametersDefaultEntryHolder.defaultEntry, 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSessionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, session_); + } + for (java.util.Map.Entry entry : + internalGetParameters().getMap().entrySet()) { + com.google.protobuf.MapEntry parameters__ = + ParametersDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, parameters__); + } + 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.dialogflow.cx.v3beta1.SessionInfo)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo other = + (com.google.cloud.dialogflow.cx.v3beta1.SessionInfo) obj; + + if (!getSession().equals(other.getSession())) return false; + if (!internalGetParameters().equals(other.internalGetParameters())) 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) + SESSION_FIELD_NUMBER; + hash = (53 * hash) + getSession().hashCode(); + if (!internalGetParameters().getMap().isEmpty()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + internalGetParameters().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionInfo 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.dialogflow.cx.v3beta1.SessionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionInfo 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.dialogflow.cx.v3beta1.SessionInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionInfo 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.dialogflow.cx.v3beta1.SessionInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionInfo 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.dialogflow.cx.v3beta1.SessionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionInfo 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.dialogflow.cx.v3beta1.SessionInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents session information communicated to and from the webhook.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.SessionInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.SessionInfo) + com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetParameters(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableParameters(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.class, + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.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(); + session_ = ""; + + internalGetMutableParameters().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionInfo getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionInfo build() { + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionInfo buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo result = + new com.google.cloud.dialogflow.cx.v3beta1.SessionInfo(this); + int from_bitField0_ = bitField0_; + result.session_ = session_; + result.parameters_ = internalGetParameters(); + result.parameters_.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.dialogflow.cx.v3beta1.SessionInfo) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.SessionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.SessionInfo other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.getDefaultInstance()) + return this; + if (!other.getSession().isEmpty()) { + session_ = other.session_; + onChanged(); + } + internalGetMutableParameters().mergeFrom(other.internalGetParameters()); + 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.dialogflow.cx.v3beta1.SessionInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.SessionInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object session_ = ""; + /** + * + * + *
+     * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The unique identifier of the [session][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.session]. This
+     * field can be used by the webhook to identify a user.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @return The session. + */ + public java.lang.String getSession() { + java.lang.Object ref = session_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + session_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The unique identifier of the [session][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.session]. This
+     * field can be used by the webhook to identify a user.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for session. + */ + public com.google.protobuf.ByteString getSessionBytes() { + java.lang.Object ref = session_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + session_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The unique identifier of the [session][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.session]. This
+     * field can be used by the webhook to identify a user.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The session to set. + * @return This builder for chaining. + */ + public Builder setSession(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + session_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The unique identifier of the [session][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.session]. This
+     * field can be used by the webhook to identify a user.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearSession() { + + session_ = getDefaultInstance().getSession(); + onChanged(); + return this; + } + /** + * + * + *
+     * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * The unique identifier of the [session][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.session]. This
+     * field can be used by the webhook to identify a user.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for session to set. + * @return This builder for chaining. + */ + public Builder setSessionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + session_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField parameters_; + + private com.google.protobuf.MapField + internalGetParameters() { + if (parameters_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ParametersDefaultEntryHolder.defaultEntry); + } + return parameters_; + } + + private com.google.protobuf.MapField + internalGetMutableParameters() { + onChanged(); + ; + if (parameters_ == null) { + parameters_ = + com.google.protobuf.MapField.newMapField(ParametersDefaultEntryHolder.defaultEntry); + } + if (!parameters_.isMutable()) { + parameters_ = parameters_.copy(); + } + return parameters_; + } + + public int getParametersCount() { + return internalGetParameters().getMap().size(); + } + /** + * + * + *
+     * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * All parameters collected from forms and intents during the session.
+     * Parameters can be created, updated, or removed by the webhook. To remove a
+     * parameter from the session, the webhook should explicitly set the parameter
+     * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+     * display names.
+     * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + @java.lang.Override + public boolean containsParameters(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetParameters().getMap().containsKey(key); + } + /** Use {@link #getParametersMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getParameters() { + return getParametersMap(); + } + /** + * + * + *
+     * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * All parameters collected from forms and intents during the session.
+     * Parameters can be created, updated, or removed by the webhook. To remove a
+     * parameter from the session, the webhook should explicitly set the parameter
+     * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+     * display names.
+     * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + @java.lang.Override + public java.util.Map getParametersMap() { + return internalGetParameters().getMap(); + } + /** + * + * + *
+     * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * All parameters collected from forms and intents during the session.
+     * Parameters can be created, updated, or removed by the webhook. To remove a
+     * parameter from the session, the webhook should explicitly set the parameter
+     * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+     * display names.
+     * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + @java.lang.Override + public com.google.protobuf.Value getParametersOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetParameters().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * All parameters collected from forms and intents during the session.
+     * Parameters can be created, updated, or removed by the webhook. To remove a
+     * parameter from the session, the webhook should explicitly set the parameter
+     * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+     * display names.
+     * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + @java.lang.Override + public com.google.protobuf.Value getParametersOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetParameters().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearParameters() { + internalGetMutableParameters().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * All parameters collected from forms and intents during the session.
+     * Parameters can be created, updated, or removed by the webhook. To remove a
+     * parameter from the session, the webhook should explicitly set the parameter
+     * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+     * display names.
+     * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + public Builder removeParameters(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableParameters().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableParameters() { + return internalGetMutableParameters().getMutableMap(); + } + /** + * + * + *
+     * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * All parameters collected from forms and intents during the session.
+     * Parameters can be created, updated, or removed by the webhook. To remove a
+     * parameter from the session, the webhook should explicitly set the parameter
+     * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+     * display names.
+     * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + public Builder putParameters(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(); + } + internalGetMutableParameters().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+     * All parameters collected from forms and intents during the session.
+     * Parameters can be created, updated, or removed by the webhook. To remove a
+     * parameter from the session, the webhook should explicitly set the parameter
+     * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+     * display names.
+     * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + public Builder putAllParameters( + java.util.Map values) { + internalGetMutableParameters().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.dialogflow.cx.v3beta1.SessionInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.SessionInfo) + private static final com.google.cloud.dialogflow.cx.v3beta1.SessionInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.SessionInfo(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SessionInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SessionInfo(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.dialogflow.cx.v3beta1.SessionInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionInfoOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionInfoOrBuilder.java new file mode 100644 index 000000000..834c00b0a --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionInfoOrBuilder.java @@ -0,0 +1,138 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface SessionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.SessionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * The unique identifier of the [session][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.session]. This
+   * field can be used by the webhook to identify a user.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @return The session. + */ + java.lang.String getSession(); + /** + * + * + *
+   * Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * The unique identifier of the [session][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.session]. This
+   * field can be used by the webhook to identify a user.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for session. + */ + com.google.protobuf.ByteString getSessionBytes(); + + /** + * + * + *
+   * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * All parameters collected from forms and intents during the session.
+   * Parameters can be created, updated, or removed by the webhook. To remove a
+   * parameter from the session, the webhook should explicitly set the parameter
+   * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+   * display names.
+   * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + int getParametersCount(); + /** + * + * + *
+   * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * All parameters collected from forms and intents during the session.
+   * Parameters can be created, updated, or removed by the webhook. To remove a
+   * parameter from the session, the webhook should explicitly set the parameter
+   * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+   * display names.
+   * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + boolean containsParameters(java.lang.String key); + /** Use {@link #getParametersMap()} instead. */ + @java.lang.Deprecated + java.util.Map getParameters(); + /** + * + * + *
+   * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * All parameters collected from forms and intents during the session.
+   * Parameters can be created, updated, or removed by the webhook. To remove a
+   * parameter from the session, the webhook should explicitly set the parameter
+   * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+   * display names.
+   * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + java.util.Map getParametersMap(); + /** + * + * + *
+   * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * All parameters collected from forms and intents during the session.
+   * Parameters can be created, updated, or removed by the webhook. To remove a
+   * parameter from the session, the webhook should explicitly set the parameter
+   * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+   * display names.
+   * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + com.google.protobuf.Value getParametersOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue); + /** + * + * + *
+   * Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse].
+   * All parameters collected from forms and intents during the session.
+   * Parameters can be created, updated, or removed by the webhook. To remove a
+   * parameter from the session, the webhook should explicitly set the parameter
+   * value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters'
+   * display names.
+   * 
+ * + * map<string, .google.protobuf.Value> parameters = 2; + */ + com.google.protobuf.Value getParametersOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionName.java new file mode 100644 index 000000000..f97656188 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionName.java @@ -0,0 +1,424 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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; +import java.util.Objects; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class SessionName implements ResourceName { + + @Deprecated + protected SessionName() {} + + private static final PathTemplate PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}"); + private static final PathTemplate PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}"); + + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + + private String project; + private String location; + private String agent; + private String session; + private String environment; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getSession() { + return session; + } + + public String getEnvironment() { + return environment; + } + + private SessionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + session = Preconditions.checkNotNull(builder.getSession()); + pathTemplate = PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE; + } + + private SessionName(ProjectLocationAgentEnvironmentSessionBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + environment = Preconditions.checkNotNull(builder.getEnvironment()); + session = Preconditions.checkNotNull(builder.getSession()); + pathTemplate = PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationAgentSessionBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationAgentEnvironmentSessionBuilder + newProjectLocationAgentEnvironmentSessionBuilder() { + return new ProjectLocationAgentEnvironmentSessionBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SessionName of(String project, String location, String agent, String session) { + return newProjectLocationAgentSessionBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setSession(session) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static SessionName ofProjectLocationAgentSessionName( + String project, String location, String agent, String session) { + return newProjectLocationAgentSessionBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setSession(session) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static SessionName ofProjectLocationAgentEnvironmentSessionName( + String project, String location, String agent, String environment, String session) { + return newProjectLocationAgentEnvironmentSessionBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setEnvironment(environment) + .setSession(session) + .build(); + } + + public static String format(String project, String location, String agent, String session) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setSession(session) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationAgentSessionName( + String project, String location, String agent, String session) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setSession(session) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationAgentEnvironmentSessionName( + String project, String location, String agent, String environment, String session) { + return newProjectLocationAgentEnvironmentSessionBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setEnvironment(environment) + .setSession(session) + .build() + .toString(); + } + + public static SessionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE.match(formattedString); + return ofProjectLocationAgentSessionName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("agent"), + matchMap.get("session")); + } else if (PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE.match(formattedString); + return ofProjectLocationAgentEnvironmentSessionName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("agent"), + matchMap.get("environment"), + matchMap.get("session")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); + } + + 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 (SessionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE.matches(formattedString) + || PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (agent != null) { + fieldMapBuilder.put("agent", agent); + } + if (session != null) { + fieldMapBuilder.put("session", session); + } + if (environment != null) { + fieldMapBuilder.put("environment", environment); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + /** Builder for projects/{project}/locations/{location}/agents/{agent}/sessions/{session}. */ + public static class Builder { + + private String project; + private String location; + private String agent; + private String session; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getSession() { + return session; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAgent(String agent) { + this.agent = agent; + return this; + } + + public Builder setSession(String session) { + this.session = session; + return this; + } + + private Builder(SessionName sessionName) { + Preconditions.checkArgument( + sessionName.pathTemplate == PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE, + "toBuilder is only supported when SessionName has the pattern of " + + "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}."); + project = sessionName.project; + location = sessionName.location; + agent = sessionName.agent; + session = sessionName.session; + } + + public SessionName build() { + return new SessionName(this); + } + } + + /** + * Builder for + * projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationAgentEnvironmentSessionBuilder { + + private String project; + private String location; + private String agent; + private String environment; + private String session; + + private ProjectLocationAgentEnvironmentSessionBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getEnvironment() { + return environment; + } + + public String getSession() { + return session; + } + + public ProjectLocationAgentEnvironmentSessionBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationAgentEnvironmentSessionBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationAgentEnvironmentSessionBuilder setAgent(String agent) { + this.agent = agent; + return this; + } + + public ProjectLocationAgentEnvironmentSessionBuilder setEnvironment(String environment) { + this.environment = environment; + return this; + } + + public ProjectLocationAgentEnvironmentSessionBuilder setSession(String session) { + this.session = session; + return this; + } + + public SessionName build() { + return new SessionName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SessionName that = (SessionName) o; + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.location, that.location)) + && (Objects.equals(this.agent, that.agent)) + && (Objects.equals(this.session, that.session)) + && (Objects.equals(this.environment, that.environment)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(session); + h *= 1000003; + h ^= Objects.hashCode(environment); + return h; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.java new file mode 100644 index 000000000..d3de77595 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class SessionProto { + private SessionProto() {} + + 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_dialogflow_cx_v3beta1_DetectIntentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingRecognitionResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingRecognitionResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryInput_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryInput_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_TextInput_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_TextInput_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_IntentInput_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_IntentInput_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_AudioInput_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_AudioInput_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Match_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Match_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/dialogflow/cx/v3beta1/ses" + + "sion.proto\022\"google.cloud.dialogflow.cx.v" + + "3beta1\032\034google/api/annotations.proto\032\037go" + + "ogle/api/field_behavior.proto\032\031google/ap" + + "i/resource.proto\0325google/cloud/dialogflo" + + "w/cx/v3beta1/audio_config.proto\032/google/" + + "cloud/dialogflow/cx/v3beta1/intent.proto" + + "\032-google/cloud/dialogflow/cx/v3beta1/pag" + + "e.proto\0329google/cloud/dialogflow/cx/v3be" + + "ta1/response_message.proto\032.google" + + ".cloud.dialogflow.cx.v3beta1.StreamingRe" + + "cognitionResultH\000\022Z\n\026detect_intent_respo" + + "nse\030\002 \001(\01328.google.cloud.dialogflow.cx.v" + + "3beta1.DetectIntentResponseH\000B\n\n\010respons" + + "e\"\251\003\n\032StreamingRecognitionResult\022`\n\014mess" + + "age_type\030\001 \001(\0162J.google.cloud.dialogflow" + + ".cx.v3beta1.StreamingRecognitionResult.M" + + "essageType\022\022\n\ntranscript\030\002 \001(\t\022\020\n\010is_fin" + + "al\030\003 \001(\010\022\022\n\nconfidence\030\004 \001(\002\022\021\n\tstabilit" + + "y\030\006 \001(\002\022L\n\020speech_word_info\030\007 \003(\01322.goog" + + "le.cloud.dialogflow.cx.v3beta1.SpeechWor" + + "dInfo\0224\n\021speech_end_offset\030\010 \001(\0132\031.googl" + + "e.protobuf.Duration\"X\n\013MessageType\022\034\n\030ME" + + "SSAGE_TYPE_UNSPECIFIED\020\000\022\016\n\nTRANSCRIPT\020\001" + + "\022\033\n\027END_OF_SINGLE_UTTERANCE\020\002\"\373\001\n\017QueryP" + + "arameters\022\021\n\ttime_zone\030\001 \001(\t\022)\n\014geo_loca" + + "tion\030\002 \001(\0132\023.google.type.LatLng\022S\n\024sessi" + + "on_entity_types\030\003 \003(\01325.google.cloud.dia" + + "logflow.cx.v3beta1.SessionEntityType\022(\n\007" + + "payload\030\004 \001(\0132\027.google.protobuf.Struct\022+" + + "\n\nparameters\030\005 \001(\0132\027.google.protobuf.Str" + + "uct\"\364\001\n\nQueryInput\022=\n\004text\030\002 \001(\0132-.googl" + + "e.cloud.dialogflow.cx.v3beta1.TextInputH" + + "\000\022A\n\006intent\030\003 \001(\0132/.google.cloud.dialogf" + + "low.cx.v3beta1.IntentInputH\000\022?\n\005audio\030\005 " + + "\001(\0132..google.cloud.dialogflow.cx.v3beta1" + + ".AudioInputH\000\022\032\n\rlanguage_code\030\004 \001(\tB\003\340A" + + "\002B\007\n\005input\"\371\004\n\013QueryResult\022\016\n\004text\030\001 \001(\t" + + "H\000\022\030\n\016trigger_intent\030\013 \001(\tH\000\022\024\n\ntranscri" + + "pt\030\014 \001(\tH\000\022\027\n\rtrigger_event\030\016 \001(\tH\000\022\025\n\rl" + + "anguage_code\030\002 \001(\t\022+\n\nparameters\030\003 \001(\0132\027" + + ".google.protobuf.Struct\022N\n\021response_mess" + + "ages\030\004 \003(\01323.google.cloud.dialogflow.cx." + + "v3beta1.ResponseMessage\022,\n\020webhook_statu" + + "ses\030\r \003(\0132\022.google.rpc.Status\0221\n\020webhook" + + "_payloads\030\006 \003(\0132\027.google.protobuf.Struct" + + "\022>\n\014current_page\030\007 \001(\0132(.google.cloud.di" + + "alogflow.cx.v3beta1.Page\022>\n\006intent\030\010 \001(\013" + + "2*.google.cloud.dialogflow.cx.v3beta1.In" + + "tentB\002\030\001\022\'\n\033intent_detection_confidence\030" + + "\t \001(\002B\002\030\001\0228\n\005match\030\017 \001(\0132).google.cloud." + + "dialogflow.cx.v3beta1.Match\0220\n\017diagnosti" + + "c_info\030\n \001(\0132\027.google.protobuf.StructB\007\n" + + "\005query\"\036\n\tTextInput\022\021\n\004text\030\001 \001(\tB\003\340A\002\"G" + + "\n\013IntentInput\0228\n\006intent\030\001 \001(\tB(\340A\002\372A\"\n d" + + "ialogflow.googleapis.com/Intent\"f\n\nAudio" + + "Input\022I\n\006config\030\001 \001(\01324.google.cloud.dia" + + "logflow.cx.v3beta1.InputAudioConfigB\003\340A\002" + + "\022\r\n\005audio\030\002 \001(\014\"\340\002\n\005Match\022:\n\006intent\030\001 \001(" + + "\0132*.google.cloud.dialogflow.cx.v3beta1.I" + + "ntent\022+\n\nparameters\030\002 \001(\0132\027.google.proto" + + "buf.Struct\022\026\n\016resolved_input\030\003 \001(\t\022G\n\nma" + + "tch_type\030\004 \001(\01623.google.cloud.dialogflow" + + ".cx.v3beta1.Match.MatchType\022\022\n\nconfidenc" + + "e\030\005 \001(\002\"y\n\tMatchType\022\032\n\026MATCH_TYPE_UNSPE" + + "CIFIED\020\000\022\n\n\006INTENT\020\001\022\021\n\rDIRECT_INTENT\020\002\022" + + "\025\n\021PARAMETER_FILLING\020\003\022\014\n\010NO_MATCH\020\004\022\014\n\010" + + "NO_INPUT\020\005\"\345\001\n\022MatchIntentRequest\022:\n\007ses" + + "sion\030\001 \001(\tB)\340A\002\372A#\n!dialogflow.googleapi" + + "s.com/Session\022I\n\014query_params\030\002 \001(\01323.go" + + "ogle.cloud.dialogflow.cx.v3beta1.QueryPa" + + "rameters\022H\n\013query_input\030\003 \001(\0132..google.c" + + "loud.dialogflow.cx.v3beta1.QueryInputB\003\340" + + "A\002\"\332\001\n\023MatchIntentResponse\022\016\n\004text\030\001 \001(\t" + + "H\000\022\030\n\016trigger_intent\030\002 \001(\tH\000\022\024\n\ntranscri" + + "pt\030\003 \001(\tH\000\022:\n\007matches\030\004 \003(\0132).google.clo" + + "ud.dialogflow.cx.v3beta1.Match\022>\n\014curren" + + "t_page\030\005 \001(\0132(.google.cloud.dialogflow.c" + + "x.v3beta1.PageB\007\n\005query\"\372\001\n\024FulfillInten" + + "tRequest\022T\n\024match_intent_request\030\001 \001(\01326" + + ".google.cloud.dialogflow.cx.v3beta1.Matc" + + "hIntentRequest\0228\n\005match\030\002 \001(\0132).google.c" + + "loud.dialogflow.cx.v3beta1.Match\022R\n\023outp" + + "ut_audio_config\030\003 \001(\01325.google.cloud.dia" + + "logflow.cx.v3beta1.OutputAudioConfig\"\335\001\n" + + "\025FulfillIntentResponse\022\023\n\013response_id\030\001 " + + "\001(\t\022E\n\014query_result\030\002 \001(\0132/.google.cloud" + + ".dialogflow.cx.v3beta1.QueryResult\022\024\n\014ou" + + "tput_audio\030\003 \001(\014\022R\n\023output_audio_config\030" + + "\004 \001(\01325.google.cloud.dialogflow.cx.v3bet" + + "a1.OutputAudioConfig2\317\007\n\010Sessions\022\330\001\n\014De" + + "tectIntent\0227.google.cloud.dialogflow.cx." + + "v3beta1.DetectIntentRequest\0328.google.clo" + + "ud.dialogflow.cx.v3beta1.DetectIntentRes" + + "ponse\"U\202\323\344\223\002O\"J/v3beta1/{session=project" + + "s/*/locations/*/agents/*/sessions/*}:det" + + "ectIntent:\001*\022\242\001\n\025StreamingDetectIntent\022@" + + ".google.cloud.dialogflow.cx.v3beta1.Stre" + + "amingDetectIntentRequest\032A.google.cloud." + + "dialogflow.cx.v3beta1.StreamingDetectInt" + + "entResponse\"\000(\0010\001\022\324\001\n\013MatchIntent\0226.goog" + + "le.cloud.dialogflow.cx.v3beta1.MatchInte" + + "ntRequest\0327.google.cloud.dialogflow.cx.v" + + "3beta1.MatchIntentResponse\"T\202\323\344\223\002N\"I/v3b" + + "eta1/{session=projects/*/locations/*/age" + + "nts/*/sessions/*}:matchIntent:\001*\022\361\001\n\rFul" + + "fillIntent\0228.google.cloud.dialogflow.cx." + + "v3beta1.FulfillIntentRequest\0329.google.cl" + + "oud.dialogflow.cx.v3beta1.FulfillIntentR" + + "esponse\"k\202\323\344\223\002e\"`/v3beta1/{match_intent_" + + "request.session=projects/*/locations/*/a" + + "gents/*/sessions/*}:fulfillIntent:\001*\032x\312A" + + "\031dialogflow.googleapis.com\322AYhttps://www" + + ".googleapis.com/auth/cloud-platform,http" + + "s://www.googleapis.com/auth/dialogflowB\203" + + "\003\n&com.google.cloud.dialogflow.cx.v3beta" + + "1B\014SessionProtoP\001ZDgoogle.golang.org/gen" + + "proto/googleapis/cloud/dialogflow/cx/v3b" + + "eta1;cx\370\001\001\242\002\002DF\252\002\"Google.Cloud.Dialogflo" + + "w.Cx.V3Beta1\352A\324\001\n!dialogflow.googleapis." + + "com/Session\022Iprojects/{project}/location" + + "s/{location}/agents/{agent}/sessions/{se" + + "ssion}\022dprojects/{project}/locations/{lo" + + "cation}/agents/{agent}/environments/{env" + + "ironment}/sessions/{session}b\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.ResourceProto.getDescriptor(), + com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto.getDescriptor(), + com.google.cloud.dialogflow.cx.v3beta1.IntentProto.getDescriptor(), + com.google.cloud.dialogflow.cx.v3beta1.PageProto.getDescriptor(), + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto.getDescriptor(), + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + com.google.type.LatLngProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentRequest_descriptor, + new java.lang.String[] { + "Session", "QueryParams", "QueryInput", "OutputAudioConfig", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_DetectIntentResponse_descriptor, + new java.lang.String[] { + "ResponseId", "QueryResult", "OutputAudio", "OutputAudioConfig", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentRequest_descriptor, + new java.lang.String[] { + "Session", "QueryParams", "QueryInput", "OutputAudioConfig", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentResponse_descriptor, + new java.lang.String[] { + "RecognitionResult", "DetectIntentResponse", "Response", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingRecognitionResult_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingRecognitionResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingRecognitionResult_descriptor, + new java.lang.String[] { + "MessageType", + "Transcript", + "IsFinal", + "Confidence", + "Stability", + "SpeechWordInfo", + "SpeechEndOffset", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_descriptor, + new java.lang.String[] { + "TimeZone", "GeoLocation", "SessionEntityTypes", "Payload", "Parameters", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryInput_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryInput_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryInput_descriptor, + new java.lang.String[] { + "Text", "Intent", "Audio", "LanguageCode", "Input", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryResult_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryResult_descriptor, + new java.lang.String[] { + "Text", + "TriggerIntent", + "Transcript", + "TriggerEvent", + "LanguageCode", + "Parameters", + "ResponseMessages", + "WebhookStatuses", + "WebhookPayloads", + "CurrentPage", + "Intent", + "IntentDetectionConfidence", + "Match", + "DiagnosticInfo", + "Query", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_TextInput_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_dialogflow_cx_v3beta1_TextInput_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_TextInput_descriptor, + new java.lang.String[] { + "Text", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_IntentInput_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_dialogflow_cx_v3beta1_IntentInput_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_IntentInput_descriptor, + new java.lang.String[] { + "Intent", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_AudioInput_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_dialogflow_cx_v3beta1_AudioInput_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_AudioInput_descriptor, + new java.lang.String[] { + "Config", "Audio", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Match_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_dialogflow_cx_v3beta1_Match_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Match_descriptor, + new java.lang.String[] { + "Intent", "Parameters", "ResolvedInput", "MatchType", "Confidence", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentRequest_descriptor, + new java.lang.String[] { + "Session", "QueryParams", "QueryInput", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentResponse_descriptor, + new java.lang.String[] { + "Text", "TriggerIntent", "Transcript", "Matches", "CurrentPage", "Query", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentRequest_descriptor, + new java.lang.String[] { + "MatchIntentRequest", "Match", "OutputAudioConfig", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_FulfillIntentResponse_descriptor, + new java.lang.String[] { + "ResponseId", "QueryResult", "OutputAudio", "OutputAudioConfig", + }); + 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.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto.getDescriptor(); + com.google.cloud.dialogflow.cx.v3beta1.IntentProto.getDescriptor(); + com.google.cloud.dialogflow.cx.v3beta1.PageProto.getDescriptor(); + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto.getDescriptor(); + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + com.google.type.LatLngProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechModelVariant.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechModelVariant.java new file mode 100644 index 000000000..12ee4584a --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechModelVariant.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Variant of the specified [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use.
+ * See the [Cloud Speech
+ * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models)
+ * for which models have different variants. For example, the "phone_call" model
+ * has both a standard and an enhanced variant. When you use an enhanced model,
+ * you will generally receive higher quality results than for a standard model.
+ * 
+ * + * Protobuf enum {@code google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant} + */ +public enum SpeechModelVariant implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * No model variant specified. In this case Dialogflow defaults to
+   * USE_BEST_AVAILABLE.
+   * 
+ * + * SPEECH_MODEL_VARIANT_UNSPECIFIED = 0; + */ + SPEECH_MODEL_VARIANT_UNSPECIFIED(0), + /** + * + * + *
+   * Use the best available variant of the [Speech
+   * model][InputAudioConfig.model] that the caller is eligible for.
+   * Please see the [Dialogflow
+   * docs](https://cloud.google.com/dialogflow/docs/data-logging) for
+   * how to make your project eligible for enhanced models.
+   * 
+ * + * USE_BEST_AVAILABLE = 1; + */ + USE_BEST_AVAILABLE(1), + /** + * + * + *
+   * Use standard model variant even if an enhanced model is available.  See the
+   * [Cloud Speech
+   * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models)
+   * for details about enhanced models.
+   * 
+ * + * USE_STANDARD = 2; + */ + USE_STANDARD(2), + /** + * + * + *
+   * Use an enhanced model variant:
+   * * If an enhanced variant does not exist for the given
+   *   [model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] and request language, Dialogflow falls
+   *   back to the standard variant.
+   *   The [Cloud Speech
+   *   documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models)
+   *   describes which models have enhanced variants.
+   * * If the API caller isn't eligible for enhanced models, Dialogflow returns
+   *   an error.  Please see the [Dialogflow
+   *   docs](https://cloud.google.com/dialogflow/docs/data-logging)
+   *   for how to make your project eligible.
+   * 
+ * + * USE_ENHANCED = 3; + */ + USE_ENHANCED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * No model variant specified. In this case Dialogflow defaults to
+   * USE_BEST_AVAILABLE.
+   * 
+ * + * SPEECH_MODEL_VARIANT_UNSPECIFIED = 0; + */ + public static final int SPEECH_MODEL_VARIANT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Use the best available variant of the [Speech
+   * model][InputAudioConfig.model] that the caller is eligible for.
+   * Please see the [Dialogflow
+   * docs](https://cloud.google.com/dialogflow/docs/data-logging) for
+   * how to make your project eligible for enhanced models.
+   * 
+ * + * USE_BEST_AVAILABLE = 1; + */ + public static final int USE_BEST_AVAILABLE_VALUE = 1; + /** + * + * + *
+   * Use standard model variant even if an enhanced model is available.  See the
+   * [Cloud Speech
+   * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models)
+   * for details about enhanced models.
+   * 
+ * + * USE_STANDARD = 2; + */ + public static final int USE_STANDARD_VALUE = 2; + /** + * + * + *
+   * Use an enhanced model variant:
+   * * If an enhanced variant does not exist for the given
+   *   [model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] and request language, Dialogflow falls
+   *   back to the standard variant.
+   *   The [Cloud Speech
+   *   documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models)
+   *   describes which models have enhanced variants.
+   * * If the API caller isn't eligible for enhanced models, Dialogflow returns
+   *   an error.  Please see the [Dialogflow
+   *   docs](https://cloud.google.com/dialogflow/docs/data-logging)
+   *   for how to make your project eligible.
+   * 
+ * + * USE_ENHANCED = 3; + */ + public static final int USE_ENHANCED_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 SpeechModelVariant 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 SpeechModelVariant forNumber(int value) { + switch (value) { + case 0: + return SPEECH_MODEL_VARIANT_UNSPECIFIED; + case 1: + return USE_BEST_AVAILABLE; + case 2: + return USE_STANDARD; + case 3: + return USE_ENHANCED; + 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 SpeechModelVariant findValueByNumber(int number) { + return SpeechModelVariant.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final SpeechModelVariant[] VALUES = values(); + + public static SpeechModelVariant 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 SpeechModelVariant(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.SpeechModelVariant) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechToTextSettings.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechToTextSettings.java new file mode 100644 index 000000000..ea933c8cc --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechToTextSettings.java @@ -0,0 +1,547 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Settings related to speech recognition.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings} + */ +public final class SpeechToTextSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings) + SpeechToTextSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use SpeechToTextSettings.newBuilder() to construct. + private SpeechToTextSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SpeechToTextSettings() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SpeechToTextSettings(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SpeechToTextSettings( + 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: + { + enableSpeechAdaptation_ = 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.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechToTextSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechToTextSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.class, + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.Builder.class); + } + + public static final int ENABLE_SPEECH_ADAPTATION_FIELD_NUMBER = 1; + private boolean enableSpeechAdaptation_; + /** + * + * + *
+   * Whether to use speech adaptation for speech recognition.
+   * 
+ * + * bool enable_speech_adaptation = 1; + * + * @return The enableSpeechAdaptation. + */ + @java.lang.Override + public boolean getEnableSpeechAdaptation() { + return enableSpeechAdaptation_; + } + + 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 (enableSpeechAdaptation_ != false) { + output.writeBool(1, enableSpeechAdaptation_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enableSpeechAdaptation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enableSpeechAdaptation_); + } + 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.dialogflow.cx.v3beta1.SpeechToTextSettings)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings other = + (com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings) obj; + + if (getEnableSpeechAdaptation() != other.getEnableSpeechAdaptation()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENABLE_SPEECH_ADAPTATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableSpeechAdaptation()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings 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.dialogflow.cx.v3beta1.SpeechToTextSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings 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.dialogflow.cx.v3beta1.SpeechToTextSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings 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.dialogflow.cx.v3beta1.SpeechToTextSettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings 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.dialogflow.cx.v3beta1.SpeechToTextSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings 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.dialogflow.cx.v3beta1.SpeechToTextSettings 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; + } + /** + * + * + *
+   * Settings related to speech recognition.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings) + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechToTextSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechToTextSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.class, + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.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(); + enableSpeechAdaptation_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechToTextSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings build() { + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings result = + new com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings(this); + result.enableSpeechAdaptation_ = enableSpeechAdaptation_; + 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.dialogflow.cx.v3beta1.SpeechToTextSettings) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.getDefaultInstance()) + return this; + if (other.getEnableSpeechAdaptation() != false) { + setEnableSpeechAdaptation(other.getEnableSpeechAdaptation()); + } + 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.dialogflow.cx.v3beta1.SpeechToTextSettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean enableSpeechAdaptation_; + /** + * + * + *
+     * Whether to use speech adaptation for speech recognition.
+     * 
+ * + * bool enable_speech_adaptation = 1; + * + * @return The enableSpeechAdaptation. + */ + @java.lang.Override + public boolean getEnableSpeechAdaptation() { + return enableSpeechAdaptation_; + } + /** + * + * + *
+     * Whether to use speech adaptation for speech recognition.
+     * 
+ * + * bool enable_speech_adaptation = 1; + * + * @param value The enableSpeechAdaptation to set. + * @return This builder for chaining. + */ + public Builder setEnableSpeechAdaptation(boolean value) { + + enableSpeechAdaptation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether to use speech adaptation for speech recognition.
+     * 
+ * + * bool enable_speech_adaptation = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnableSpeechAdaptation() { + + enableSpeechAdaptation_ = 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.dialogflow.cx.v3beta1.SpeechToTextSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings) + private static final com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeechToTextSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SpeechToTextSettings(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.dialogflow.cx.v3beta1.SpeechToTextSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechToTextSettingsOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechToTextSettingsOrBuilder.java new file mode 100644 index 000000000..f09a21717 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechToTextSettingsOrBuilder.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface SpeechToTextSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether to use speech adaptation for speech recognition.
+   * 
+ * + * bool enable_speech_adaptation = 1; + * + * @return The enableSpeechAdaptation. + */ + boolean getEnableSpeechAdaptation(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechWordInfo.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechWordInfo.java new file mode 100644 index 000000000..16c8bca28 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechWordInfo.java @@ -0,0 +1,1336 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Information for a word recognized by the speech recognizer.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo} + */ +public final class SpeechWordInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo) + SpeechWordInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use SpeechWordInfo.newBuilder() to construct. + private SpeechWordInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SpeechWordInfo() { + word_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SpeechWordInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SpeechWordInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (startOffset_ != null) { + subBuilder = startOffset_.toBuilder(); + } + startOffset_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startOffset_); + startOffset_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (endOffset_ != null) { + subBuilder = endOffset_.toBuilder(); + } + endOffset_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endOffset_); + endOffset_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + word_ = s; + break; + } + case 37: + { + confidence_ = input.readFloat(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechWordInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechWordInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.class, + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.Builder.class); + } + + public static final int WORD_FIELD_NUMBER = 3; + private volatile java.lang.Object word_; + /** + * + * + *
+   * The word this info is for.
+   * 
+ * + * string word = 3; + * + * @return The word. + */ + @java.lang.Override + public java.lang.String getWord() { + java.lang.Object ref = word_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + word_ = s; + return s; + } + } + /** + * + * + *
+   * The word this info is for.
+   * 
+ * + * string word = 3; + * + * @return The bytes for word. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWordBytes() { + java.lang.Object ref = word_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + word_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_OFFSET_FIELD_NUMBER = 1; + private com.google.protobuf.Duration startOffset_; + /** + * + * + *
+   * Time offset relative to the beginning of the audio that corresponds to the
+   * start of the spoken word. This is an experimental feature and the accuracy
+   * of the time offset can vary.
+   * 
+ * + * .google.protobuf.Duration start_offset = 1; + * + * @return Whether the startOffset field is set. + */ + @java.lang.Override + public boolean hasStartOffset() { + return startOffset_ != null; + } + /** + * + * + *
+   * Time offset relative to the beginning of the audio that corresponds to the
+   * start of the spoken word. This is an experimental feature and the accuracy
+   * of the time offset can vary.
+   * 
+ * + * .google.protobuf.Duration start_offset = 1; + * + * @return The startOffset. + */ + @java.lang.Override + public com.google.protobuf.Duration getStartOffset() { + return startOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startOffset_; + } + /** + * + * + *
+   * Time offset relative to the beginning of the audio that corresponds to the
+   * start of the spoken word. This is an experimental feature and the accuracy
+   * of the time offset can vary.
+   * 
+ * + * .google.protobuf.Duration start_offset = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getStartOffsetOrBuilder() { + return getStartOffset(); + } + + public static final int END_OFFSET_FIELD_NUMBER = 2; + private com.google.protobuf.Duration endOffset_; + /** + * + * + *
+   * Time offset relative to the beginning of the audio that corresponds to the
+   * end of the spoken word. This is an experimental feature and the accuracy of
+   * the time offset can vary.
+   * 
+ * + * .google.protobuf.Duration end_offset = 2; + * + * @return Whether the endOffset field is set. + */ + @java.lang.Override + public boolean hasEndOffset() { + return endOffset_ != null; + } + /** + * + * + *
+   * Time offset relative to the beginning of the audio that corresponds to the
+   * end of the spoken word. This is an experimental feature and the accuracy of
+   * the time offset can vary.
+   * 
+ * + * .google.protobuf.Duration end_offset = 2; + * + * @return The endOffset. + */ + @java.lang.Override + public com.google.protobuf.Duration getEndOffset() { + return endOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endOffset_; + } + /** + * + * + *
+   * Time offset relative to the beginning of the audio that corresponds to the
+   * end of the spoken word. This is an experimental feature and the accuracy of
+   * the time offset can vary.
+   * 
+ * + * .google.protobuf.Duration end_offset = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getEndOffsetOrBuilder() { + return getEndOffset(); + } + + public static final int CONFIDENCE_FIELD_NUMBER = 4; + private float confidence_; + /** + * + * + *
+   * The Speech confidence between 0.0 and 1.0 for this word. A higher number
+   * indicates an estimated greater likelihood that the recognized word is
+   * correct. The default of 0.0 is a sentinel value indicating that confidence
+   * was not set.
+   * This field is not guaranteed to be fully stable over time for the same
+   * audio input. Users should also not rely on it to always be provided.
+   * 
+ * + * float confidence = 4; + * + * @return The confidence. + */ + @java.lang.Override + public float getConfidence() { + return confidence_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (startOffset_ != null) { + output.writeMessage(1, getStartOffset()); + } + if (endOffset_ != null) { + output.writeMessage(2, getEndOffset()); + } + if (!getWordBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, word_); + } + if (confidence_ != 0F) { + output.writeFloat(4, confidence_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startOffset_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartOffset()); + } + if (endOffset_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndOffset()); + } + if (!getWordBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, word_); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, confidence_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo other = + (com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo) obj; + + if (!getWord().equals(other.getWord())) return false; + if (hasStartOffset() != other.hasStartOffset()) return false; + if (hasStartOffset()) { + if (!getStartOffset().equals(other.getStartOffset())) return false; + } + if (hasEndOffset() != other.hasEndOffset()) return false; + if (hasEndOffset()) { + if (!getEndOffset().equals(other.getEndOffset())) return false; + } + if (java.lang.Float.floatToIntBits(getConfidence()) + != java.lang.Float.floatToIntBits(other.getConfidence())) 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) + WORD_FIELD_NUMBER; + hash = (53 * hash) + getWord().hashCode(); + if (hasStartOffset()) { + hash = (37 * hash) + START_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getStartOffset().hashCode(); + } + if (hasEndOffset()) { + hash = (37 * hash) + END_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getEndOffset().hashCode(); + } + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo 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.dialogflow.cx.v3beta1.SpeechWordInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo 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.dialogflow.cx.v3beta1.SpeechWordInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo 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.dialogflow.cx.v3beta1.SpeechWordInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo 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.dialogflow.cx.v3beta1.SpeechWordInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo 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.dialogflow.cx.v3beta1.SpeechWordInfo 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 for a word recognized by the speech recognizer.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo) + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechWordInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechWordInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.class, + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.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(); + word_ = ""; + + if (startOffsetBuilder_ == null) { + startOffset_ = null; + } else { + startOffset_ = null; + startOffsetBuilder_ = null; + } + if (endOffsetBuilder_ == null) { + endOffset_ = null; + } else { + endOffset_ = null; + endOffsetBuilder_ = null; + } + confidence_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SpeechWordInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo build() { + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo result = + new com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo(this); + result.word_ = word_; + if (startOffsetBuilder_ == null) { + result.startOffset_ = startOffset_; + } else { + result.startOffset_ = startOffsetBuilder_.build(); + } + if (endOffsetBuilder_ == null) { + result.endOffset_ = endOffset_; + } else { + result.endOffset_ = endOffsetBuilder_.build(); + } + result.confidence_ = confidence_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.getDefaultInstance()) + return this; + if (!other.getWord().isEmpty()) { + word_ = other.word_; + onChanged(); + } + if (other.hasStartOffset()) { + mergeStartOffset(other.getStartOffset()); + } + if (other.hasEndOffset()) { + mergeEndOffset(other.getEndOffset()); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + 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.dialogflow.cx.v3beta1.SpeechWordInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object word_ = ""; + /** + * + * + *
+     * The word this info is for.
+     * 
+ * + * string word = 3; + * + * @return The word. + */ + public java.lang.String getWord() { + java.lang.Object ref = word_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + word_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The word this info is for.
+     * 
+ * + * string word = 3; + * + * @return The bytes for word. + */ + public com.google.protobuf.ByteString getWordBytes() { + java.lang.Object ref = word_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + word_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The word this info is for.
+     * 
+ * + * string word = 3; + * + * @param value The word to set. + * @return This builder for chaining. + */ + public Builder setWord(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + word_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The word this info is for.
+     * 
+ * + * string word = 3; + * + * @return This builder for chaining. + */ + public Builder clearWord() { + + word_ = getDefaultInstance().getWord(); + onChanged(); + return this; + } + /** + * + * + *
+     * The word this info is for.
+     * 
+ * + * string word = 3; + * + * @param value The bytes for word to set. + * @return This builder for chaining. + */ + public Builder setWordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + word_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Duration startOffset_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + startOffsetBuilder_; + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * start of the spoken word. This is an experimental feature and the accuracy
+     * of the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1; + * + * @return Whether the startOffset field is set. + */ + public boolean hasStartOffset() { + return startOffsetBuilder_ != null || startOffset_ != null; + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * start of the spoken word. This is an experimental feature and the accuracy
+     * of the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1; + * + * @return The startOffset. + */ + public com.google.protobuf.Duration getStartOffset() { + if (startOffsetBuilder_ == null) { + return startOffset_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : startOffset_; + } else { + return startOffsetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * start of the spoken word. This is an experimental feature and the accuracy
+     * of the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1; + */ + public Builder setStartOffset(com.google.protobuf.Duration value) { + if (startOffsetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startOffset_ = value; + onChanged(); + } else { + startOffsetBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * start of the spoken word. This is an experimental feature and the accuracy
+     * of the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1; + */ + public Builder setStartOffset(com.google.protobuf.Duration.Builder builderForValue) { + if (startOffsetBuilder_ == null) { + startOffset_ = builderForValue.build(); + onChanged(); + } else { + startOffsetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * start of the spoken word. This is an experimental feature and the accuracy
+     * of the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1; + */ + public Builder mergeStartOffset(com.google.protobuf.Duration value) { + if (startOffsetBuilder_ == null) { + if (startOffset_ != null) { + startOffset_ = + com.google.protobuf.Duration.newBuilder(startOffset_).mergeFrom(value).buildPartial(); + } else { + startOffset_ = value; + } + onChanged(); + } else { + startOffsetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * start of the spoken word. This is an experimental feature and the accuracy
+     * of the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1; + */ + public Builder clearStartOffset() { + if (startOffsetBuilder_ == null) { + startOffset_ = null; + onChanged(); + } else { + startOffset_ = null; + startOffsetBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * start of the spoken word. This is an experimental feature and the accuracy
+     * of the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1; + */ + public com.google.protobuf.Duration.Builder getStartOffsetBuilder() { + + onChanged(); + return getStartOffsetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * start of the spoken word. This is an experimental feature and the accuracy
+     * of the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1; + */ + public com.google.protobuf.DurationOrBuilder getStartOffsetOrBuilder() { + if (startOffsetBuilder_ != null) { + return startOffsetBuilder_.getMessageOrBuilder(); + } else { + return startOffset_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : startOffset_; + } + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * start of the spoken word. This is an experimental feature and the accuracy
+     * of the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getStartOffsetFieldBuilder() { + if (startOffsetBuilder_ == null) { + startOffsetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getStartOffset(), getParentForChildren(), isClean()); + startOffset_ = null; + } + return startOffsetBuilder_; + } + + private com.google.protobuf.Duration endOffset_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + endOffsetBuilder_; + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * end of the spoken word. This is an experimental feature and the accuracy of
+     * the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2; + * + * @return Whether the endOffset field is set. + */ + public boolean hasEndOffset() { + return endOffsetBuilder_ != null || endOffset_ != null; + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * end of the spoken word. This is an experimental feature and the accuracy of
+     * the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2; + * + * @return The endOffset. + */ + public com.google.protobuf.Duration getEndOffset() { + if (endOffsetBuilder_ == null) { + return endOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endOffset_; + } else { + return endOffsetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * end of the spoken word. This is an experimental feature and the accuracy of
+     * the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2; + */ + public Builder setEndOffset(com.google.protobuf.Duration value) { + if (endOffsetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endOffset_ = value; + onChanged(); + } else { + endOffsetBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * end of the spoken word. This is an experimental feature and the accuracy of
+     * the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2; + */ + public Builder setEndOffset(com.google.protobuf.Duration.Builder builderForValue) { + if (endOffsetBuilder_ == null) { + endOffset_ = builderForValue.build(); + onChanged(); + } else { + endOffsetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * end of the spoken word. This is an experimental feature and the accuracy of
+     * the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2; + */ + public Builder mergeEndOffset(com.google.protobuf.Duration value) { + if (endOffsetBuilder_ == null) { + if (endOffset_ != null) { + endOffset_ = + com.google.protobuf.Duration.newBuilder(endOffset_).mergeFrom(value).buildPartial(); + } else { + endOffset_ = value; + } + onChanged(); + } else { + endOffsetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * end of the spoken word. This is an experimental feature and the accuracy of
+     * the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2; + */ + public Builder clearEndOffset() { + if (endOffsetBuilder_ == null) { + endOffset_ = null; + onChanged(); + } else { + endOffset_ = null; + endOffsetBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * end of the spoken word. This is an experimental feature and the accuracy of
+     * the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2; + */ + public com.google.protobuf.Duration.Builder getEndOffsetBuilder() { + + onChanged(); + return getEndOffsetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * end of the spoken word. This is an experimental feature and the accuracy of
+     * the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2; + */ + public com.google.protobuf.DurationOrBuilder getEndOffsetOrBuilder() { + if (endOffsetBuilder_ != null) { + return endOffsetBuilder_.getMessageOrBuilder(); + } else { + return endOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endOffset_; + } + } + /** + * + * + *
+     * Time offset relative to the beginning of the audio that corresponds to the
+     * end of the spoken word. This is an experimental feature and the accuracy of
+     * the time offset can vary.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getEndOffsetFieldBuilder() { + if (endOffsetBuilder_ == null) { + endOffsetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getEndOffset(), getParentForChildren(), isClean()); + endOffset_ = null; + } + return endOffsetBuilder_; + } + + private float confidence_; + /** + * + * + *
+     * The Speech confidence between 0.0 and 1.0 for this word. A higher number
+     * indicates an estimated greater likelihood that the recognized word is
+     * correct. The default of 0.0 is a sentinel value indicating that confidence
+     * was not set.
+     * This field is not guaranteed to be fully stable over time for the same
+     * audio input. Users should also not rely on it to always be provided.
+     * 
+ * + * float confidence = 4; + * + * @return The confidence. + */ + @java.lang.Override + public float getConfidence() { + return confidence_; + } + /** + * + * + *
+     * The Speech confidence between 0.0 and 1.0 for this word. A higher number
+     * indicates an estimated greater likelihood that the recognized word is
+     * correct. The default of 0.0 is a sentinel value indicating that confidence
+     * was not set.
+     * This field is not guaranteed to be fully stable over time for the same
+     * audio input. Users should also not rely on it to always be provided.
+     * 
+ * + * float confidence = 4; + * + * @param value The confidence to set. + * @return This builder for chaining. + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Speech confidence between 0.0 and 1.0 for this word. A higher number
+     * indicates an estimated greater likelihood that the recognized word is
+     * correct. The default of 0.0 is a sentinel value indicating that confidence
+     * was not set.
+     * This field is not guaranteed to be fully stable over time for the same
+     * audio input. Users should also not rely on it to always be provided.
+     * 
+ * + * float confidence = 4; + * + * @return This builder for chaining. + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo) + private static final com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeechWordInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SpeechWordInfo(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.dialogflow.cx.v3beta1.SpeechWordInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechWordInfoOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechWordInfoOrBuilder.java new file mode 100644 index 000000000..122a5223e --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SpeechWordInfoOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface SpeechWordInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The word this info is for.
+   * 
+ * + * string word = 3; + * + * @return The word. + */ + java.lang.String getWord(); + /** + * + * + *
+   * The word this info is for.
+   * 
+ * + * string word = 3; + * + * @return The bytes for word. + */ + com.google.protobuf.ByteString getWordBytes(); + + /** + * + * + *
+   * Time offset relative to the beginning of the audio that corresponds to the
+   * start of the spoken word. This is an experimental feature and the accuracy
+   * of the time offset can vary.
+   * 
+ * + * .google.protobuf.Duration start_offset = 1; + * + * @return Whether the startOffset field is set. + */ + boolean hasStartOffset(); + /** + * + * + *
+   * Time offset relative to the beginning of the audio that corresponds to the
+   * start of the spoken word. This is an experimental feature and the accuracy
+   * of the time offset can vary.
+   * 
+ * + * .google.protobuf.Duration start_offset = 1; + * + * @return The startOffset. + */ + com.google.protobuf.Duration getStartOffset(); + /** + * + * + *
+   * Time offset relative to the beginning of the audio that corresponds to the
+   * start of the spoken word. This is an experimental feature and the accuracy
+   * of the time offset can vary.
+   * 
+ * + * .google.protobuf.Duration start_offset = 1; + */ + com.google.protobuf.DurationOrBuilder getStartOffsetOrBuilder(); + + /** + * + * + *
+   * Time offset relative to the beginning of the audio that corresponds to the
+   * end of the spoken word. This is an experimental feature and the accuracy of
+   * the time offset can vary.
+   * 
+ * + * .google.protobuf.Duration end_offset = 2; + * + * @return Whether the endOffset field is set. + */ + boolean hasEndOffset(); + /** + * + * + *
+   * Time offset relative to the beginning of the audio that corresponds to the
+   * end of the spoken word. This is an experimental feature and the accuracy of
+   * the time offset can vary.
+   * 
+ * + * .google.protobuf.Duration end_offset = 2; + * + * @return The endOffset. + */ + com.google.protobuf.Duration getEndOffset(); + /** + * + * + *
+   * Time offset relative to the beginning of the audio that corresponds to the
+   * end of the spoken word. This is an experimental feature and the accuracy of
+   * the time offset can vary.
+   * 
+ * + * .google.protobuf.Duration end_offset = 2; + */ + com.google.protobuf.DurationOrBuilder getEndOffsetOrBuilder(); + + /** + * + * + *
+   * The Speech confidence between 0.0 and 1.0 for this word. A higher number
+   * indicates an estimated greater likelihood that the recognized word is
+   * correct. The default of 0.0 is a sentinel value indicating that confidence
+   * was not set.
+   * This field is not guaranteed to be fully stable over time for the same
+   * audio input. Users should also not rely on it to always be provided.
+   * 
+ * + * float confidence = 4; + * + * @return The confidence. + */ + float getConfidence(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SsmlVoiceGender.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SsmlVoiceGender.java new file mode 100644 index 000000000..d83666878 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SsmlVoiceGender.java @@ -0,0 +1,203 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Gender of the voice as described in
+ * [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice).
+ * 
+ * + * Protobuf enum {@code google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender} + */ +public enum SsmlVoiceGender implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * An unspecified gender, which means that the client doesn't care which
+   * gender the selected voice will have.
+   * 
+ * + * SSML_VOICE_GENDER_UNSPECIFIED = 0; + */ + SSML_VOICE_GENDER_UNSPECIFIED(0), + /** + * + * + *
+   * A male voice.
+   * 
+ * + * SSML_VOICE_GENDER_MALE = 1; + */ + SSML_VOICE_GENDER_MALE(1), + /** + * + * + *
+   * A female voice.
+   * 
+ * + * SSML_VOICE_GENDER_FEMALE = 2; + */ + SSML_VOICE_GENDER_FEMALE(2), + /** + * + * + *
+   * A gender-neutral voice.
+   * 
+ * + * SSML_VOICE_GENDER_NEUTRAL = 3; + */ + SSML_VOICE_GENDER_NEUTRAL(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * An unspecified gender, which means that the client doesn't care which
+   * gender the selected voice will have.
+   * 
+ * + * SSML_VOICE_GENDER_UNSPECIFIED = 0; + */ + public static final int SSML_VOICE_GENDER_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * A male voice.
+   * 
+ * + * SSML_VOICE_GENDER_MALE = 1; + */ + public static final int SSML_VOICE_GENDER_MALE_VALUE = 1; + /** + * + * + *
+   * A female voice.
+   * 
+ * + * SSML_VOICE_GENDER_FEMALE = 2; + */ + public static final int SSML_VOICE_GENDER_FEMALE_VALUE = 2; + /** + * + * + *
+   * A gender-neutral voice.
+   * 
+ * + * SSML_VOICE_GENDER_NEUTRAL = 3; + */ + public static final int SSML_VOICE_GENDER_NEUTRAL_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 SsmlVoiceGender 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 SsmlVoiceGender forNumber(int value) { + switch (value) { + case 0: + return SSML_VOICE_GENDER_UNSPECIFIED; + case 1: + return SSML_VOICE_GENDER_MALE; + case 2: + return SSML_VOICE_GENDER_FEMALE; + case 3: + return SSML_VOICE_GENDER_NEUTRAL; + 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 SsmlVoiceGender findValueByNumber(int number) { + return SsmlVoiceGender.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto.getDescriptor() + .getEnumTypes() + .get(2); + } + + private static final SsmlVoiceGender[] VALUES = values(); + + public static SsmlVoiceGender 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 SsmlVoiceGender(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentRequest.java new file mode 100644 index 000000000..dca0c6d31 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentRequest.java @@ -0,0 +1,1600 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The top-level message sent by the client to the
+ * [Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.StreamingDetectIntent] method.
+ * Multiple request messages should be sent in order:
+ * 1.  The first message must contain
+ * [session][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.session],
+ *     [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] plus optionally
+ *     [query_params][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_params]. If the client
+ *     wants to receive an audio response, it should also contain
+ *     [output_audio_config][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.output_audio_config].
+ * 2.  If [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] was set to
+ *     [query_input.audio.config][google.cloud.dialogflow.cx.v3beta1.AudioInput.config], all subsequent messages
+ *     must contain [query_input.audio.audio][google.cloud.dialogflow.cx.v3beta1.AudioInput.audio] to continue with
+ *     Speech recognition.
+ *     If you decide to rather detect an intent from text
+ *     input after you already started Speech recognition, please send a message
+ *     with [query_input.text][google.cloud.dialogflow.cx.v3beta1.QueryInput.text].
+ *     However, note that:
+ *     * Dialogflow will bill you for the audio duration so far.
+ *     * Dialogflow discards all Speech recognition results in favor of the
+ *       input text.
+ *     * Dialogflow will use the language code from the first message.
+ * After you sent all input, you must half-close or abort the request stream.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest} + */ +public final class StreamingDetectIntentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest) + StreamingDetectIntentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StreamingDetectIntentRequest.newBuilder() to construct. + private StreamingDetectIntentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingDetectIntentRequest() { + session_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingDetectIntentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StreamingDetectIntentRequest( + 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(); + + session_ = s; + break; + } + case 18: + { + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder subBuilder = null; + if (queryParams_ != null) { + subBuilder = queryParams_.toBuilder(); + } + queryParams_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryParams_); + queryParams_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder subBuilder = null; + if (queryInput_ != null) { + subBuilder = queryInput_.toBuilder(); + } + queryInput_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryInput_); + queryInput_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder subBuilder = null; + if (outputAudioConfig_ != null) { + subBuilder = outputAudioConfig_.toBuilder(); + } + outputAudioConfig_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputAudioConfig_); + outputAudioConfig_ = 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.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.Builder.class); + } + + public static final int SESSION_FIELD_NUMBER = 1; + private volatile java.lang.Object session_; + /** + * + * + *
+   * The name of the session this query is sent to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * It's up to the API caller to choose an appropriate `Session ID`. It can be
+   * a random number or some type of session identifiers (preferably hashed).
+   * The length of the `Session ID` must not exceed 36 characters.
+   * Note: session must be set in the first request.
+   * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @return The session. + */ + @java.lang.Override + public java.lang.String getSession() { + java.lang.Object ref = session_; + 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(); + session_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the session this query is sent to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * It's up to the API caller to choose an appropriate `Session ID`. It can be
+   * a random number or some type of session identifiers (preferably hashed).
+   * The length of the `Session ID` must not exceed 36 characters.
+   * Note: session must be set in the first request.
+   * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for session. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSessionBytes() { + java.lang.Object ref = session_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + session_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_PARAMS_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.QueryParameters queryParams_; + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return Whether the queryParams field is set. + */ + @java.lang.Override + public boolean hasQueryParams() { + return queryParams_ != null; + } + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return The queryParams. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryParameters getQueryParams() { + return queryParams_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.getDefaultInstance() + : queryParams_; + } + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder getQueryParamsOrBuilder() { + return getQueryParams(); + } + + public static final int QUERY_INPUT_FIELD_NUMBER = 3; + private com.google.cloud.dialogflow.cx.v3beta1.QueryInput queryInput_; + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the queryInput field is set. + */ + @java.lang.Override + public boolean hasQueryInput() { + return queryInput_ != null; + } + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The queryInput. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryInput getQueryInput() { + return queryInput_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryInput.getDefaultInstance() + : queryInput_; + } + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputOrBuilder() { + return getQueryInput(); + } + + public static final int OUTPUT_AUDIO_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig outputAudioConfig_; + /** + * + * + *
+   * Instructs the speech synthesizer how to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return Whether the outputAudioConfig field is set. + */ + @java.lang.Override + public boolean hasOutputAudioConfig() { + return outputAudioConfig_ != null; + } + /** + * + * + *
+   * Instructs the speech synthesizer how to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return The outputAudioConfig. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig() { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } + /** + * + * + *
+   * Instructs the speech synthesizer how to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder + getOutputAudioConfigOrBuilder() { + return getOutputAudioConfig(); + } + + 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 (!getSessionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, session_); + } + if (queryParams_ != null) { + output.writeMessage(2, getQueryParams()); + } + if (queryInput_ != null) { + output.writeMessage(3, getQueryInput()); + } + if (outputAudioConfig_ != null) { + output.writeMessage(4, getOutputAudioConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSessionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, session_); + } + if (queryParams_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQueryParams()); + } + if (queryInput_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getQueryInput()); + } + if (outputAudioConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getOutputAudioConfig()); + } + 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.dialogflow.cx.v3beta1.StreamingDetectIntentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest) obj; + + if (!getSession().equals(other.getSession())) return false; + if (hasQueryParams() != other.hasQueryParams()) return false; + if (hasQueryParams()) { + if (!getQueryParams().equals(other.getQueryParams())) return false; + } + if (hasQueryInput() != other.hasQueryInput()) return false; + if (hasQueryInput()) { + if (!getQueryInput().equals(other.getQueryInput())) return false; + } + if (hasOutputAudioConfig() != other.hasOutputAudioConfig()) return false; + if (hasOutputAudioConfig()) { + if (!getOutputAudioConfig().equals(other.getOutputAudioConfig())) 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) + SESSION_FIELD_NUMBER; + hash = (53 * hash) + getSession().hashCode(); + if (hasQueryParams()) { + hash = (37 * hash) + QUERY_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getQueryParams().hashCode(); + } + if (hasQueryInput()) { + hash = (37 * hash) + QUERY_INPUT_FIELD_NUMBER; + hash = (53 * hash) + getQueryInput().hashCode(); + } + if (hasOutputAudioConfig()) { + hash = (37 * hash) + OUTPUT_AUDIO_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputAudioConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest 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.dialogflow.cx.v3beta1.StreamingDetectIntentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest 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.dialogflow.cx.v3beta1.StreamingDetectIntentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest 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.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + 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.dialogflow.cx.v3beta1.StreamingDetectIntentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest 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.dialogflow.cx.v3beta1.StreamingDetectIntentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The top-level message sent by the client to the
+   * [Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.StreamingDetectIntent] method.
+   * Multiple request messages should be sent in order:
+   * 1.  The first message must contain
+   * [session][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.session],
+   *     [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] plus optionally
+   *     [query_params][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_params]. If the client
+   *     wants to receive an audio response, it should also contain
+   *     [output_audio_config][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.output_audio_config].
+   * 2.  If [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] was set to
+   *     [query_input.audio.config][google.cloud.dialogflow.cx.v3beta1.AudioInput.config], all subsequent messages
+   *     must contain [query_input.audio.audio][google.cloud.dialogflow.cx.v3beta1.AudioInput.audio] to continue with
+   *     Speech recognition.
+   *     If you decide to rather detect an intent from text
+   *     input after you already started Speech recognition, please send a message
+   *     with [query_input.text][google.cloud.dialogflow.cx.v3beta1.QueryInput.text].
+   *     However, note that:
+   *     * Dialogflow will bill you for the audio duration so far.
+   *     * Dialogflow discards all Speech recognition results in favor of the
+   *       input text.
+   *     * Dialogflow will use the language code from the first message.
+   * After you sent all input, you must half-close or abort the request stream.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest) + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.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(); + session_ = ""; + + if (queryParamsBuilder_ == null) { + queryParams_ = null; + } else { + queryParams_ = null; + queryParamsBuilder_ = null; + } + if (queryInputBuilder_ == null) { + queryInput_ = null; + } else { + queryInput_ = null; + queryInputBuilder_ = null; + } + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = null; + } else { + outputAudioConfig_ = null; + outputAudioConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest(this); + result.session_ = session_; + if (queryParamsBuilder_ == null) { + result.queryParams_ = queryParams_; + } else { + result.queryParams_ = queryParamsBuilder_.build(); + } + if (queryInputBuilder_ == null) { + result.queryInput_ = queryInput_; + } else { + result.queryInput_ = queryInputBuilder_.build(); + } + if (outputAudioConfigBuilder_ == null) { + result.outputAudioConfig_ = outputAudioConfig_; + } else { + result.outputAudioConfig_ = outputAudioConfigBuilder_.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.dialogflow.cx.v3beta1.StreamingDetectIntentRequest) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + .getDefaultInstance()) return this; + if (!other.getSession().isEmpty()) { + session_ = other.session_; + onChanged(); + } + if (other.hasQueryParams()) { + mergeQueryParams(other.getQueryParams()); + } + if (other.hasQueryInput()) { + mergeQueryInput(other.getQueryInput()); + } + if (other.hasOutputAudioConfig()) { + mergeOutputAudioConfig(other.getOutputAudioConfig()); + } + 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.dialogflow.cx.v3beta1.StreamingDetectIntentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object session_ = ""; + /** + * + * + *
+     * The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * Note: session must be set in the first request.
+     * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @return The session. + */ + public java.lang.String getSession() { + java.lang.Object ref = session_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + session_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * Note: session must be set in the first request.
+     * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for session. + */ + public com.google.protobuf.ByteString getSessionBytes() { + java.lang.Object ref = session_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + session_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * Note: session must be set in the first request.
+     * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The session to set. + * @return This builder for chaining. + */ + public Builder setSession(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + session_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * Note: session must be set in the first request.
+     * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearSession() { + + session_ = getDefaultInstance().getSession(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the session this query is sent to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>`.
+     * It's up to the API caller to choose an appropriate `Session ID`. It can be
+     * a random number or some type of session identifiers (preferably hashed).
+     * The length of the `Session ID` must not exceed 36 characters.
+     * Note: session must be set in the first request.
+     * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for session to set. + * @return This builder for chaining. + */ + public Builder setSessionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + session_ = value; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.QueryParameters queryParams_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters, + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder> + queryParamsBuilder_; + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return Whether the queryParams field is set. + */ + public boolean hasQueryParams() { + return queryParamsBuilder_ != null || queryParams_ != null; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return The queryParams. + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryParameters getQueryParams() { + if (queryParamsBuilder_ == null) { + return queryParams_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.getDefaultInstance() + : queryParams_; + } else { + return queryParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public Builder setQueryParams(com.google.cloud.dialogflow.cx.v3beta1.QueryParameters value) { + if (queryParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryParams_ = value; + onChanged(); + } else { + queryParamsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public Builder setQueryParams( + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder builderForValue) { + if (queryParamsBuilder_ == null) { + queryParams_ = builderForValue.build(); + onChanged(); + } else { + queryParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public Builder mergeQueryParams(com.google.cloud.dialogflow.cx.v3beta1.QueryParameters value) { + if (queryParamsBuilder_ == null) { + if (queryParams_ != null) { + queryParams_ = + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.newBuilder(queryParams_) + .mergeFrom(value) + .buildPartial(); + } else { + queryParams_ = value; + } + onChanged(); + } else { + queryParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public Builder clearQueryParams() { + if (queryParamsBuilder_ == null) { + queryParams_ = null; + onChanged(); + } else { + queryParams_ = null; + queryParamsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder getQueryParamsBuilder() { + + onChanged(); + return getQueryParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder + getQueryParamsOrBuilder() { + if (queryParamsBuilder_ != null) { + return queryParamsBuilder_.getMessageOrBuilder(); + } else { + return queryParams_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.getDefaultInstance() + : queryParams_; + } + } + /** + * + * + *
+     * The parameters of this query.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters, + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder> + getQueryParamsFieldBuilder() { + if (queryParamsBuilder_ == null) { + queryParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters, + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder>( + getQueryParams(), getParentForChildren(), isClean()); + queryParams_ = null; + } + return queryParamsBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.QueryInput queryInput_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryInput, + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder> + queryInputBuilder_; + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the queryInput field is set. + */ + public boolean hasQueryInput() { + return queryInputBuilder_ != null || queryInput_ != null; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The queryInput. + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryInput getQueryInput() { + if (queryInputBuilder_ == null) { + return queryInput_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryInput.getDefaultInstance() + : queryInput_; + } else { + return queryInputBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQueryInput(com.google.cloud.dialogflow.cx.v3beta1.QueryInput value) { + if (queryInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryInput_ = value; + onChanged(); + } else { + queryInputBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQueryInput( + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder builderForValue) { + if (queryInputBuilder_ == null) { + queryInput_ = builderForValue.build(); + onChanged(); + } else { + queryInputBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeQueryInput(com.google.cloud.dialogflow.cx.v3beta1.QueryInput value) { + if (queryInputBuilder_ == null) { + if (queryInput_ != null) { + queryInput_ = + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.newBuilder(queryInput_) + .mergeFrom(value) + .buildPartial(); + } else { + queryInput_ = value; + } + onChanged(); + } else { + queryInputBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearQueryInput() { + if (queryInputBuilder_ == null) { + queryInput_ = null; + onChanged(); + } else { + queryInput_ = null; + queryInputBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder getQueryInputBuilder() { + + onChanged(); + return getQueryInputFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputOrBuilder() { + if (queryInputBuilder_ != null) { + return queryInputBuilder_.getMessageOrBuilder(); + } else { + return queryInput_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.QueryInput.getDefaultInstance() + : queryInput_; + } + } + /** + * + * + *
+     * Required. The input specification.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryInput, + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder> + getQueryInputFieldBuilder() { + if (queryInputBuilder_ == null) { + queryInputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.QueryInput, + com.google.cloud.dialogflow.cx.v3beta1.QueryInput.Builder, + com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder>( + getQueryInput(), getParentForChildren(), isClean()); + queryInput_ = null; + } + return queryInputBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig outputAudioConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder> + outputAudioConfigBuilder_; + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return Whether the outputAudioConfig field is set. + */ + public boolean hasOutputAudioConfig() { + return outputAudioConfigBuilder_ != null || outputAudioConfig_ != null; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return The outputAudioConfig. + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig() { + if (outputAudioConfigBuilder_ == null) { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } else { + return outputAudioConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public Builder setOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig value) { + if (outputAudioConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputAudioConfig_ = value; + onChanged(); + } else { + outputAudioConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public Builder setOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder builderForValue) { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = builderForValue.build(); + onChanged(); + } else { + outputAudioConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public Builder mergeOutputAudioConfig( + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig value) { + if (outputAudioConfigBuilder_ == null) { + if (outputAudioConfig_ != null) { + outputAudioConfig_ = + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.newBuilder( + outputAudioConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + outputAudioConfig_ = value; + } + onChanged(); + } else { + outputAudioConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public Builder clearOutputAudioConfig() { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfig_ = null; + onChanged(); + } else { + outputAudioConfig_ = null; + outputAudioConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder + getOutputAudioConfigBuilder() { + + onChanged(); + return getOutputAudioConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder + getOutputAudioConfigOrBuilder() { + if (outputAudioConfigBuilder_ != null) { + return outputAudioConfigBuilder_.getMessageOrBuilder(); + } else { + return outputAudioConfig_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.getDefaultInstance() + : outputAudioConfig_; + } + } + /** + * + * + *
+     * Instructs the speech synthesizer how to generate the output audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder> + getOutputAudioConfigFieldBuilder() { + if (outputAudioConfigBuilder_ == null) { + outputAudioConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder>( + getOutputAudioConfig(), getParentForChildren(), isClean()); + outputAudioConfig_ = null; + } + return outputAudioConfigBuilder_; + } + + @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.dialogflow.cx.v3beta1.StreamingDetectIntentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingDetectIntentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingDetectIntentRequest(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.dialogflow.cx.v3beta1.StreamingDetectIntentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentRequestOrBuilder.java new file mode 100644 index 000000000..fbb614139 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentRequestOrBuilder.java @@ -0,0 +1,173 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface StreamingDetectIntentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the session this query is sent to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * It's up to the API caller to choose an appropriate `Session ID`. It can be
+   * a random number or some type of session identifiers (preferably hashed).
+   * The length of the `Session ID` must not exceed 36 characters.
+   * Note: session must be set in the first request.
+   * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @return The session. + */ + java.lang.String getSession(); + /** + * + * + *
+   * The name of the session this query is sent to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>`.
+   * It's up to the API caller to choose an appropriate `Session ID`. It can be
+   * a random number or some type of session identifiers (preferably hashed).
+   * The length of the `Session ID` must not exceed 36 characters.
+   * Note: session must be set in the first request.
+   * 
+ * + * string session = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for session. + */ + com.google.protobuf.ByteString getSessionBytes(); + + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return Whether the queryParams field is set. + */ + boolean hasQueryParams(); + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + * + * @return The queryParams. + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryParameters getQueryParams(); + /** + * + * + *
+   * The parameters of this query.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.QueryParameters query_params = 2; + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryParametersOrBuilder getQueryParamsOrBuilder(); + + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the queryInput field is set. + */ + boolean hasQueryInput(); + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The queryInput. + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryInput getQueryInput(); + /** + * + * + *
+   * Required. The input specification.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputOrBuilder(); + + /** + * + * + *
+   * Instructs the speech synthesizer how to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return Whether the outputAudioConfig field is set. + */ + boolean hasOutputAudioConfig(); + /** + * + * + *
+   * Instructs the speech synthesizer how to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + * + * @return The outputAudioConfig. + */ + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig getOutputAudioConfig(); + /** + * + * + *
+   * Instructs the speech synthesizer how to generate the output audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig output_audio_config = 4; + */ + com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfigOrBuilder getOutputAudioConfigOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentResponse.java new file mode 100644 index 000000000..3840559ae --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentResponse.java @@ -0,0 +1,1221 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The top-level message returned from the `StreamingDetectIntent` method.
+ * Multiple response messages can be returned in order:
+ * 1.  If the input was set to streaming audio, the first one or more messages
+ *     contain `recognition_result`. Each `recognition_result` represents a more
+ *     complete transcript of what the user said. The last `recognition_result`
+ *     has `is_final` set to `true`.
+ * 2.  The last message contains `detect_intent_response`.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse} + */ +public final class StreamingDetectIntentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse) + StreamingDetectIntentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StreamingDetectIntentResponse.newBuilder() to construct. + private StreamingDetectIntentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingDetectIntentResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingDetectIntentResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StreamingDetectIntentResponse( + 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.dialogflow.cx.v3beta1.StreamingRecognitionResult.Builder subBuilder = + null; + if (responseCase_ == 1) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) response_) + .toBuilder(); + } + response_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) response_); + response_ = subBuilder.buildPartial(); + } + responseCase_ = 1; + break; + } + case 18: + { + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.Builder subBuilder = null; + if (responseCase_ == 2) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) response_) + .toBuilder(); + } + response_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) response_); + response_ = subBuilder.buildPartial(); + } + responseCase_ = 2; + 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.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse.Builder.class); + } + + private int responseCase_ = 0; + private java.lang.Object response_; + + public enum ResponseCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + RECOGNITION_RESULT(1), + DETECT_INTENT_RESPONSE(2), + RESPONSE_NOT_SET(0); + private final int value; + + private ResponseCase(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 ResponseCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseCase forNumber(int value) { + switch (value) { + case 1: + return RECOGNITION_RESULT; + case 2: + return DETECT_INTENT_RESPONSE; + case 0: + return RESPONSE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public static final int RECOGNITION_RESULT_FIELD_NUMBER = 1; + /** + * + * + *
+   * The result of speech recognition.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + * + * @return Whether the recognitionResult field is set. + */ + @java.lang.Override + public boolean hasRecognitionResult() { + return responseCase_ == 1; + } + /** + * + * + *
+   * The result of speech recognition.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + * + * @return The recognitionResult. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult getRecognitionResult() { + if (responseCase_ == 1) { + return (com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) response_; + } + return com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.getDefaultInstance(); + } + /** + * + * + *
+   * The result of speech recognition.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResultOrBuilder + getRecognitionResultOrBuilder() { + if (responseCase_ == 1) { + return (com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) response_; + } + return com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.getDefaultInstance(); + } + + public static final int DETECT_INTENT_RESPONSE_FIELD_NUMBER = 2; + /** + * + * + *
+   * The response from detect intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + * + * @return Whether the detectIntentResponse field is set. + */ + @java.lang.Override + public boolean hasDetectIntentResponse() { + return responseCase_ == 2; + } + /** + * + * + *
+   * The response from detect intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + * + * @return The detectIntentResponse. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse getDetectIntentResponse() { + if (responseCase_ == 2) { + return (com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) response_; + } + return com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.getDefaultInstance(); + } + /** + * + * + *
+   * The response from detect intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseOrBuilder + getDetectIntentResponseOrBuilder() { + if (responseCase_ == 2) { + return (com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) response_; + } + return com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.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 (responseCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) response_); + } + if (responseCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) response_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (responseCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) response_); + } + if (responseCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) response_); + } + 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.dialogflow.cx.v3beta1.StreamingDetectIntentResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse) obj; + + if (!getResponseCase().equals(other.getResponseCase())) return false; + switch (responseCase_) { + case 1: + if (!getRecognitionResult().equals(other.getRecognitionResult())) return false; + break; + case 2: + if (!getDetectIntentResponse().equals(other.getDetectIntentResponse())) 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 (responseCase_) { + case 1: + hash = (37 * hash) + RECOGNITION_RESULT_FIELD_NUMBER; + hash = (53 * hash) + getRecognitionResult().hashCode(); + break; + case 2: + hash = (37 * hash) + DETECT_INTENT_RESPONSE_FIELD_NUMBER; + hash = (53 * hash) + getDetectIntentResponse().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse 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.dialogflow.cx.v3beta1.StreamingDetectIntentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse 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.dialogflow.cx.v3beta1.StreamingDetectIntentResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse 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.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + 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.dialogflow.cx.v3beta1.StreamingDetectIntentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse 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.dialogflow.cx.v3beta1.StreamingDetectIntentResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The top-level message returned from the `StreamingDetectIntent` method.
+   * Multiple response messages can be returned in order:
+   * 1.  If the input was set to streaming audio, the first one or more messages
+   *     contain `recognition_result`. Each `recognition_result` represents a more
+   *     complete transcript of what the user said. The last `recognition_result`
+   *     has `is_final` set to `true`.
+   * 2.  The last message contains `detect_intent_response`.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse) + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse.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(); + responseCase_ = 0; + response_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingDetectIntentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse(this); + if (responseCase_ == 1) { + if (recognitionResultBuilder_ == null) { + result.response_ = response_; + } else { + result.response_ = recognitionResultBuilder_.build(); + } + } + if (responseCase_ == 2) { + if (detectIntentResponseBuilder_ == null) { + result.response_ = response_; + } else { + result.response_ = detectIntentResponseBuilder_.build(); + } + } + result.responseCase_ = responseCase_; + 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.dialogflow.cx.v3beta1.StreamingDetectIntentResponse) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + .getDefaultInstance()) return this; + switch (other.getResponseCase()) { + case RECOGNITION_RESULT: + { + mergeRecognitionResult(other.getRecognitionResult()); + break; + } + case DETECT_INTENT_RESPONSE: + { + mergeDetectIntentResponse(other.getDetectIntentResponse()); + break; + } + case RESPONSE_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.dialogflow.cx.v3beta1.StreamingDetectIntentResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int responseCase_ = 0; + private java.lang.Object response_; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public Builder clearResponse() { + responseCase_ = 0; + response_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult, + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.Builder, + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResultOrBuilder> + recognitionResultBuilder_; + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + * + * @return Whether the recognitionResult field is set. + */ + @java.lang.Override + public boolean hasRecognitionResult() { + return responseCase_ == 1; + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + * + * @return The recognitionResult. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + getRecognitionResult() { + if (recognitionResultBuilder_ == null) { + if (responseCase_ == 1) { + return (com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) response_; + } + return com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + .getDefaultInstance(); + } else { + if (responseCase_ == 1) { + return recognitionResultBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + */ + public Builder setRecognitionResult( + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult value) { + if (recognitionResultBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + recognitionResultBuilder_.setMessage(value); + } + responseCase_ = 1; + return this; + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + */ + public Builder setRecognitionResult( + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.Builder builderForValue) { + if (recognitionResultBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + recognitionResultBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 1; + return this; + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + */ + public Builder mergeRecognitionResult( + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult value) { + if (recognitionResultBuilder_ == null) { + if (responseCase_ == 1 + && response_ + != com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + .getDefaultInstance()) { + response_ = + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 1) { + recognitionResultBuilder_.mergeFrom(value); + } + recognitionResultBuilder_.setMessage(value); + } + responseCase_ = 1; + return this; + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + */ + public Builder clearRecognitionResult() { + if (recognitionResultBuilder_ == null) { + if (responseCase_ == 1) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 1) { + responseCase_ = 0; + response_ = null; + } + recognitionResultBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.Builder + getRecognitionResultBuilder() { + return getRecognitionResultFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResultOrBuilder + getRecognitionResultOrBuilder() { + if ((responseCase_ == 1) && (recognitionResultBuilder_ != null)) { + return recognitionResultBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 1) { + return (com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) response_; + } + return com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult, + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.Builder, + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResultOrBuilder> + getRecognitionResultFieldBuilder() { + if (recognitionResultBuilder_ == null) { + if (!(responseCase_ == 1)) { + response_ = + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + .getDefaultInstance(); + } + recognitionResultBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult, + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.Builder, + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResultOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 1; + onChanged(); + ; + return recognitionResultBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse, + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.Builder, + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseOrBuilder> + detectIntentResponseBuilder_; + /** + * + * + *
+     * The response from detect intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + * + * @return Whether the detectIntentResponse field is set. + */ + @java.lang.Override + public boolean hasDetectIntentResponse() { + return responseCase_ == 2; + } + /** + * + * + *
+     * The response from detect intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + * + * @return The detectIntentResponse. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse getDetectIntentResponse() { + if (detectIntentResponseBuilder_ == null) { + if (responseCase_ == 2) { + return (com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) response_; + } + return com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.getDefaultInstance(); + } else { + if (responseCase_ == 2) { + return detectIntentResponseBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.getDefaultInstance(); + } + } + /** + * + * + *
+     * The response from detect intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + */ + public Builder setDetectIntentResponse( + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse value) { + if (detectIntentResponseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + detectIntentResponseBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + /** + * + * + *
+     * The response from detect intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + */ + public Builder setDetectIntentResponse( + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.Builder builderForValue) { + if (detectIntentResponseBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + detectIntentResponseBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 2; + return this; + } + /** + * + * + *
+     * The response from detect intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + */ + public Builder mergeDetectIntentResponse( + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse value) { + if (detectIntentResponseBuilder_ == null) { + if (responseCase_ == 2 + && response_ + != com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse + .getDefaultInstance()) { + response_ = + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 2) { + detectIntentResponseBuilder_.mergeFrom(value); + } + detectIntentResponseBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + /** + * + * + *
+     * The response from detect intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + */ + public Builder clearDetectIntentResponse() { + if (detectIntentResponseBuilder_ == null) { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + } + detectIntentResponseBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The response from detect intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.Builder + getDetectIntentResponseBuilder() { + return getDetectIntentResponseFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The response from detect intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseOrBuilder + getDetectIntentResponseOrBuilder() { + if ((responseCase_ == 2) && (detectIntentResponseBuilder_ != null)) { + return detectIntentResponseBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 2) { + return (com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) response_; + } + return com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.getDefaultInstance(); + } + } + /** + * + * + *
+     * The response from detect intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse, + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.Builder, + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseOrBuilder> + getDetectIntentResponseFieldBuilder() { + if (detectIntentResponseBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.getDefaultInstance(); + } + detectIntentResponseBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse, + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse.Builder, + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 2; + onChanged(); + ; + return detectIntentResponseBuilder_; + } + + @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.dialogflow.cx.v3beta1.StreamingDetectIntentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingDetectIntentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingDetectIntentResponse(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.dialogflow.cx.v3beta1.StreamingDetectIntentResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentResponseOrBuilder.java new file mode 100644 index 000000000..25c102448 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentResponseOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface StreamingDetectIntentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The result of speech recognition.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + * + * @return Whether the recognitionResult field is set. + */ + boolean hasRecognitionResult(); + /** + * + * + *
+   * The result of speech recognition.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + * + * @return The recognitionResult. + */ + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult getRecognitionResult(); + /** + * + * + *
+   * The result of speech recognition.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult recognition_result = 1; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResultOrBuilder + getRecognitionResultOrBuilder(); + + /** + * + * + *
+   * The response from detect intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + * + * @return Whether the detectIntentResponse field is set. + */ + boolean hasDetectIntentResponse(); + /** + * + * + *
+   * The response from detect intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + * + * @return The detectIntentResponse. + */ + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse getDetectIntentResponse(); + /** + * + * + *
+   * The response from detect intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detect_intent_response = 2; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponseOrBuilder + getDetectIntentResponseOrBuilder(); + + public com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse.ResponseCase + getResponseCase(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingRecognitionResult.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingRecognitionResult.java new file mode 100644 index 000000000..2b7cea14d --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingRecognitionResult.java @@ -0,0 +1,2248 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Contains a speech recognition result corresponding to a portion of the audio
+ * that is currently being processed or an indication that this is the end
+ * of the single requested utterance.
+ * Example:
+ * 1.  transcript: "tube"
+ * 2.  transcript: "to be a"
+ * 3.  transcript: "to be"
+ * 4.  transcript: "to be or not to be"
+ *     is_final: true
+ * 5.  transcript: " that's"
+ * 6.  transcript: " that is"
+ * 7.  message_type: `END_OF_SINGLE_UTTERANCE`
+ * 8.  transcript: " that is the question"
+ *     is_final: true
+ * Only two of the responses contain final results (#4 and #8 indicated by
+ * `is_final: true`). Concatenating these generates the full transcript: "to be
+ * or not to be that is the question".
+ * In each response we populate:
+ * *  for `TRANSCRIPT`: `transcript` and possibly `is_final`.
+ * *  for `END_OF_SINGLE_UTTERANCE`: only `message_type`.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult} + */ +public final class StreamingRecognitionResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) + StreamingRecognitionResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use StreamingRecognitionResult.newBuilder() to construct. + private StreamingRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingRecognitionResult() { + messageType_ = 0; + transcript_ = ""; + speechWordInfo_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingRecognitionResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StreamingRecognitionResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + messageType_ = rawValue; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + transcript_ = s; + break; + } + case 24: + { + isFinal_ = input.readBool(); + break; + } + case 37: + { + confidence_ = input.readFloat(); + break; + } + case 53: + { + stability_ = input.readFloat(); + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + speechWordInfo_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo>(); + mutable_bitField0_ |= 0x00000001; + } + speechWordInfo_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.parser(), + extensionRegistry)); + break; + } + case 66: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (speechEndOffset_ != null) { + subBuilder = speechEndOffset_.toBuilder(); + } + speechEndOffset_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(speechEndOffset_); + speechEndOffset_ = 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)) { + speechWordInfo_ = java.util.Collections.unmodifiableList(speechWordInfo_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingRecognitionResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingRecognitionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.class, + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.Builder.class); + } + + /** + * + * + *
+   * Type of the response message.
+   * 
+ * + * Protobuf enum {@code google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType} + */ + public enum MessageType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. Should never be used.
+     * 
+ * + * MESSAGE_TYPE_UNSPECIFIED = 0; + */ + MESSAGE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Message contains a (possibly partial) transcript.
+     * 
+ * + * TRANSCRIPT = 1; + */ + TRANSCRIPT(1), + /** + * + * + *
+     * Event indicates that the server has detected the end of the user's speech
+     * utterance and expects no additional speech. Therefore, the server will
+     * not process additional audio (although it may subsequently return
+     * additional results). The client should stop sending additional audio
+     * data, half-close the gRPC connection, and wait for any additional results
+     * until the server closes the gRPC connection. This message is only sent if
+     * [`single_utterance`][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.single_utterance] was set to
+     * `true`, and is not used otherwise.
+     * 
+ * + * END_OF_SINGLE_UTTERANCE = 2; + */ + END_OF_SINGLE_UTTERANCE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. Should never be used.
+     * 
+ * + * MESSAGE_TYPE_UNSPECIFIED = 0; + */ + public static final int MESSAGE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Message contains a (possibly partial) transcript.
+     * 
+ * + * TRANSCRIPT = 1; + */ + public static final int TRANSCRIPT_VALUE = 1; + /** + * + * + *
+     * Event indicates that the server has detected the end of the user's speech
+     * utterance and expects no additional speech. Therefore, the server will
+     * not process additional audio (although it may subsequently return
+     * additional results). The client should stop sending additional audio
+     * data, half-close the gRPC connection, and wait for any additional results
+     * until the server closes the gRPC connection. This message is only sent if
+     * [`single_utterance`][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.single_utterance] was set to
+     * `true`, and is not used otherwise.
+     * 
+ * + * END_OF_SINGLE_UTTERANCE = 2; + */ + public static final int END_OF_SINGLE_UTTERANCE_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MessageType 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 MessageType forNumber(int value) { + switch (value) { + case 0: + return MESSAGE_TYPE_UNSPECIFIED; + case 1: + return TRANSCRIPT; + case 2: + return END_OF_SINGLE_UTTERANCE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public MessageType findValueByNumber(int number) { + return MessageType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final MessageType[] VALUES = values(); + + public static MessageType 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 MessageType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType) + } + + public static final int MESSAGE_TYPE_FIELD_NUMBER = 1; + private int messageType_; + /** + * + * + *
+   * Type of the result message.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType message_type = 1; + * + * + * @return The enum numeric value on the wire for messageType. + */ + @java.lang.Override + public int getMessageTypeValue() { + return messageType_; + } + /** + * + * + *
+   * Type of the result message.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType message_type = 1; + * + * + * @return The messageType. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType + getMessageType() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType result = + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType.valueOf( + messageType_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType.UNRECOGNIZED + : result; + } + + public static final int TRANSCRIPT_FIELD_NUMBER = 2; + private volatile java.lang.Object transcript_; + /** + * + * + *
+   * Transcript text representing the words that the user spoke.
+   * Populated if and only if `message_type` = `TRANSCRIPT`.
+   * 
+ * + * string transcript = 2; + * + * @return The transcript. + */ + @java.lang.Override + public java.lang.String getTranscript() { + java.lang.Object ref = transcript_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + transcript_ = s; + return s; + } + } + /** + * + * + *
+   * Transcript text representing the words that the user spoke.
+   * Populated if and only if `message_type` = `TRANSCRIPT`.
+   * 
+ * + * string transcript = 2; + * + * @return The bytes for transcript. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTranscriptBytes() { + java.lang.Object ref = transcript_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + transcript_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IS_FINAL_FIELD_NUMBER = 3; + private boolean isFinal_; + /** + * + * + *
+   * If `false`, the `StreamingRecognitionResult` represents an
+   * interim result that may change. If `true`, the recognizer will not return
+   * any further hypotheses about this piece of the audio. May only be populated
+   * for `message_type` = `TRANSCRIPT`.
+   * 
+ * + * bool is_final = 3; + * + * @return The isFinal. + */ + @java.lang.Override + public boolean getIsFinal() { + return isFinal_; + } + + public static final int CONFIDENCE_FIELD_NUMBER = 4; + private float confidence_; + /** + * + * + *
+   * The Speech confidence between 0.0 and 1.0 for the current portion of audio.
+   * A higher number indicates an estimated greater likelihood that the
+   * recognized words are correct. The default of 0.0 is a sentinel value
+   * indicating that confidence was not set.
+   * This field is typically only provided if `is_final` is true and you should
+   * not rely on it being accurate or even set.
+   * 
+ * + * float confidence = 4; + * + * @return The confidence. + */ + @java.lang.Override + public float getConfidence() { + return confidence_; + } + + public static final int STABILITY_FIELD_NUMBER = 6; + private float stability_; + /** + * + * + *
+   * An estimate of the likelihood that the speech recognizer will
+   * not change its guess about this interim recognition result:
+   * * If the value is unspecified or 0.0, Dialogflow didn't compute the
+   *   stability. In particular, Dialogflow will only provide stability for
+   *   `TRANSCRIPT` results with `is_final = false`.
+   * * Otherwise, the value is in (0.0, 1.0] where 0.0 means completely
+   *   unstable and 1.0 means completely stable.
+   * 
+ * + * float stability = 6; + * + * @return The stability. + */ + @java.lang.Override + public float getStability() { + return stability_; + } + + public static final int SPEECH_WORD_INFO_FIELD_NUMBER = 7; + private java.util.List speechWordInfo_; + /** + * + * + *
+   * Word-specific information for the words recognized by Speech in
+   * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+   * [InputAudioConfig.enable_word_info] is set.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + */ + @java.lang.Override + public java.util.List + getSpeechWordInfoList() { + return speechWordInfo_; + } + /** + * + * + *
+   * Word-specific information for the words recognized by Speech in
+   * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+   * [InputAudioConfig.enable_word_info] is set.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + */ + @java.lang.Override + public java.util.List + getSpeechWordInfoOrBuilderList() { + return speechWordInfo_; + } + /** + * + * + *
+   * Word-specific information for the words recognized by Speech in
+   * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+   * [InputAudioConfig.enable_word_info] is set.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + */ + @java.lang.Override + public int getSpeechWordInfoCount() { + return speechWordInfo_.size(); + } + /** + * + * + *
+   * Word-specific information for the words recognized by Speech in
+   * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+   * [InputAudioConfig.enable_word_info] is set.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo getSpeechWordInfo(int index) { + return speechWordInfo_.get(index); + } + /** + * + * + *
+   * Word-specific information for the words recognized by Speech in
+   * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+   * [InputAudioConfig.enable_word_info] is set.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfoOrBuilder getSpeechWordInfoOrBuilder( + int index) { + return speechWordInfo_.get(index); + } + + public static final int SPEECH_END_OFFSET_FIELD_NUMBER = 8; + private com.google.protobuf.Duration speechEndOffset_; + /** + * + * + *
+   * Time offset of the end of this Speech recognition result relative to the
+   * beginning of the audio. Only populated for `message_type` =
+   * `TRANSCRIPT`.
+   * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + * + * @return Whether the speechEndOffset field is set. + */ + @java.lang.Override + public boolean hasSpeechEndOffset() { + return speechEndOffset_ != null; + } + /** + * + * + *
+   * Time offset of the end of this Speech recognition result relative to the
+   * beginning of the audio. Only populated for `message_type` =
+   * `TRANSCRIPT`.
+   * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + * + * @return The speechEndOffset. + */ + @java.lang.Override + public com.google.protobuf.Duration getSpeechEndOffset() { + return speechEndOffset_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : speechEndOffset_; + } + /** + * + * + *
+   * Time offset of the end of this Speech recognition result relative to the
+   * beginning of the audio. Only populated for `message_type` =
+   * `TRANSCRIPT`.
+   * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getSpeechEndOffsetOrBuilder() { + return getSpeechEndOffset(); + } + + 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 (messageType_ + != com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType + .MESSAGE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, messageType_); + } + if (!getTranscriptBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, transcript_); + } + if (isFinal_ != false) { + output.writeBool(3, isFinal_); + } + if (confidence_ != 0F) { + output.writeFloat(4, confidence_); + } + if (stability_ != 0F) { + output.writeFloat(6, stability_); + } + for (int i = 0; i < speechWordInfo_.size(); i++) { + output.writeMessage(7, speechWordInfo_.get(i)); + } + if (speechEndOffset_ != null) { + output.writeMessage(8, getSpeechEndOffset()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (messageType_ + != com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType + .MESSAGE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, messageType_); + } + if (!getTranscriptBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, transcript_); + } + if (isFinal_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, isFinal_); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, confidence_); + } + if (stability_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(6, stability_); + } + for (int i = 0; i < speechWordInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, speechWordInfo_.get(i)); + } + if (speechEndOffset_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSpeechEndOffset()); + } + 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.dialogflow.cx.v3beta1.StreamingRecognitionResult)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult other = + (com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) obj; + + if (messageType_ != other.messageType_) return false; + if (!getTranscript().equals(other.getTranscript())) return false; + if (getIsFinal() != other.getIsFinal()) return false; + if (java.lang.Float.floatToIntBits(getConfidence()) + != java.lang.Float.floatToIntBits(other.getConfidence())) return false; + if (java.lang.Float.floatToIntBits(getStability()) + != java.lang.Float.floatToIntBits(other.getStability())) return false; + if (!getSpeechWordInfoList().equals(other.getSpeechWordInfoList())) return false; + if (hasSpeechEndOffset() != other.hasSpeechEndOffset()) return false; + if (hasSpeechEndOffset()) { + if (!getSpeechEndOffset().equals(other.getSpeechEndOffset())) 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) + MESSAGE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + messageType_; + hash = (37 * hash) + TRANSCRIPT_FIELD_NUMBER; + hash = (53 * hash) + getTranscript().hashCode(); + hash = (37 * hash) + IS_FINAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsFinal()); + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); + hash = (37 * hash) + STABILITY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getStability()); + if (getSpeechWordInfoCount() > 0) { + hash = (37 * hash) + SPEECH_WORD_INFO_FIELD_NUMBER; + hash = (53 * hash) + getSpeechWordInfoList().hashCode(); + } + if (hasSpeechEndOffset()) { + hash = (37 * hash) + SPEECH_END_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getSpeechEndOffset().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Contains a speech recognition result corresponding to a portion of the audio
+   * that is currently being processed or an indication that this is the end
+   * of the single requested utterance.
+   * Example:
+   * 1.  transcript: "tube"
+   * 2.  transcript: "to be a"
+   * 3.  transcript: "to be"
+   * 4.  transcript: "to be or not to be"
+   *     is_final: true
+   * 5.  transcript: " that's"
+   * 6.  transcript: " that is"
+   * 7.  message_type: `END_OF_SINGLE_UTTERANCE`
+   * 8.  transcript: " that is the question"
+   *     is_final: true
+   * Only two of the responses contain final results (#4 and #8 indicated by
+   * `is_final: true`). Concatenating these generates the full transcript: "to be
+   * or not to be that is the question".
+   * In each response we populate:
+   * *  for `TRANSCRIPT`: `transcript` and possibly `is_final`.
+   * *  for `END_OF_SINGLE_UTTERANCE`: only `message_type`.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingRecognitionResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingRecognitionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.class, + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSpeechWordInfoFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + messageType_ = 0; + + transcript_ = ""; + + isFinal_ = false; + + confidence_ = 0F; + + stability_ = 0F; + + if (speechWordInfoBuilder_ == null) { + speechWordInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + speechWordInfoBuilder_.clear(); + } + if (speechEndOffsetBuilder_ == null) { + speechEndOffset_ = null; + } else { + speechEndOffset_ = null; + speechEndOffsetBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_StreamingRecognitionResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult build() { + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult result = + new com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult(this); + int from_bitField0_ = bitField0_; + result.messageType_ = messageType_; + result.transcript_ = transcript_; + result.isFinal_ = isFinal_; + result.confidence_ = confidence_; + result.stability_ = stability_; + if (speechWordInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + speechWordInfo_ = java.util.Collections.unmodifiableList(speechWordInfo_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.speechWordInfo_ = speechWordInfo_; + } else { + result.speechWordInfo_ = speechWordInfoBuilder_.build(); + } + if (speechEndOffsetBuilder_ == null) { + result.speechEndOffset_ = speechEndOffset_; + } else { + result.speechEndOffset_ = speechEndOffsetBuilder_.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.dialogflow.cx.v3beta1.StreamingRecognitionResult) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.getDefaultInstance()) + return this; + if (other.messageType_ != 0) { + setMessageTypeValue(other.getMessageTypeValue()); + } + if (!other.getTranscript().isEmpty()) { + transcript_ = other.transcript_; + onChanged(); + } + if (other.getIsFinal() != false) { + setIsFinal(other.getIsFinal()); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + if (other.getStability() != 0F) { + setStability(other.getStability()); + } + if (speechWordInfoBuilder_ == null) { + if (!other.speechWordInfo_.isEmpty()) { + if (speechWordInfo_.isEmpty()) { + speechWordInfo_ = other.speechWordInfo_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSpeechWordInfoIsMutable(); + speechWordInfo_.addAll(other.speechWordInfo_); + } + onChanged(); + } + } else { + if (!other.speechWordInfo_.isEmpty()) { + if (speechWordInfoBuilder_.isEmpty()) { + speechWordInfoBuilder_.dispose(); + speechWordInfoBuilder_ = null; + speechWordInfo_ = other.speechWordInfo_; + bitField0_ = (bitField0_ & ~0x00000001); + speechWordInfoBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSpeechWordInfoFieldBuilder() + : null; + } else { + speechWordInfoBuilder_.addAllMessages(other.speechWordInfo_); + } + } + } + if (other.hasSpeechEndOffset()) { + mergeSpeechEndOffset(other.getSpeechEndOffset()); + } + 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.dialogflow.cx.v3beta1.StreamingRecognitionResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int messageType_ = 0; + /** + * + * + *
+     * Type of the result message.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType message_type = 1; + * + * + * @return The enum numeric value on the wire for messageType. + */ + @java.lang.Override + public int getMessageTypeValue() { + return messageType_; + } + /** + * + * + *
+     * Type of the result message.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType message_type = 1; + * + * + * @param value The enum numeric value on the wire for messageType to set. + * @return This builder for chaining. + */ + public Builder setMessageTypeValue(int value) { + + messageType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Type of the result message.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType message_type = 1; + * + * + * @return The messageType. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType + getMessageType() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType result = + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType.valueOf( + messageType_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Type of the result message.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType message_type = 1; + * + * + * @param value The messageType to set. + * @return This builder for chaining. + */ + public Builder setMessageType( + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType value) { + if (value == null) { + throw new NullPointerException(); + } + + messageType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of the result message.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType message_type = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearMessageType() { + + messageType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object transcript_ = ""; + /** + * + * + *
+     * Transcript text representing the words that the user spoke.
+     * Populated if and only if `message_type` = `TRANSCRIPT`.
+     * 
+ * + * string transcript = 2; + * + * @return The transcript. + */ + public java.lang.String getTranscript() { + java.lang.Object ref = transcript_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + transcript_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Transcript text representing the words that the user spoke.
+     * Populated if and only if `message_type` = `TRANSCRIPT`.
+     * 
+ * + * string transcript = 2; + * + * @return The bytes for transcript. + */ + public com.google.protobuf.ByteString getTranscriptBytes() { + java.lang.Object ref = transcript_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + transcript_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Transcript text representing the words that the user spoke.
+     * Populated if and only if `message_type` = `TRANSCRIPT`.
+     * 
+ * + * string transcript = 2; + * + * @param value The transcript to set. + * @return This builder for chaining. + */ + public Builder setTranscript(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + transcript_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Transcript text representing the words that the user spoke.
+     * Populated if and only if `message_type` = `TRANSCRIPT`.
+     * 
+ * + * string transcript = 2; + * + * @return This builder for chaining. + */ + public Builder clearTranscript() { + + transcript_ = getDefaultInstance().getTranscript(); + onChanged(); + return this; + } + /** + * + * + *
+     * Transcript text representing the words that the user spoke.
+     * Populated if and only if `message_type` = `TRANSCRIPT`.
+     * 
+ * + * string transcript = 2; + * + * @param value The bytes for transcript to set. + * @return This builder for chaining. + */ + public Builder setTranscriptBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + transcript_ = value; + onChanged(); + return this; + } + + private boolean isFinal_; + /** + * + * + *
+     * If `false`, the `StreamingRecognitionResult` represents an
+     * interim result that may change. If `true`, the recognizer will not return
+     * any further hypotheses about this piece of the audio. May only be populated
+     * for `message_type` = `TRANSCRIPT`.
+     * 
+ * + * bool is_final = 3; + * + * @return The isFinal. + */ + @java.lang.Override + public boolean getIsFinal() { + return isFinal_; + } + /** + * + * + *
+     * If `false`, the `StreamingRecognitionResult` represents an
+     * interim result that may change. If `true`, the recognizer will not return
+     * any further hypotheses about this piece of the audio. May only be populated
+     * for `message_type` = `TRANSCRIPT`.
+     * 
+ * + * bool is_final = 3; + * + * @param value The isFinal to set. + * @return This builder for chaining. + */ + public Builder setIsFinal(boolean value) { + + isFinal_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If `false`, the `StreamingRecognitionResult` represents an
+     * interim result that may change. If `true`, the recognizer will not return
+     * any further hypotheses about this piece of the audio. May only be populated
+     * for `message_type` = `TRANSCRIPT`.
+     * 
+ * + * bool is_final = 3; + * + * @return This builder for chaining. + */ + public Builder clearIsFinal() { + + isFinal_ = false; + onChanged(); + return this; + } + + private float confidence_; + /** + * + * + *
+     * The Speech confidence between 0.0 and 1.0 for the current portion of audio.
+     * A higher number indicates an estimated greater likelihood that the
+     * recognized words are correct. The default of 0.0 is a sentinel value
+     * indicating that confidence was not set.
+     * This field is typically only provided if `is_final` is true and you should
+     * not rely on it being accurate or even set.
+     * 
+ * + * float confidence = 4; + * + * @return The confidence. + */ + @java.lang.Override + public float getConfidence() { + return confidence_; + } + /** + * + * + *
+     * The Speech confidence between 0.0 and 1.0 for the current portion of audio.
+     * A higher number indicates an estimated greater likelihood that the
+     * recognized words are correct. The default of 0.0 is a sentinel value
+     * indicating that confidence was not set.
+     * This field is typically only provided if `is_final` is true and you should
+     * not rely on it being accurate or even set.
+     * 
+ * + * float confidence = 4; + * + * @param value The confidence to set. + * @return This builder for chaining. + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Speech confidence between 0.0 and 1.0 for the current portion of audio.
+     * A higher number indicates an estimated greater likelihood that the
+     * recognized words are correct. The default of 0.0 is a sentinel value
+     * indicating that confidence was not set.
+     * This field is typically only provided if `is_final` is true and you should
+     * not rely on it being accurate or even set.
+     * 
+ * + * float confidence = 4; + * + * @return This builder for chaining. + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + + private float stability_; + /** + * + * + *
+     * An estimate of the likelihood that the speech recognizer will
+     * not change its guess about this interim recognition result:
+     * * If the value is unspecified or 0.0, Dialogflow didn't compute the
+     *   stability. In particular, Dialogflow will only provide stability for
+     *   `TRANSCRIPT` results with `is_final = false`.
+     * * Otherwise, the value is in (0.0, 1.0] where 0.0 means completely
+     *   unstable and 1.0 means completely stable.
+     * 
+ * + * float stability = 6; + * + * @return The stability. + */ + @java.lang.Override + public float getStability() { + return stability_; + } + /** + * + * + *
+     * An estimate of the likelihood that the speech recognizer will
+     * not change its guess about this interim recognition result:
+     * * If the value is unspecified or 0.0, Dialogflow didn't compute the
+     *   stability. In particular, Dialogflow will only provide stability for
+     *   `TRANSCRIPT` results with `is_final = false`.
+     * * Otherwise, the value is in (0.0, 1.0] where 0.0 means completely
+     *   unstable and 1.0 means completely stable.
+     * 
+ * + * float stability = 6; + * + * @param value The stability to set. + * @return This builder for chaining. + */ + public Builder setStability(float value) { + + stability_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An estimate of the likelihood that the speech recognizer will
+     * not change its guess about this interim recognition result:
+     * * If the value is unspecified or 0.0, Dialogflow didn't compute the
+     *   stability. In particular, Dialogflow will only provide stability for
+     *   `TRANSCRIPT` results with `is_final = false`.
+     * * Otherwise, the value is in (0.0, 1.0] where 0.0 means completely
+     *   unstable and 1.0 means completely stable.
+     * 
+ * + * float stability = 6; + * + * @return This builder for chaining. + */ + public Builder clearStability() { + + stability_ = 0F; + onChanged(); + return this; + } + + private java.util.List speechWordInfo_ = + java.util.Collections.emptyList(); + + private void ensureSpeechWordInfoIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + speechWordInfo_ = + new java.util.ArrayList( + speechWordInfo_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo, + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfoOrBuilder> + speechWordInfoBuilder_; + + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public java.util.List + getSpeechWordInfoList() { + if (speechWordInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(speechWordInfo_); + } else { + return speechWordInfoBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public int getSpeechWordInfoCount() { + if (speechWordInfoBuilder_ == null) { + return speechWordInfo_.size(); + } else { + return speechWordInfoBuilder_.getCount(); + } + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo getSpeechWordInfo(int index) { + if (speechWordInfoBuilder_ == null) { + return speechWordInfo_.get(index); + } else { + return speechWordInfoBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public Builder setSpeechWordInfo( + int index, com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo value) { + if (speechWordInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeechWordInfoIsMutable(); + speechWordInfo_.set(index, value); + onChanged(); + } else { + speechWordInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public Builder setSpeechWordInfo( + int index, com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.Builder builderForValue) { + if (speechWordInfoBuilder_ == null) { + ensureSpeechWordInfoIsMutable(); + speechWordInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + speechWordInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public Builder addSpeechWordInfo(com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo value) { + if (speechWordInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeechWordInfoIsMutable(); + speechWordInfo_.add(value); + onChanged(); + } else { + speechWordInfoBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public Builder addSpeechWordInfo( + int index, com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo value) { + if (speechWordInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeechWordInfoIsMutable(); + speechWordInfo_.add(index, value); + onChanged(); + } else { + speechWordInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public Builder addSpeechWordInfo( + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.Builder builderForValue) { + if (speechWordInfoBuilder_ == null) { + ensureSpeechWordInfoIsMutable(); + speechWordInfo_.add(builderForValue.build()); + onChanged(); + } else { + speechWordInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public Builder addSpeechWordInfo( + int index, com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.Builder builderForValue) { + if (speechWordInfoBuilder_ == null) { + ensureSpeechWordInfoIsMutable(); + speechWordInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + speechWordInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public Builder addAllSpeechWordInfo( + java.lang.Iterable + values) { + if (speechWordInfoBuilder_ == null) { + ensureSpeechWordInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, speechWordInfo_); + onChanged(); + } else { + speechWordInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public Builder clearSpeechWordInfo() { + if (speechWordInfoBuilder_ == null) { + speechWordInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + speechWordInfoBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public Builder removeSpeechWordInfo(int index) { + if (speechWordInfoBuilder_ == null) { + ensureSpeechWordInfoIsMutable(); + speechWordInfo_.remove(index); + onChanged(); + } else { + speechWordInfoBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.Builder getSpeechWordInfoBuilder( + int index) { + return getSpeechWordInfoFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfoOrBuilder + getSpeechWordInfoOrBuilder(int index) { + if (speechWordInfoBuilder_ == null) { + return speechWordInfo_.get(index); + } else { + return speechWordInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public java.util.List + getSpeechWordInfoOrBuilderList() { + if (speechWordInfoBuilder_ != null) { + return speechWordInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(speechWordInfo_); + } + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.Builder + addSpeechWordInfoBuilder() { + return getSpeechWordInfoFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.getDefaultInstance()); + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.Builder addSpeechWordInfoBuilder( + int index) { + return getSpeechWordInfoFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.getDefaultInstance()); + } + /** + * + * + *
+     * Word-specific information for the words recognized by Speech in
+     * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+     * [InputAudioConfig.enable_word_info] is set.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + * + */ + public java.util.List + getSpeechWordInfoBuilderList() { + return getSpeechWordInfoFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo, + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfoOrBuilder> + getSpeechWordInfoFieldBuilder() { + if (speechWordInfoBuilder_ == null) { + speechWordInfoBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo, + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfoOrBuilder>( + speechWordInfo_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + speechWordInfo_ = null; + } + return speechWordInfoBuilder_; + } + + private com.google.protobuf.Duration speechEndOffset_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + speechEndOffsetBuilder_; + /** + * + * + *
+     * Time offset of the end of this Speech recognition result relative to the
+     * beginning of the audio. Only populated for `message_type` =
+     * `TRANSCRIPT`.
+     * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + * + * @return Whether the speechEndOffset field is set. + */ + public boolean hasSpeechEndOffset() { + return speechEndOffsetBuilder_ != null || speechEndOffset_ != null; + } + /** + * + * + *
+     * Time offset of the end of this Speech recognition result relative to the
+     * beginning of the audio. Only populated for `message_type` =
+     * `TRANSCRIPT`.
+     * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + * + * @return The speechEndOffset. + */ + public com.google.protobuf.Duration getSpeechEndOffset() { + if (speechEndOffsetBuilder_ == null) { + return speechEndOffset_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : speechEndOffset_; + } else { + return speechEndOffsetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time offset of the end of this Speech recognition result relative to the
+     * beginning of the audio. Only populated for `message_type` =
+     * `TRANSCRIPT`.
+     * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + */ + public Builder setSpeechEndOffset(com.google.protobuf.Duration value) { + if (speechEndOffsetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + speechEndOffset_ = value; + onChanged(); + } else { + speechEndOffsetBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time offset of the end of this Speech recognition result relative to the
+     * beginning of the audio. Only populated for `message_type` =
+     * `TRANSCRIPT`.
+     * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + */ + public Builder setSpeechEndOffset(com.google.protobuf.Duration.Builder builderForValue) { + if (speechEndOffsetBuilder_ == null) { + speechEndOffset_ = builderForValue.build(); + onChanged(); + } else { + speechEndOffsetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time offset of the end of this Speech recognition result relative to the
+     * beginning of the audio. Only populated for `message_type` =
+     * `TRANSCRIPT`.
+     * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + */ + public Builder mergeSpeechEndOffset(com.google.protobuf.Duration value) { + if (speechEndOffsetBuilder_ == null) { + if (speechEndOffset_ != null) { + speechEndOffset_ = + com.google.protobuf.Duration.newBuilder(speechEndOffset_) + .mergeFrom(value) + .buildPartial(); + } else { + speechEndOffset_ = value; + } + onChanged(); + } else { + speechEndOffsetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time offset of the end of this Speech recognition result relative to the
+     * beginning of the audio. Only populated for `message_type` =
+     * `TRANSCRIPT`.
+     * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + */ + public Builder clearSpeechEndOffset() { + if (speechEndOffsetBuilder_ == null) { + speechEndOffset_ = null; + onChanged(); + } else { + speechEndOffset_ = null; + speechEndOffsetBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time offset of the end of this Speech recognition result relative to the
+     * beginning of the audio. Only populated for `message_type` =
+     * `TRANSCRIPT`.
+     * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + */ + public com.google.protobuf.Duration.Builder getSpeechEndOffsetBuilder() { + + onChanged(); + return getSpeechEndOffsetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time offset of the end of this Speech recognition result relative to the
+     * beginning of the audio. Only populated for `message_type` =
+     * `TRANSCRIPT`.
+     * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + */ + public com.google.protobuf.DurationOrBuilder getSpeechEndOffsetOrBuilder() { + if (speechEndOffsetBuilder_ != null) { + return speechEndOffsetBuilder_.getMessageOrBuilder(); + } else { + return speechEndOffset_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : speechEndOffset_; + } + } + /** + * + * + *
+     * Time offset of the end of this Speech recognition result relative to the
+     * beginning of the audio. Only populated for `message_type` =
+     * `TRANSCRIPT`.
+     * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getSpeechEndOffsetFieldBuilder() { + if (speechEndOffsetBuilder_ == null) { + speechEndOffsetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getSpeechEndOffset(), getParentForChildren(), isClean()); + speechEndOffset_ = null; + } + return speechEndOffsetBuilder_; + } + + @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.dialogflow.cx.v3beta1.StreamingRecognitionResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) + private static final com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingRecognitionResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingRecognitionResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingRecognitionResultOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingRecognitionResultOrBuilder.java new file mode 100644 index 000000000..c661fa7cb --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingRecognitionResultOrBuilder.java @@ -0,0 +1,238 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface StreamingRecognitionResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Type of the result message.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType message_type = 1; + * + * + * @return The enum numeric value on the wire for messageType. + */ + int getMessageTypeValue(); + /** + * + * + *
+   * Type of the result message.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType message_type = 1; + * + * + * @return The messageType. + */ + com.google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.MessageType getMessageType(); + + /** + * + * + *
+   * Transcript text representing the words that the user spoke.
+   * Populated if and only if `message_type` = `TRANSCRIPT`.
+   * 
+ * + * string transcript = 2; + * + * @return The transcript. + */ + java.lang.String getTranscript(); + /** + * + * + *
+   * Transcript text representing the words that the user spoke.
+   * Populated if and only if `message_type` = `TRANSCRIPT`.
+   * 
+ * + * string transcript = 2; + * + * @return The bytes for transcript. + */ + com.google.protobuf.ByteString getTranscriptBytes(); + + /** + * + * + *
+   * If `false`, the `StreamingRecognitionResult` represents an
+   * interim result that may change. If `true`, the recognizer will not return
+   * any further hypotheses about this piece of the audio. May only be populated
+   * for `message_type` = `TRANSCRIPT`.
+   * 
+ * + * bool is_final = 3; + * + * @return The isFinal. + */ + boolean getIsFinal(); + + /** + * + * + *
+   * The Speech confidence between 0.0 and 1.0 for the current portion of audio.
+   * A higher number indicates an estimated greater likelihood that the
+   * recognized words are correct. The default of 0.0 is a sentinel value
+   * indicating that confidence was not set.
+   * This field is typically only provided if `is_final` is true and you should
+   * not rely on it being accurate or even set.
+   * 
+ * + * float confidence = 4; + * + * @return The confidence. + */ + float getConfidence(); + + /** + * + * + *
+   * An estimate of the likelihood that the speech recognizer will
+   * not change its guess about this interim recognition result:
+   * * If the value is unspecified or 0.0, Dialogflow didn't compute the
+   *   stability. In particular, Dialogflow will only provide stability for
+   *   `TRANSCRIPT` results with `is_final = false`.
+   * * Otherwise, the value is in (0.0, 1.0] where 0.0 means completely
+   *   unstable and 1.0 means completely stable.
+   * 
+ * + * float stability = 6; + * + * @return The stability. + */ + float getStability(); + + /** + * + * + *
+   * Word-specific information for the words recognized by Speech in
+   * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+   * [InputAudioConfig.enable_word_info] is set.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + */ + java.util.List getSpeechWordInfoList(); + /** + * + * + *
+   * Word-specific information for the words recognized by Speech in
+   * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+   * [InputAudioConfig.enable_word_info] is set.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + */ + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo getSpeechWordInfo(int index); + /** + * + * + *
+   * Word-specific information for the words recognized by Speech in
+   * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+   * [InputAudioConfig.enable_word_info] is set.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + */ + int getSpeechWordInfoCount(); + /** + * + * + *
+   * Word-specific information for the words recognized by Speech in
+   * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+   * [InputAudioConfig.enable_word_info] is set.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + */ + java.util.List + getSpeechWordInfoOrBuilderList(); + /** + * + * + *
+   * Word-specific information for the words recognized by Speech in
+   * [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
+   * [InputAudioConfig.enable_word_info] is set.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo speech_word_info = 7; + */ + com.google.cloud.dialogflow.cx.v3beta1.SpeechWordInfoOrBuilder getSpeechWordInfoOrBuilder( + int index); + + /** + * + * + *
+   * Time offset of the end of this Speech recognition result relative to the
+   * beginning of the audio. Only populated for `message_type` =
+   * `TRANSCRIPT`.
+   * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + * + * @return Whether the speechEndOffset field is set. + */ + boolean hasSpeechEndOffset(); + /** + * + * + *
+   * Time offset of the end of this Speech recognition result relative to the
+   * beginning of the audio. Only populated for `message_type` =
+   * `TRANSCRIPT`.
+   * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + * + * @return The speechEndOffset. + */ + com.google.protobuf.Duration getSpeechEndOffset(); + /** + * + * + *
+   * Time offset of the end of this Speech recognition result relative to the
+   * beginning of the audio. Only populated for `message_type` =
+   * `TRANSCRIPT`.
+   * 
+ * + * .google.protobuf.Duration speech_end_offset = 8; + */ + com.google.protobuf.DurationOrBuilder getSpeechEndOffsetOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SynthesizeSpeechConfig.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SynthesizeSpeechConfig.java new file mode 100644 index 000000000..17482bf49 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SynthesizeSpeechConfig.java @@ -0,0 +1,1377 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Configuration of how speech should be synthesized.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig} + */ +public final class SynthesizeSpeechConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig) + SynthesizeSpeechConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use SynthesizeSpeechConfig.newBuilder() to construct. + private SynthesizeSpeechConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SynthesizeSpeechConfig() { + effectsProfileId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SynthesizeSpeechConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SynthesizeSpeechConfig( + 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 9: + { + speakingRate_ = input.readDouble(); + break; + } + case 17: + { + pitch_ = input.readDouble(); + break; + } + case 25: + { + volumeGainDb_ = input.readDouble(); + break; + } + case 34: + { + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.Builder subBuilder = null; + if (voice_ != null) { + subBuilder = voice_.toBuilder(); + } + voice_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(voice_); + voice_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + effectsProfileId_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + effectsProfileId_.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)) { + effectsProfileId_ = effectsProfileId_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SynthesizeSpeechConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SynthesizeSpeechConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.class, + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.Builder.class); + } + + public static final int SPEAKING_RATE_FIELD_NUMBER = 1; + private double speakingRate_; + /** + * + * + *
+   * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal
+   * native speed supported by the specific voice. 2.0 is twice as fast, and
+   * 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any
+   * other values < 0.25 or > 4.0 will return an error.
+   * 
+ * + * double speaking_rate = 1; + * + * @return The speakingRate. + */ + @java.lang.Override + public double getSpeakingRate() { + return speakingRate_; + } + + public static final int PITCH_FIELD_NUMBER = 2; + private double pitch_; + /** + * + * + *
+   * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20
+   * semitones from the original pitch. -20 means decrease 20 semitones from the
+   * original pitch.
+   * 
+ * + * double pitch = 2; + * + * @return The pitch. + */ + @java.lang.Override + public double getPitch() { + return pitch_; + } + + public static final int VOLUME_GAIN_DB_FIELD_NUMBER = 3; + private double volumeGainDb_; + /** + * + * + *
+   * Optional. Volume gain (in dB) of the normal native volume supported by the
+   * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of
+   * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB)
+   * will play at approximately half the amplitude of the normal native signal
+   * amplitude. A value of +6.0 (dB) will play at approximately twice the
+   * amplitude of the normal native signal amplitude. We strongly recommend not
+   * to exceed +10 (dB) as there's usually no effective increase in loudness for
+   * any value greater than that.
+   * 
+ * + * double volume_gain_db = 3; + * + * @return The volumeGainDb. + */ + @java.lang.Override + public double getVolumeGainDb() { + return volumeGainDb_; + } + + public static final int EFFECTS_PROFILE_ID_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList effectsProfileId_; + /** + * + * + *
+   * Optional. An identifier which selects 'audio effects' profiles that are
+   * applied on (post synthesized) text to speech. Effects are applied on top of
+   * each other in the order they are given.
+   * 
+ * + * repeated string effects_profile_id = 5; + * + * @return A list containing the effectsProfileId. + */ + public com.google.protobuf.ProtocolStringList getEffectsProfileIdList() { + return effectsProfileId_; + } + /** + * + * + *
+   * Optional. An identifier which selects 'audio effects' profiles that are
+   * applied on (post synthesized) text to speech. Effects are applied on top of
+   * each other in the order they are given.
+   * 
+ * + * repeated string effects_profile_id = 5; + * + * @return The count of effectsProfileId. + */ + public int getEffectsProfileIdCount() { + return effectsProfileId_.size(); + } + /** + * + * + *
+   * Optional. An identifier which selects 'audio effects' profiles that are
+   * applied on (post synthesized) text to speech. Effects are applied on top of
+   * each other in the order they are given.
+   * 
+ * + * repeated string effects_profile_id = 5; + * + * @param index The index of the element to return. + * @return The effectsProfileId at the given index. + */ + public java.lang.String getEffectsProfileId(int index) { + return effectsProfileId_.get(index); + } + /** + * + * + *
+   * Optional. An identifier which selects 'audio effects' profiles that are
+   * applied on (post synthesized) text to speech. Effects are applied on top of
+   * each other in the order they are given.
+   * 
+ * + * repeated string effects_profile_id = 5; + * + * @param index The index of the value to return. + * @return The bytes of the effectsProfileId at the given index. + */ + public com.google.protobuf.ByteString getEffectsProfileIdBytes(int index) { + return effectsProfileId_.getByteString(index); + } + + public static final int VOICE_FIELD_NUMBER = 4; + private com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice_; + /** + * + * + *
+   * Optional. The desired voice of the synthesized audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + * + * @return Whether the voice field is set. + */ + @java.lang.Override + public boolean hasVoice() { + return voice_ != null; + } + /** + * + * + *
+   * Optional. The desired voice of the synthesized audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + * + * @return The voice. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams getVoice() { + return voice_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.getDefaultInstance() + : voice_; + } + /** + * + * + *
+   * Optional. The desired voice of the synthesized audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParamsOrBuilder getVoiceOrBuilder() { + return getVoice(); + } + + 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 (speakingRate_ != 0D) { + output.writeDouble(1, speakingRate_); + } + if (pitch_ != 0D) { + output.writeDouble(2, pitch_); + } + if (volumeGainDb_ != 0D) { + output.writeDouble(3, volumeGainDb_); + } + if (voice_ != null) { + output.writeMessage(4, getVoice()); + } + for (int i = 0; i < effectsProfileId_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, effectsProfileId_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (speakingRate_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, speakingRate_); + } + if (pitch_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, pitch_); + } + if (volumeGainDb_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(3, volumeGainDb_); + } + if (voice_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getVoice()); + } + { + int dataSize = 0; + for (int i = 0; i < effectsProfileId_.size(); i++) { + dataSize += computeStringSizeNoTag(effectsProfileId_.getRaw(i)); + } + size += dataSize; + size += 1 * getEffectsProfileIdList().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.dialogflow.cx.v3beta1.SynthesizeSpeechConfig)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig other = + (com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig) obj; + + if (java.lang.Double.doubleToLongBits(getSpeakingRate()) + != java.lang.Double.doubleToLongBits(other.getSpeakingRate())) return false; + if (java.lang.Double.doubleToLongBits(getPitch()) + != java.lang.Double.doubleToLongBits(other.getPitch())) return false; + if (java.lang.Double.doubleToLongBits(getVolumeGainDb()) + != java.lang.Double.doubleToLongBits(other.getVolumeGainDb())) return false; + if (!getEffectsProfileIdList().equals(other.getEffectsProfileIdList())) return false; + if (hasVoice() != other.hasVoice()) return false; + if (hasVoice()) { + if (!getVoice().equals(other.getVoice())) 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) + SPEAKING_RATE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getSpeakingRate())); + hash = (37 * hash) + PITCH_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getPitch())); + hash = (37 * hash) + VOLUME_GAIN_DB_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getVolumeGainDb())); + if (getEffectsProfileIdCount() > 0) { + hash = (37 * hash) + EFFECTS_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getEffectsProfileIdList().hashCode(); + } + if (hasVoice()) { + hash = (37 * hash) + VOICE_FIELD_NUMBER; + hash = (53 * hash) + getVoice().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig 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.dialogflow.cx.v3beta1.SynthesizeSpeechConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig 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.dialogflow.cx.v3beta1.SynthesizeSpeechConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig 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.dialogflow.cx.v3beta1.SynthesizeSpeechConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig 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.dialogflow.cx.v3beta1.SynthesizeSpeechConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig 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.dialogflow.cx.v3beta1.SynthesizeSpeechConfig 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 how speech should be synthesized.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig) + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SynthesizeSpeechConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SynthesizeSpeechConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.class, + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.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(); + speakingRate_ = 0D; + + pitch_ = 0D; + + volumeGainDb_ = 0D; + + effectsProfileId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (voiceBuilder_ == null) { + voice_ = null; + } else { + voice_ = null; + voiceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_SynthesizeSpeechConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig build() { + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig result = + new com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig(this); + int from_bitField0_ = bitField0_; + result.speakingRate_ = speakingRate_; + result.pitch_ = pitch_; + result.volumeGainDb_ = volumeGainDb_; + if (((bitField0_ & 0x00000001) != 0)) { + effectsProfileId_ = effectsProfileId_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.effectsProfileId_ = effectsProfileId_; + if (voiceBuilder_ == null) { + result.voice_ = voice_; + } else { + result.voice_ = voiceBuilder_.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.dialogflow.cx.v3beta1.SynthesizeSpeechConfig) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig.getDefaultInstance()) + return this; + if (other.getSpeakingRate() != 0D) { + setSpeakingRate(other.getSpeakingRate()); + } + if (other.getPitch() != 0D) { + setPitch(other.getPitch()); + } + if (other.getVolumeGainDb() != 0D) { + setVolumeGainDb(other.getVolumeGainDb()); + } + if (!other.effectsProfileId_.isEmpty()) { + if (effectsProfileId_.isEmpty()) { + effectsProfileId_ = other.effectsProfileId_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEffectsProfileIdIsMutable(); + effectsProfileId_.addAll(other.effectsProfileId_); + } + onChanged(); + } + if (other.hasVoice()) { + mergeVoice(other.getVoice()); + } + 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.dialogflow.cx.v3beta1.SynthesizeSpeechConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private double speakingRate_; + /** + * + * + *
+     * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal
+     * native speed supported by the specific voice. 2.0 is twice as fast, and
+     * 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any
+     * other values < 0.25 or > 4.0 will return an error.
+     * 
+ * + * double speaking_rate = 1; + * + * @return The speakingRate. + */ + @java.lang.Override + public double getSpeakingRate() { + return speakingRate_; + } + /** + * + * + *
+     * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal
+     * native speed supported by the specific voice. 2.0 is twice as fast, and
+     * 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any
+     * other values < 0.25 or > 4.0 will return an error.
+     * 
+ * + * double speaking_rate = 1; + * + * @param value The speakingRate to set. + * @return This builder for chaining. + */ + public Builder setSpeakingRate(double value) { + + speakingRate_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal
+     * native speed supported by the specific voice. 2.0 is twice as fast, and
+     * 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any
+     * other values < 0.25 or > 4.0 will return an error.
+     * 
+ * + * double speaking_rate = 1; + * + * @return This builder for chaining. + */ + public Builder clearSpeakingRate() { + + speakingRate_ = 0D; + onChanged(); + return this; + } + + private double pitch_; + /** + * + * + *
+     * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20
+     * semitones from the original pitch. -20 means decrease 20 semitones from the
+     * original pitch.
+     * 
+ * + * double pitch = 2; + * + * @return The pitch. + */ + @java.lang.Override + public double getPitch() { + return pitch_; + } + /** + * + * + *
+     * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20
+     * semitones from the original pitch. -20 means decrease 20 semitones from the
+     * original pitch.
+     * 
+ * + * double pitch = 2; + * + * @param value The pitch to set. + * @return This builder for chaining. + */ + public Builder setPitch(double value) { + + pitch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20
+     * semitones from the original pitch. -20 means decrease 20 semitones from the
+     * original pitch.
+     * 
+ * + * double pitch = 2; + * + * @return This builder for chaining. + */ + public Builder clearPitch() { + + pitch_ = 0D; + onChanged(); + return this; + } + + private double volumeGainDb_; + /** + * + * + *
+     * Optional. Volume gain (in dB) of the normal native volume supported by the
+     * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of
+     * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB)
+     * will play at approximately half the amplitude of the normal native signal
+     * amplitude. A value of +6.0 (dB) will play at approximately twice the
+     * amplitude of the normal native signal amplitude. We strongly recommend not
+     * to exceed +10 (dB) as there's usually no effective increase in loudness for
+     * any value greater than that.
+     * 
+ * + * double volume_gain_db = 3; + * + * @return The volumeGainDb. + */ + @java.lang.Override + public double getVolumeGainDb() { + return volumeGainDb_; + } + /** + * + * + *
+     * Optional. Volume gain (in dB) of the normal native volume supported by the
+     * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of
+     * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB)
+     * will play at approximately half the amplitude of the normal native signal
+     * amplitude. A value of +6.0 (dB) will play at approximately twice the
+     * amplitude of the normal native signal amplitude. We strongly recommend not
+     * to exceed +10 (dB) as there's usually no effective increase in loudness for
+     * any value greater than that.
+     * 
+ * + * double volume_gain_db = 3; + * + * @param value The volumeGainDb to set. + * @return This builder for chaining. + */ + public Builder setVolumeGainDb(double value) { + + volumeGainDb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Volume gain (in dB) of the normal native volume supported by the
+     * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of
+     * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB)
+     * will play at approximately half the amplitude of the normal native signal
+     * amplitude. A value of +6.0 (dB) will play at approximately twice the
+     * amplitude of the normal native signal amplitude. We strongly recommend not
+     * to exceed +10 (dB) as there's usually no effective increase in loudness for
+     * any value greater than that.
+     * 
+ * + * double volume_gain_db = 3; + * + * @return This builder for chaining. + */ + public Builder clearVolumeGainDb() { + + volumeGainDb_ = 0D; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList effectsProfileId_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureEffectsProfileIdIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + effectsProfileId_ = new com.google.protobuf.LazyStringArrayList(effectsProfileId_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Optional. An identifier which selects 'audio effects' profiles that are
+     * applied on (post synthesized) text to speech. Effects are applied on top of
+     * each other in the order they are given.
+     * 
+ * + * repeated string effects_profile_id = 5; + * + * @return A list containing the effectsProfileId. + */ + public com.google.protobuf.ProtocolStringList getEffectsProfileIdList() { + return effectsProfileId_.getUnmodifiableView(); + } + /** + * + * + *
+     * Optional. An identifier which selects 'audio effects' profiles that are
+     * applied on (post synthesized) text to speech. Effects are applied on top of
+     * each other in the order they are given.
+     * 
+ * + * repeated string effects_profile_id = 5; + * + * @return The count of effectsProfileId. + */ + public int getEffectsProfileIdCount() { + return effectsProfileId_.size(); + } + /** + * + * + *
+     * Optional. An identifier which selects 'audio effects' profiles that are
+     * applied on (post synthesized) text to speech. Effects are applied on top of
+     * each other in the order they are given.
+     * 
+ * + * repeated string effects_profile_id = 5; + * + * @param index The index of the element to return. + * @return The effectsProfileId at the given index. + */ + public java.lang.String getEffectsProfileId(int index) { + return effectsProfileId_.get(index); + } + /** + * + * + *
+     * Optional. An identifier which selects 'audio effects' profiles that are
+     * applied on (post synthesized) text to speech. Effects are applied on top of
+     * each other in the order they are given.
+     * 
+ * + * repeated string effects_profile_id = 5; + * + * @param index The index of the value to return. + * @return The bytes of the effectsProfileId at the given index. + */ + public com.google.protobuf.ByteString getEffectsProfileIdBytes(int index) { + return effectsProfileId_.getByteString(index); + } + /** + * + * + *
+     * Optional. An identifier which selects 'audio effects' profiles that are
+     * applied on (post synthesized) text to speech. Effects are applied on top of
+     * each other in the order they are given.
+     * 
+ * + * repeated string effects_profile_id = 5; + * + * @param index The index to set the value at. + * @param value The effectsProfileId to set. + * @return This builder for chaining. + */ + public Builder setEffectsProfileId(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEffectsProfileIdIsMutable(); + effectsProfileId_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An identifier which selects 'audio effects' profiles that are
+     * applied on (post synthesized) text to speech. Effects are applied on top of
+     * each other in the order they are given.
+     * 
+ * + * repeated string effects_profile_id = 5; + * + * @param value The effectsProfileId to add. + * @return This builder for chaining. + */ + public Builder addEffectsProfileId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEffectsProfileIdIsMutable(); + effectsProfileId_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An identifier which selects 'audio effects' profiles that are
+     * applied on (post synthesized) text to speech. Effects are applied on top of
+     * each other in the order they are given.
+     * 
+ * + * repeated string effects_profile_id = 5; + * + * @param values The effectsProfileId to add. + * @return This builder for chaining. + */ + public Builder addAllEffectsProfileId(java.lang.Iterable values) { + ensureEffectsProfileIdIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, effectsProfileId_); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An identifier which selects 'audio effects' profiles that are
+     * applied on (post synthesized) text to speech. Effects are applied on top of
+     * each other in the order they are given.
+     * 
+ * + * repeated string effects_profile_id = 5; + * + * @return This builder for chaining. + */ + public Builder clearEffectsProfileId() { + effectsProfileId_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An identifier which selects 'audio effects' profiles that are
+     * applied on (post synthesized) text to speech. Effects are applied on top of
+     * each other in the order they are given.
+     * 
+ * + * repeated string effects_profile_id = 5; + * + * @param value The bytes of the effectsProfileId to add. + * @return This builder for chaining. + */ + public Builder addEffectsProfileIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureEffectsProfileIdIsMutable(); + effectsProfileId_.add(value); + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams, + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.Builder, + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParamsOrBuilder> + voiceBuilder_; + /** + * + * + *
+     * Optional. The desired voice of the synthesized audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + * + * @return Whether the voice field is set. + */ + public boolean hasVoice() { + return voiceBuilder_ != null || voice_ != null; + } + /** + * + * + *
+     * Optional. The desired voice of the synthesized audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + * + * @return The voice. + */ + public com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams getVoice() { + if (voiceBuilder_ == null) { + return voice_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.getDefaultInstance() + : voice_; + } else { + return voiceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The desired voice of the synthesized audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + */ + public Builder setVoice(com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams value) { + if (voiceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + voice_ = value; + onChanged(); + } else { + voiceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The desired voice of the synthesized audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + */ + public Builder setVoice( + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.Builder builderForValue) { + if (voiceBuilder_ == null) { + voice_ = builderForValue.build(); + onChanged(); + } else { + voiceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. The desired voice of the synthesized audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + */ + public Builder mergeVoice(com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams value) { + if (voiceBuilder_ == null) { + if (voice_ != null) { + voice_ = + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.newBuilder(voice_) + .mergeFrom(value) + .buildPartial(); + } else { + voice_ = value; + } + onChanged(); + } else { + voiceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The desired voice of the synthesized audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + */ + public Builder clearVoice() { + if (voiceBuilder_ == null) { + voice_ = null; + onChanged(); + } else { + voice_ = null; + voiceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. The desired voice of the synthesized audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.Builder getVoiceBuilder() { + + onChanged(); + return getVoiceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The desired voice of the synthesized audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParamsOrBuilder + getVoiceOrBuilder() { + if (voiceBuilder_ != null) { + return voiceBuilder_.getMessageOrBuilder(); + } else { + return voice_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.getDefaultInstance() + : voice_; + } + } + /** + * + * + *
+     * Optional. The desired voice of the synthesized audio.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams, + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.Builder, + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParamsOrBuilder> + getVoiceFieldBuilder() { + if (voiceBuilder_ == null) { + voiceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams, + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.Builder, + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParamsOrBuilder>( + getVoice(), getParentForChildren(), isClean()); + voice_ = null; + } + return voiceBuilder_; + } + + @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.dialogflow.cx.v3beta1.SynthesizeSpeechConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig) + private static final com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SynthesizeSpeechConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SynthesizeSpeechConfig(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.dialogflow.cx.v3beta1.SynthesizeSpeechConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SynthesizeSpeechConfigOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SynthesizeSpeechConfigOrBuilder.java new file mode 100644 index 000000000..8ab53a357 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SynthesizeSpeechConfigOrBuilder.java @@ -0,0 +1,170 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface SynthesizeSpeechConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal
+   * native speed supported by the specific voice. 2.0 is twice as fast, and
+   * 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any
+   * other values < 0.25 or > 4.0 will return an error.
+   * 
+ * + * double speaking_rate = 1; + * + * @return The speakingRate. + */ + double getSpeakingRate(); + + /** + * + * + *
+   * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20
+   * semitones from the original pitch. -20 means decrease 20 semitones from the
+   * original pitch.
+   * 
+ * + * double pitch = 2; + * + * @return The pitch. + */ + double getPitch(); + + /** + * + * + *
+   * Optional. Volume gain (in dB) of the normal native volume supported by the
+   * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of
+   * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB)
+   * will play at approximately half the amplitude of the normal native signal
+   * amplitude. A value of +6.0 (dB) will play at approximately twice the
+   * amplitude of the normal native signal amplitude. We strongly recommend not
+   * to exceed +10 (dB) as there's usually no effective increase in loudness for
+   * any value greater than that.
+   * 
+ * + * double volume_gain_db = 3; + * + * @return The volumeGainDb. + */ + double getVolumeGainDb(); + + /** + * + * + *
+   * Optional. An identifier which selects 'audio effects' profiles that are
+   * applied on (post synthesized) text to speech. Effects are applied on top of
+   * each other in the order they are given.
+   * 
+ * + * repeated string effects_profile_id = 5; + * + * @return A list containing the effectsProfileId. + */ + java.util.List getEffectsProfileIdList(); + /** + * + * + *
+   * Optional. An identifier which selects 'audio effects' profiles that are
+   * applied on (post synthesized) text to speech. Effects are applied on top of
+   * each other in the order they are given.
+   * 
+ * + * repeated string effects_profile_id = 5; + * + * @return The count of effectsProfileId. + */ + int getEffectsProfileIdCount(); + /** + * + * + *
+   * Optional. An identifier which selects 'audio effects' profiles that are
+   * applied on (post synthesized) text to speech. Effects are applied on top of
+   * each other in the order they are given.
+   * 
+ * + * repeated string effects_profile_id = 5; + * + * @param index The index of the element to return. + * @return The effectsProfileId at the given index. + */ + java.lang.String getEffectsProfileId(int index); + /** + * + * + *
+   * Optional. An identifier which selects 'audio effects' profiles that are
+   * applied on (post synthesized) text to speech. Effects are applied on top of
+   * each other in the order they are given.
+   * 
+ * + * repeated string effects_profile_id = 5; + * + * @param index The index of the value to return. + * @return The bytes of the effectsProfileId at the given index. + */ + com.google.protobuf.ByteString getEffectsProfileIdBytes(int index); + + /** + * + * + *
+   * Optional. The desired voice of the synthesized audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + * + * @return Whether the voice field is set. + */ + boolean hasVoice(); + /** + * + * + *
+   * Optional. The desired voice of the synthesized audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + * + * @return The voice. + */ + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams getVoice(); + /** + * + * + *
+   * Optional. The desired voice of the synthesized audio.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams voice = 4; + */ + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParamsOrBuilder getVoiceOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TextInput.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TextInput.java new file mode 100644 index 000000000..b009a8614 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TextInput.java @@ -0,0 +1,642 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Represents the natural language text to be processed.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.TextInput} + */ +public final class TextInput extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.TextInput) + TextInputOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextInput.newBuilder() to construct. + private TextInput(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextInput() { + text_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TextInput(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TextInput( + 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(); + + text_ = 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.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TextInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TextInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.TextInput.class, + com.google.cloud.dialogflow.cx.v3beta1.TextInput.Builder.class); + } + + public static final int TEXT_FIELD_NUMBER = 1; + private volatile java.lang.Object text_; + /** + * + * + *
+   * Required. The UTF-8 encoded natural language text to be processed. Text length must
+   * not exceed 256 characters.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = text_; + 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(); + text_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The UTF-8 encoded natural language text to be processed. Text length must
+   * not exceed 256 characters.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = 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 (!getTextBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, text_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTextBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, text_); + } + 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.dialogflow.cx.v3beta1.TextInput)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.TextInput other = + (com.google.cloud.dialogflow.cx.v3beta1.TextInput) obj; + + if (!getText().equals(other.getText())) 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) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TextInput parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TextInput 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.dialogflow.cx.v3beta1.TextInput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TextInput 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.dialogflow.cx.v3beta1.TextInput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TextInput parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TextInput parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TextInput 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.dialogflow.cx.v3beta1.TextInput parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TextInput 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.dialogflow.cx.v3beta1.TextInput parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TextInput 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.dialogflow.cx.v3beta1.TextInput prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the natural language text to be processed.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.TextInput} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.TextInput) + com.google.cloud.dialogflow.cx.v3beta1.TextInputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TextInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TextInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.TextInput.class, + com.google.cloud.dialogflow.cx.v3beta1.TextInput.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.TextInput.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(); + text_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TextInput_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TextInput getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.TextInput.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TextInput build() { + com.google.cloud.dialogflow.cx.v3beta1.TextInput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TextInput buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.TextInput result = + new com.google.cloud.dialogflow.cx.v3beta1.TextInput(this); + result.text_ = text_; + 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.dialogflow.cx.v3beta1.TextInput) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.TextInput) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.TextInput other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.TextInput.getDefaultInstance()) + return this; + if (!other.getText().isEmpty()) { + text_ = other.text_; + 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.dialogflow.cx.v3beta1.TextInput parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.dialogflow.cx.v3beta1.TextInput) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object text_ = ""; + /** + * + * + *
+     * Required. The UTF-8 encoded natural language text to be processed. Text length must
+     * not exceed 256 characters.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The UTF-8 encoded natural language text to be processed. Text length must
+     * not exceed 256 characters.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The UTF-8 encoded natural language text to be processed. Text length must
+     * not exceed 256 characters.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + text_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The UTF-8 encoded natural language text to be processed. Text length must
+     * not exceed 256 characters.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearText() { + + text_ = getDefaultInstance().getText(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The UTF-8 encoded natural language text to be processed. Text length must
+     * not exceed 256 characters.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + text_ = 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.dialogflow.cx.v3beta1.TextInput) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.TextInput) + private static final com.google.cloud.dialogflow.cx.v3beta1.TextInput DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.TextInput(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TextInput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextInput parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextInput(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.dialogflow.cx.v3beta1.TextInput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TextInputOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TextInputOrBuilder.java new file mode 100644 index 000000000..7d37f79d6 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TextInputOrBuilder.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/dialogflow/cx/v3beta1/session.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface TextInputOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.TextInput) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The UTF-8 encoded natural language text to be processed. Text length must
+   * not exceed 256 characters.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The text. + */ + java.lang.String getText(); + /** + * + * + *
+   * Required. The UTF-8 encoded natural language text to be processed. Text length must
+   * not exceed 256 characters.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TrainFlowRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TrainFlowRequest.java new file mode 100644 index 000000000..e66662a01 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TrainFlowRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Flows.TrainFlow][google.cloud.dialogflow.cx.v3beta1.Flows.TrainFlow].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest} + */ +public final class TrainFlowRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest) + TrainFlowRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use TrainFlowRequest.newBuilder() to construct. + private TrainFlowRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TrainFlowRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TrainFlowRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TrainFlowRequest( + 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.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TrainFlowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TrainFlowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The flow to train.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The flow to train.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.dialogflow.cx.v3beta1.TrainFlowRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest) 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.dialogflow.cx.v3beta1.TrainFlowRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest 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.dialogflow.cx.v3beta1.TrainFlowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest 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.dialogflow.cx.v3beta1.TrainFlowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest 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.dialogflow.cx.v3beta1.TrainFlowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest 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.dialogflow.cx.v3beta1.TrainFlowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest 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.dialogflow.cx.v3beta1.TrainFlowRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Flows.TrainFlow][google.cloud.dialogflow.cx.v3beta1.Flows.TrainFlow].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest) + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TrainFlowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TrainFlowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest.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.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TrainFlowRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest(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.dialogflow.cx.v3beta1.TrainFlowRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest.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.dialogflow.cx.v3beta1.TrainFlowRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The flow to train.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to train.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to train.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 flow to train.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The flow to train.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.dialogflow.cx.v3beta1.TrainFlowRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TrainFlowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TrainFlowRequest(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.dialogflow.cx.v3beta1.TrainFlowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TrainFlowRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TrainFlowRequestOrBuilder.java new file mode 100644 index 000000000..76afcf07b --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TrainFlowRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface TrainFlowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The flow to train.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The flow to train.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRoute.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRoute.java new file mode 100644 index 000000000..dd1ac09e8 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRoute.java @@ -0,0 +1,1928 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * A transition route specifies a [intent][google.cloud.dialogflow.cx.v3beta1.Intent] that can be matched and/or a
+ * data condition that can be evaluated during a session. When a specified
+ * transition is matched, the following actions are taken in order:
+ * *   If there is a
+ * [`trigger_fulfillment`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.trigger_fulfillment] associated with
+ * the transition, it will be called.
+ * *   If there is a [`target_page`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.target_page] associated
+ * with the transition, the session will transition into the specified page.
+ * *   If there is a [`target_flow`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.target_flow] associated
+ * with the transition, the session will transition into the specified flow.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.TransitionRoute} + */ +public final class TransitionRoute extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.TransitionRoute) + TransitionRouteOrBuilder { + private static final long serialVersionUID = 0L; + // Use TransitionRoute.newBuilder() to construct. + private TransitionRoute(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TransitionRoute() { + name_ = ""; + intent_ = ""; + condition_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TransitionRoute(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TransitionRoute( + 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(); + + intent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + condition_ = s; + break; + } + case 26: + { + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder subBuilder = null; + if (triggerFulfillment_ != null) { + subBuilder = triggerFulfillment_.toBuilder(); + } + triggerFulfillment_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(triggerFulfillment_); + triggerFulfillment_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + targetCase_ = 4; + target_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + targetCase_ = 5; + target_ = s; + break; + } + case 50: + { + 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.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRoute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRoute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.class, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder.class); + } + + private int targetCase_ = 0; + private java.lang.Object target_; + + public enum TargetCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TARGET_PAGE(4), + TARGET_FLOW(5), + TARGET_NOT_SET(0); + private final int value; + + private TargetCase(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 TargetCase valueOf(int value) { + return forNumber(value); + } + + public static TargetCase forNumber(int value) { + switch (value) { + case 4: + return TARGET_PAGE; + case 5: + return TARGET_FLOW; + case 0: + return TARGET_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TargetCase getTargetCase() { + return TargetCase.forNumber(targetCase_); + } + + public static final int NAME_FIELD_NUMBER = 6; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The unique identifier of this transition route.
+   * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The unique identifier of this transition route.
+   * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object intent_; + /** + * + * + *
+   * The unique identifier of an [Intent][google.cloud.dialogflow.cx.v3beta1.Intent].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * Indicates that the transition can only happen when the given intent is
+   * matched.
+   * At least one of `intent` or `condition` must be specified. When both
+   * `intent` and `condition` are specified, the transition can only happen
+   * when both are fulfilled.
+   * 
+ * + * string intent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The intent. + */ + @java.lang.Override + public java.lang.String getIntent() { + java.lang.Object ref = intent_; + 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(); + intent_ = s; + return s; + } + } + /** + * + * + *
+   * The unique identifier of an [Intent][google.cloud.dialogflow.cx.v3beta1.Intent].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * Indicates that the transition can only happen when the given intent is
+   * matched.
+   * At least one of `intent` or `condition` must be specified. When both
+   * `intent` and `condition` are specified, the transition can only happen
+   * when both are fulfilled.
+   * 
+ * + * string intent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for intent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIntentBytes() { + java.lang.Object ref = intent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + intent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONDITION_FIELD_NUMBER = 2; + private volatile java.lang.Object condition_; + /** + * + * + *
+   * The condition to evaluate against [form parameters][google.cloud.dialogflow.cx.v3beta1.Form.parameters] or
+   * [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+   * See the [conditions
+   * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+   * At least one of `intent` or `condition` must be specified. When both
+   * `intent` and `condition` are specified, the transition can only happen
+   * when both are fulfilled.
+   * 
+ * + * string condition = 2; + * + * @return The condition. + */ + @java.lang.Override + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + 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(); + condition_ = s; + return s; + } + } + /** + * + * + *
+   * The condition to evaluate against [form parameters][google.cloud.dialogflow.cx.v3beta1.Form.parameters] or
+   * [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+   * See the [conditions
+   * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+   * At least one of `intent` or `condition` must be specified. When both
+   * `intent` and `condition` are specified, the transition can only happen
+   * when both are fulfilled.
+   * 
+ * + * string condition = 2; + * + * @return The bytes for condition. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRIGGER_FULFILLMENT_FIELD_NUMBER = 3; + private com.google.cloud.dialogflow.cx.v3beta1.Fulfillment triggerFulfillment_; + /** + * + * + *
+   * The fulfillment to call when the condition is satisfied. At least one of
+   * `trigger_fulfillment` and `target` must be specified. When both are
+   * defined, `trigger_fulfillment` is executed first.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + * + * @return Whether the triggerFulfillment field is set. + */ + @java.lang.Override + public boolean hasTriggerFulfillment() { + return triggerFulfillment_ != null; + } + /** + * + * + *
+   * The fulfillment to call when the condition is satisfied. At least one of
+   * `trigger_fulfillment` and `target` must be specified. When both are
+   * defined, `trigger_fulfillment` is executed first.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + * + * @return The triggerFulfillment. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment getTriggerFulfillment() { + return triggerFulfillment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.getDefaultInstance() + : triggerFulfillment_; + } + /** + * + * + *
+   * The fulfillment to call when the condition is satisfied. At least one of
+   * `trigger_fulfillment` and `target` must be specified. When both are
+   * defined, `trigger_fulfillment` is executed first.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder + getTriggerFulfillmentOrBuilder() { + return getTriggerFulfillment(); + } + + public static final int TARGET_PAGE_FIELD_NUMBER = 4; + /** + * + * + *
+   * The target page to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string target_page = 4 [(.google.api.resource_reference) = { ... } + * + * @return The targetPage. + */ + public java.lang.String getTargetPage() { + java.lang.Object ref = ""; + if (targetCase_ == 4) { + ref = target_; + } + 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 (targetCase_ == 4) { + target_ = s; + } + return s; + } + } + /** + * + * + *
+   * The target page to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string target_page = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetPage. + */ + public com.google.protobuf.ByteString getTargetPageBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 4) { + ref = target_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 4) { + target_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_FLOW_FIELD_NUMBER = 5; + /** + * + * + *
+   * The target flow to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string target_flow = 5 [(.google.api.resource_reference) = { ... } + * + * @return The targetFlow. + */ + public java.lang.String getTargetFlow() { + java.lang.Object ref = ""; + if (targetCase_ == 5) { + ref = target_; + } + 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 (targetCase_ == 5) { + target_ = s; + } + return s; + } + } + /** + * + * + *
+   * The target flow to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string target_flow = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetFlow. + */ + public com.google.protobuf.ByteString getTargetFlowBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 5) { + ref = target_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 5) { + target_ = 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 (!getIntentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, intent_); + } + if (!getConditionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, condition_); + } + if (triggerFulfillment_ != null) { + output.writeMessage(3, getTriggerFulfillment()); + } + if (targetCase_ == 4) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, target_); + } + if (targetCase_ == 5) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, target_); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIntentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, intent_); + } + if (!getConditionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, condition_); + } + if (triggerFulfillment_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTriggerFulfillment()); + } + if (targetCase_ == 4) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, target_); + } + if (targetCase_ == 5) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, target_); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, 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.dialogflow.cx.v3beta1.TransitionRoute)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute other = + (com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute) obj; + + if (!getName().equals(other.getName())) return false; + if (!getIntent().equals(other.getIntent())) return false; + if (!getCondition().equals(other.getCondition())) return false; + if (hasTriggerFulfillment() != other.hasTriggerFulfillment()) return false; + if (hasTriggerFulfillment()) { + if (!getTriggerFulfillment().equals(other.getTriggerFulfillment())) return false; + } + if (!getTargetCase().equals(other.getTargetCase())) return false; + switch (targetCase_) { + case 4: + if (!getTargetPage().equals(other.getTargetPage())) return false; + break; + case 5: + if (!getTargetFlow().equals(other.getTargetFlow())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + INTENT_FIELD_NUMBER; + hash = (53 * hash) + getIntent().hashCode(); + hash = (37 * hash) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().hashCode(); + if (hasTriggerFulfillment()) { + hash = (37 * hash) + TRIGGER_FULFILLMENT_FIELD_NUMBER; + hash = (53 * hash) + getTriggerFulfillment().hashCode(); + } + switch (targetCase_) { + case 4: + hash = (37 * hash) + TARGET_PAGE_FIELD_NUMBER; + hash = (53 * hash) + getTargetPage().hashCode(); + break; + case 5: + hash = (37 * hash) + TARGET_FLOW_FIELD_NUMBER; + hash = (53 * hash) + getTargetFlow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute 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.dialogflow.cx.v3beta1.TransitionRoute parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute 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.dialogflow.cx.v3beta1.TransitionRoute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute 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.dialogflow.cx.v3beta1.TransitionRoute parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute 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.dialogflow.cx.v3beta1.TransitionRoute parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute 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.dialogflow.cx.v3beta1.TransitionRoute 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 transition route specifies a [intent][google.cloud.dialogflow.cx.v3beta1.Intent] that can be matched and/or a
+   * data condition that can be evaluated during a session. When a specified
+   * transition is matched, the following actions are taken in order:
+   * *   If there is a
+   * [`trigger_fulfillment`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.trigger_fulfillment] associated with
+   * the transition, it will be called.
+   * *   If there is a [`target_page`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.target_page] associated
+   * with the transition, the session will transition into the specified page.
+   * *   If there is a [`target_flow`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.target_flow] associated
+   * with the transition, the session will transition into the specified flow.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.TransitionRoute} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.TransitionRoute) + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRoute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRoute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.class, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.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_ = ""; + + intent_ = ""; + + condition_ = ""; + + if (triggerFulfillmentBuilder_ == null) { + triggerFulfillment_ = null; + } else { + triggerFulfillment_ = null; + triggerFulfillmentBuilder_ = null; + } + targetCase_ = 0; + target_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRoute_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute build() { + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute result = + new com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute(this); + result.name_ = name_; + result.intent_ = intent_; + result.condition_ = condition_; + if (triggerFulfillmentBuilder_ == null) { + result.triggerFulfillment_ = triggerFulfillment_; + } else { + result.triggerFulfillment_ = triggerFulfillmentBuilder_.build(); + } + if (targetCase_ == 4) { + result.target_ = target_; + } + if (targetCase_ == 5) { + result.target_ = target_; + } + result.targetCase_ = targetCase_; + 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.dialogflow.cx.v3beta1.TransitionRoute) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getIntent().isEmpty()) { + intent_ = other.intent_; + onChanged(); + } + if (!other.getCondition().isEmpty()) { + condition_ = other.condition_; + onChanged(); + } + if (other.hasTriggerFulfillment()) { + mergeTriggerFulfillment(other.getTriggerFulfillment()); + } + switch (other.getTargetCase()) { + case TARGET_PAGE: + { + targetCase_ = 4; + target_ = other.target_; + onChanged(); + break; + } + case TARGET_FLOW: + { + targetCase_ = 5; + target_ = other.target_; + onChanged(); + break; + } + case TARGET_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.dialogflow.cx.v3beta1.TransitionRoute parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int targetCase_ = 0; + private java.lang.Object target_; + + public TargetCase getTargetCase() { + return TargetCase.forNumber(targetCase_); + } + + public Builder clearTarget() { + targetCase_ = 0; + target_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The unique identifier of this transition route.
+     * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The unique identifier of this transition route.
+     * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The unique identifier of this transition route.
+     * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. The unique identifier of this transition route.
+     * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique identifier of this transition route.
+     * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object intent_ = ""; + /** + * + * + *
+     * The unique identifier of an [Intent][google.cloud.dialogflow.cx.v3beta1.Intent].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * Indicates that the transition can only happen when the given intent is
+     * matched.
+     * At least one of `intent` or `condition` must be specified. When both
+     * `intent` and `condition` are specified, the transition can only happen
+     * when both are fulfilled.
+     * 
+ * + * string intent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The intent. + */ + public java.lang.String getIntent() { + java.lang.Object ref = intent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + intent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unique identifier of an [Intent][google.cloud.dialogflow.cx.v3beta1.Intent].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * Indicates that the transition can only happen when the given intent is
+     * matched.
+     * At least one of `intent` or `condition` must be specified. When both
+     * `intent` and `condition` are specified, the transition can only happen
+     * when both are fulfilled.
+     * 
+ * + * string intent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for intent. + */ + public com.google.protobuf.ByteString getIntentBytes() { + java.lang.Object ref = intent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + intent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unique identifier of an [Intent][google.cloud.dialogflow.cx.v3beta1.Intent].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * Indicates that the transition can only happen when the given intent is
+     * matched.
+     * At least one of `intent` or `condition` must be specified. When both
+     * `intent` and `condition` are specified, the transition can only happen
+     * when both are fulfilled.
+     * 
+ * + * string intent = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The intent to set. + * @return This builder for chaining. + */ + public Builder setIntent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + intent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of an [Intent][google.cloud.dialogflow.cx.v3beta1.Intent].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * Indicates that the transition can only happen when the given intent is
+     * matched.
+     * At least one of `intent` or `condition` must be specified. When both
+     * `intent` and `condition` are specified, the transition can only happen
+     * when both are fulfilled.
+     * 
+ * + * string intent = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearIntent() { + + intent_ = getDefaultInstance().getIntent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of an [Intent][google.cloud.dialogflow.cx.v3beta1.Intent].
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/intents/<Intent ID>`.
+     * Indicates that the transition can only happen when the given intent is
+     * matched.
+     * At least one of `intent` or `condition` must be specified. When both
+     * `intent` and `condition` are specified, the transition can only happen
+     * when both are fulfilled.
+     * 
+ * + * string intent = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for intent to set. + * @return This builder for chaining. + */ + public Builder setIntentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + intent_ = value; + onChanged(); + return this; + } + + private java.lang.Object condition_ = ""; + /** + * + * + *
+     * The condition to evaluate against [form parameters][google.cloud.dialogflow.cx.v3beta1.Form.parameters] or
+     * [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+     * See the [conditions
+     * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+     * At least one of `intent` or `condition` must be specified. When both
+     * `intent` and `condition` are specified, the transition can only happen
+     * when both are fulfilled.
+     * 
+ * + * string condition = 2; + * + * @return The condition. + */ + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + condition_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The condition to evaluate against [form parameters][google.cloud.dialogflow.cx.v3beta1.Form.parameters] or
+     * [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+     * See the [conditions
+     * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+     * At least one of `intent` or `condition` must be specified. When both
+     * `intent` and `condition` are specified, the transition can only happen
+     * when both are fulfilled.
+     * 
+ * + * string condition = 2; + * + * @return The bytes for condition. + */ + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The condition to evaluate against [form parameters][google.cloud.dialogflow.cx.v3beta1.Form.parameters] or
+     * [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+     * See the [conditions
+     * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+     * At least one of `intent` or `condition` must be specified. When both
+     * `intent` and `condition` are specified, the transition can only happen
+     * when both are fulfilled.
+     * 
+ * + * string condition = 2; + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + condition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The condition to evaluate against [form parameters][google.cloud.dialogflow.cx.v3beta1.Form.parameters] or
+     * [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+     * See the [conditions
+     * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+     * At least one of `intent` or `condition` must be specified. When both
+     * `intent` and `condition` are specified, the transition can only happen
+     * when both are fulfilled.
+     * 
+ * + * string condition = 2; + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + + condition_ = getDefaultInstance().getCondition(); + onChanged(); + return this; + } + /** + * + * + *
+     * The condition to evaluate against [form parameters][google.cloud.dialogflow.cx.v3beta1.Form.parameters] or
+     * [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+     * See the [conditions
+     * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+     * At least one of `intent` or `condition` must be specified. When both
+     * `intent` and `condition` are specified, the transition can only happen
+     * when both are fulfilled.
+     * 
+ * + * string condition = 2; + * + * @param value The bytes for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + condition_ = value; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Fulfillment triggerFulfillment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder> + triggerFulfillmentBuilder_; + /** + * + * + *
+     * The fulfillment to call when the condition is satisfied. At least one of
+     * `trigger_fulfillment` and `target` must be specified. When both are
+     * defined, `trigger_fulfillment` is executed first.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + * + * @return Whether the triggerFulfillment field is set. + */ + public boolean hasTriggerFulfillment() { + return triggerFulfillmentBuilder_ != null || triggerFulfillment_ != null; + } + /** + * + * + *
+     * The fulfillment to call when the condition is satisfied. At least one of
+     * `trigger_fulfillment` and `target` must be specified. When both are
+     * defined, `trigger_fulfillment` is executed first.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + * + * @return The triggerFulfillment. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment getTriggerFulfillment() { + if (triggerFulfillmentBuilder_ == null) { + return triggerFulfillment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.getDefaultInstance() + : triggerFulfillment_; + } else { + return triggerFulfillmentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fulfillment to call when the condition is satisfied. At least one of
+     * `trigger_fulfillment` and `target` must be specified. When both are
+     * defined, `trigger_fulfillment` is executed first.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + */ + public Builder setTriggerFulfillment(com.google.cloud.dialogflow.cx.v3beta1.Fulfillment value) { + if (triggerFulfillmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + triggerFulfillment_ = value; + onChanged(); + } else { + triggerFulfillmentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fulfillment to call when the condition is satisfied. At least one of
+     * `trigger_fulfillment` and `target` must be specified. When both are
+     * defined, `trigger_fulfillment` is executed first.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + */ + public Builder setTriggerFulfillment( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder builderForValue) { + if (triggerFulfillmentBuilder_ == null) { + triggerFulfillment_ = builderForValue.build(); + onChanged(); + } else { + triggerFulfillmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fulfillment to call when the condition is satisfied. At least one of
+     * `trigger_fulfillment` and `target` must be specified. When both are
+     * defined, `trigger_fulfillment` is executed first.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + */ + public Builder mergeTriggerFulfillment( + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment value) { + if (triggerFulfillmentBuilder_ == null) { + if (triggerFulfillment_ != null) { + triggerFulfillment_ = + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.newBuilder(triggerFulfillment_) + .mergeFrom(value) + .buildPartial(); + } else { + triggerFulfillment_ = value; + } + onChanged(); + } else { + triggerFulfillmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fulfillment to call when the condition is satisfied. At least one of
+     * `trigger_fulfillment` and `target` must be specified. When both are
+     * defined, `trigger_fulfillment` is executed first.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + */ + public Builder clearTriggerFulfillment() { + if (triggerFulfillmentBuilder_ == null) { + triggerFulfillment_ = null; + onChanged(); + } else { + triggerFulfillment_ = null; + triggerFulfillmentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fulfillment to call when the condition is satisfied. At least one of
+     * `trigger_fulfillment` and `target` must be specified. When both are
+     * defined, `trigger_fulfillment` is executed first.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + */ + public com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder + getTriggerFulfillmentBuilder() { + + onChanged(); + return getTriggerFulfillmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fulfillment to call when the condition is satisfied. At least one of
+     * `trigger_fulfillment` and `target` must be specified. When both are
+     * defined, `trigger_fulfillment` is executed first.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + */ + public com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder + getTriggerFulfillmentOrBuilder() { + if (triggerFulfillmentBuilder_ != null) { + return triggerFulfillmentBuilder_.getMessageOrBuilder(); + } else { + return triggerFulfillment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.getDefaultInstance() + : triggerFulfillment_; + } + } + /** + * + * + *
+     * The fulfillment to call when the condition is satisfied. At least one of
+     * `trigger_fulfillment` and `target` must be specified. When both are
+     * defined, `trigger_fulfillment` is executed first.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder> + getTriggerFulfillmentFieldBuilder() { + if (triggerFulfillmentBuilder_ == null) { + triggerFulfillmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment, + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder>( + getTriggerFulfillment(), getParentForChildren(), isClean()); + triggerFulfillment_ = null; + } + return triggerFulfillmentBuilder_; + } + + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 4 [(.google.api.resource_reference) = { ... } + * + * @return The targetPage. + */ + @java.lang.Override + public java.lang.String getTargetPage() { + java.lang.Object ref = ""; + if (targetCase_ == 4) { + ref = target_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (targetCase_ == 4) { + target_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetPage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetPageBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 4) { + ref = target_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 4) { + target_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 4 [(.google.api.resource_reference) = { ... } + * + * @param value The targetPage to set. + * @return This builder for chaining. + */ + public Builder setTargetPage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetCase_ = 4; + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 4 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearTargetPage() { + if (targetCase_ == 4) { + targetCase_ = 0; + target_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 4 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for targetPage to set. + * @return This builder for chaining. + */ + public Builder setTargetPageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetCase_ = 4; + target_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 5 [(.google.api.resource_reference) = { ... } + * + * @return The targetFlow. + */ + @java.lang.Override + public java.lang.String getTargetFlow() { + java.lang.Object ref = ""; + if (targetCase_ == 5) { + ref = target_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (targetCase_ == 5) { + target_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetFlow. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetFlowBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 5) { + ref = target_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 5) { + target_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 5 [(.google.api.resource_reference) = { ... } + * + * @param value The targetFlow to set. + * @return This builder for chaining. + */ + public Builder setTargetFlow(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetCase_ = 5; + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 5 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearTargetFlow() { + if (targetCase_ == 5) { + targetCase_ = 0; + target_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 5 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for targetFlow to set. + * @return This builder for chaining. + */ + public Builder setTargetFlowBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetCase_ = 5; + target_ = 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.dialogflow.cx.v3beta1.TransitionRoute) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.TransitionRoute) + private static final com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TransitionRoute parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TransitionRoute(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.dialogflow.cx.v3beta1.TransitionRoute getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroup.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroup.java new file mode 100644 index 000000000..4632823df --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroup.java @@ -0,0 +1,1481 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * An TransitionRouteGroup represents a group of
+ * [`TransitionRoutes`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup} + */ +public final class TransitionRouteGroup extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup) + TransitionRouteGroupOrBuilder { + private static final long serialVersionUID = 0L; + // Use TransitionRouteGroup.newBuilder() to construct. + private TransitionRouteGroup(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TransitionRouteGroup() { + name_ = ""; + displayName_ = ""; + transitionRoutes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TransitionRouteGroup(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TransitionRouteGroup( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + transitionRoutes_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute>(); + mutable_bitField0_ |= 0x00000001; + } + transitionRoutes_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.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)) { + transitionRoutes_ = java.util.Collections.unmodifiableList(transitionRoutes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRouteGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRouteGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.class, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The unique identifier of the transition route group.
+   * [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup] populates the name
+   * automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The unique identifier of the transition route group.
+   * [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup] populates the name
+   * automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required. The human-readable name of the transition route group, unique within
+   * the [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. The display name can be no longer than 30 characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The human-readable name of the transition route group, unique within
+   * the [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. The display name can be no longer than 30 characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRANSITION_ROUTES_FIELD_NUMBER = 5; + private java.util.List transitionRoutes_; + /** + * + * + *
+   * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * Duplicate transition routes (i.e. using the same
+   * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+   * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+   * transition route group scope.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + @java.lang.Override + public java.util.List + getTransitionRoutesList() { + return transitionRoutes_; + } + /** + * + * + *
+   * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * Duplicate transition routes (i.e. using the same
+   * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+   * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+   * transition route group scope.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + @java.lang.Override + public java.util.List + getTransitionRoutesOrBuilderList() { + return transitionRoutes_; + } + /** + * + * + *
+   * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * Duplicate transition routes (i.e. using the same
+   * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+   * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+   * transition route group scope.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + @java.lang.Override + public int getTransitionRoutesCount() { + return transitionRoutes_.size(); + } + /** + * + * + *
+   * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * Duplicate transition routes (i.e. using the same
+   * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+   * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+   * transition route group scope.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute getTransitionRoutes(int index) { + return transitionRoutes_.get(index); + } + /** + * + * + *
+   * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * Duplicate transition routes (i.e. using the same
+   * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+   * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+   * transition route group scope.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder + getTransitionRoutesOrBuilder(int index) { + return transitionRoutes_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + for (int i = 0; i < transitionRoutes_.size(); i++) { + output.writeMessage(5, transitionRoutes_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + for (int i = 0; i < transitionRoutes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, transitionRoutes_.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.dialogflow.cx.v3beta1.TransitionRouteGroup)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup other = + (com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getTransitionRoutesList().equals(other.getTransitionRoutesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (getTransitionRoutesCount() > 0) { + hash = (37 * hash) + TRANSITION_ROUTES_FIELD_NUMBER; + hash = (53 * hash) + getTransitionRoutesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup 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.dialogflow.cx.v3beta1.TransitionRouteGroup parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup 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.dialogflow.cx.v3beta1.TransitionRouteGroup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup 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.dialogflow.cx.v3beta1.TransitionRouteGroup parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup 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.dialogflow.cx.v3beta1.TransitionRouteGroup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup 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.dialogflow.cx.v3beta1.TransitionRouteGroup prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An TransitionRouteGroup represents a group of
+   * [`TransitionRoutes`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup) + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRouteGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRouteGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.class, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTransitionRoutesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + if (transitionRoutesBuilder_ == null) { + transitionRoutes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + transitionRoutesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRouteGroup_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup build() { + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup result = + new com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + if (transitionRoutesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + transitionRoutes_ = java.util.Collections.unmodifiableList(transitionRoutes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.transitionRoutes_ = transitionRoutes_; + } else { + result.transitionRoutes_ = transitionRoutesBuilder_.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.dialogflow.cx.v3beta1.TransitionRouteGroup) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (transitionRoutesBuilder_ == null) { + if (!other.transitionRoutes_.isEmpty()) { + if (transitionRoutes_.isEmpty()) { + transitionRoutes_ = other.transitionRoutes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.addAll(other.transitionRoutes_); + } + onChanged(); + } + } else { + if (!other.transitionRoutes_.isEmpty()) { + if (transitionRoutesBuilder_.isEmpty()) { + transitionRoutesBuilder_.dispose(); + transitionRoutesBuilder_ = null; + transitionRoutes_ = other.transitionRoutes_; + bitField0_ = (bitField0_ & ~0x00000001); + transitionRoutesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTransitionRoutesFieldBuilder() + : null; + } else { + transitionRoutesBuilder_.addAllMessages(other.transitionRoutes_); + } + } + } + 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.dialogflow.cx.v3beta1.TransitionRouteGroup parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The unique identifier of the transition route group.
+     * [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup] populates the name
+     * automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unique identifier of the transition route group.
+     * [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup] populates the name
+     * automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unique identifier of the transition route group.
+     * [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup] populates the name
+     * automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the transition route group.
+     * [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup] populates the name
+     * automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the transition route group.
+     * [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup] populates the name
+     * automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The human-readable name of the transition route group, unique within
+     * the [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. The display name can be no longer than 30 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the transition route group, unique within
+     * the [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. The display name can be no longer than 30 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the transition route group, unique within
+     * the [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. The display name can be no longer than 30 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the transition route group, unique within
+     * the [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. The display name can be no longer than 30 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the transition route group, unique within
+     * the [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. The display name can be no longer than 30 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.util.List + transitionRoutes_ = java.util.Collections.emptyList(); + + private void ensureTransitionRoutesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + transitionRoutes_ = + new java.util.ArrayList( + transitionRoutes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder> + transitionRoutesBuilder_; + + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public java.util.List + getTransitionRoutesList() { + if (transitionRoutesBuilder_ == null) { + return java.util.Collections.unmodifiableList(transitionRoutes_); + } else { + return transitionRoutesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public int getTransitionRoutesCount() { + if (transitionRoutesBuilder_ == null) { + return transitionRoutes_.size(); + } else { + return transitionRoutesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute getTransitionRoutes(int index) { + if (transitionRoutesBuilder_ == null) { + return transitionRoutes_.get(index); + } else { + return transitionRoutesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public Builder setTransitionRoutes( + int index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute value) { + if (transitionRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionRoutesIsMutable(); + transitionRoutes_.set(index, value); + onChanged(); + } else { + transitionRoutesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public Builder setTransitionRoutes( + int index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder builderForValue) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.set(index, builderForValue.build()); + onChanged(); + } else { + transitionRoutesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public Builder addTransitionRoutes( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute value) { + if (transitionRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionRoutesIsMutable(); + transitionRoutes_.add(value); + onChanged(); + } else { + transitionRoutesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public Builder addTransitionRoutes( + int index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute value) { + if (transitionRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionRoutesIsMutable(); + transitionRoutes_.add(index, value); + onChanged(); + } else { + transitionRoutesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public Builder addTransitionRoutes( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder builderForValue) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.add(builderForValue.build()); + onChanged(); + } else { + transitionRoutesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public Builder addTransitionRoutes( + int index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder builderForValue) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.add(index, builderForValue.build()); + onChanged(); + } else { + transitionRoutesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public Builder addAllTransitionRoutes( + java.lang.Iterable + values) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, transitionRoutes_); + onChanged(); + } else { + transitionRoutesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public Builder clearTransitionRoutes() { + if (transitionRoutesBuilder_ == null) { + transitionRoutes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + transitionRoutesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public Builder removeTransitionRoutes(int index) { + if (transitionRoutesBuilder_ == null) { + ensureTransitionRoutesIsMutable(); + transitionRoutes_.remove(index); + onChanged(); + } else { + transitionRoutesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder + getTransitionRoutesBuilder(int index) { + return getTransitionRoutesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder + getTransitionRoutesOrBuilder(int index) { + if (transitionRoutesBuilder_ == null) { + return transitionRoutes_.get(index); + } else { + return transitionRoutesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public java.util.List + getTransitionRoutesOrBuilderList() { + if (transitionRoutesBuilder_ != null) { + return transitionRoutesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(transitionRoutes_); + } + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder + addTransitionRoutesBuilder() { + return getTransitionRoutesFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.getDefaultInstance()); + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder + addTransitionRoutesBuilder(int index) { + return getTransitionRoutesFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.getDefaultInstance()); + } + /** + * + * + *
+     * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * Duplicate transition routes (i.e. using the same
+     * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+     * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+     * transition route group scope.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + public java.util.List + getTransitionRoutesBuilderList() { + return getTransitionRoutesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder> + getTransitionRoutesFieldBuilder() { + if (transitionRoutesBuilder_ == null) { + transitionRoutesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder>( + transitionRoutes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + transitionRoutes_ = null; + } + return transitionRoutesBuilder_; + } + + @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.dialogflow.cx.v3beta1.TransitionRouteGroup) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup) + private static final com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TransitionRouteGroup parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TransitionRouteGroup(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.dialogflow.cx.v3beta1.TransitionRouteGroup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupName.java new file mode 100644 index 000000000..cabac6911 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupName.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.dialogflow.cx.v3beta1; + +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 TransitionRouteGroupName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String agent; + private final String flow; + private final String transitionRouteGroup; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getFlow() { + return flow; + } + + public String getTransitionRouteGroup() { + return transitionRouteGroup; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private TransitionRouteGroupName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + flow = Preconditions.checkNotNull(builder.getFlow()); + transitionRouteGroup = Preconditions.checkNotNull(builder.getTransitionRouteGroup()); + } + + public static TransitionRouteGroupName of( + String project, String location, String agent, String flow, String transitionRouteGroup) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setFlow(flow) + .setTransitionRouteGroup(transitionRouteGroup) + .build(); + } + + public static String format( + String project, String location, String agent, String flow, String transitionRouteGroup) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setFlow(flow) + .setTransitionRouteGroup(transitionRouteGroup) + .build() + .toString(); + } + + public static TransitionRouteGroupName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "TransitionRouteGroupName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("agent"), + matchMap.get("flow"), + matchMap.get("transition_route_group")); + } + + 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 (TransitionRouteGroupName 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("agent", agent); + fieldMapBuilder.put("flow", flow); + fieldMapBuilder.put("transitionRouteGroup", transitionRouteGroup); + 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, + "agent", + agent, + "flow", + flow, + "transition_route_group", + transitionRouteGroup); + } + + /** Builder for TransitionRouteGroupName. */ + public static class Builder { + + private String project; + private String location; + private String agent; + private String flow; + private String transitionRouteGroup; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getFlow() { + return flow; + } + + public String getTransitionRouteGroup() { + return transitionRouteGroup; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAgent(String agent) { + this.agent = agent; + return this; + } + + public Builder setFlow(String flow) { + this.flow = flow; + return this; + } + + public Builder setTransitionRouteGroup(String transitionRouteGroup) { + this.transitionRouteGroup = transitionRouteGroup; + return this; + } + + private Builder() {} + + private Builder(TransitionRouteGroupName transitionRouteGroupName) { + project = transitionRouteGroupName.project; + location = transitionRouteGroupName.location; + agent = transitionRouteGroupName.agent; + flow = transitionRouteGroupName.flow; + transitionRouteGroup = transitionRouteGroupName.transitionRouteGroup; + } + + public TransitionRouteGroupName build() { + return new TransitionRouteGroupName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TransitionRouteGroupName) { + TransitionRouteGroupName that = (TransitionRouteGroupName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.agent.equals(that.agent)) + && (this.flow.equals(that.flow)) + && (this.transitionRouteGroup.equals(that.transitionRouteGroup)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= agent.hashCode(); + h *= 1000003; + h ^= flow.hashCode(); + h *= 1000003; + h ^= transitionRouteGroup.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupOrBuilder.java new file mode 100644 index 000000000..dd0c0ab23 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface TransitionRouteGroupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique identifier of the transition route group.
+   * [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup] populates the name
+   * automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The unique identifier of the transition route group.
+   * [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup] populates the name
+   * automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The human-readable name of the transition route group, unique within
+   * the [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. The display name can be no longer than 30 characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The human-readable name of the transition route group, unique within
+   * the [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. The display name can be no longer than 30 characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * Duplicate transition routes (i.e. using the same
+   * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+   * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+   * transition route group scope.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + java.util.List getTransitionRoutesList(); + /** + * + * + *
+   * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * Duplicate transition routes (i.e. using the same
+   * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+   * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+   * transition route group scope.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute getTransitionRoutes(int index); + /** + * + * + *
+   * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * Duplicate transition routes (i.e. using the same
+   * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+   * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+   * transition route group scope.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + int getTransitionRoutesCount(); + /** + * + * + *
+   * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * Duplicate transition routes (i.e. using the same
+   * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+   * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+   * transition route group scope.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + java.util.List + getTransitionRoutesOrBuilderList(); + /** + * + * + *
+   * Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * Duplicate transition routes (i.e. using the same
+   * [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed.
+   * Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the
+   * transition route group scope.
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.TransitionRoute transition_routes = 5; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteOrBuilder getTransitionRoutesOrBuilder( + int index); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupProto.java new file mode 100644 index 000000000..9f2066395 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupProto.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class TransitionRouteGroupProto { + private TransitionRouteGroupProto() {} + + 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_dialogflow_cx_v3beta1_TransitionRouteGroup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRouteGroup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_GetTransitionRouteGroupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_GetTransitionRouteGroupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateTransitionRouteGroupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateTransitionRouteGroupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateTransitionRouteGroupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateTransitionRouteGroupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteTransitionRouteGroupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteTransitionRouteGroupRequest_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/dialogflow/cx/v3beta1/tra" + + "nsition_route_group.proto\022\"google.cloud." + + "dialogflow.cx.v3beta1\032\034google/api/annota" + + "tions.proto\032\027google/api/client.proto\032\037go" + + "ogle/api/field_behavior.proto\032\031google/ap" + + "i/resource.proto\032-google/cloud/dialogflo" + + "w/cx/v3beta1/page.proto\032\033google/protobuf" + + "/empty.proto\032 google/protobuf/field_mask" + + ".proto\"\272\002\n\024TransitionRouteGroup\022\014\n\004name\030" + + "\001 \001(\t\022\031\n\014display_name\030\002 \001(\tB\003\340A\002\022N\n\021tran" + + "sition_routes\030\005 \003(\01323.google.cloud.dialo" + + "gflow.cx.v3beta1.TransitionRoute:\250\001\352A\244\001\n" + + ".dialogflow.googleapis.com/TransitionRou" + + "teGroup\022rprojects/{project}/locations/{l" + + "ocation}/agents/{agent}/flows/{flow}/tra" + + "nsitionRouteGroups/{transition_route_gro" + + "up}\"\250\001\n ListTransitionRouteGroupsRequest" + + "\022F\n\006parent\030\001 \001(\tB6\340A\002\372A0\022.dialogflow.goo" + + "gleapis.com/TransitionRouteGroup\022\021\n\tpage" + + "_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\025\n\rlangu" + + "age_code\030\004 \001(\t\"\227\001\n!ListTransitionRouteGr" + + "oupsResponse\022Y\n\027transition_route_groups\030" + + "\001 \003(\01328.google.cloud.dialogflow.cx.v3bet" + + "a1.TransitionRouteGroup\022\027\n\017next_page_tok" + + "en\030\002 \001(\t\"}\n\036GetTransitionRouteGroupReque" + + "st\022D\n\004name\030\001 \001(\tB6\340A\002\372A0\n.dialogflow.goo" + + "gleapis.com/TransitionRouteGroup\022\025\n\rlang" + + "uage_code\030\002 \001(\t\"\341\001\n!CreateTransitionRout" + + "eGroupRequest\022F\n\006parent\030\001 \001(\tB6\340A\002\372A0\022.d" + + "ialogflow.googleapis.com/TransitionRoute" + + "Group\022]\n\026transition_route_group\030\002 \001(\01328." + + "google.cloud.dialogflow.cx.v3beta1.Trans" + + "itionRouteGroupB\003\340A\002\022\025\n\rlanguage_code\030\003 " + + "\001(\t\"\312\001\n!UpdateTransitionRouteGroupReques" + + "t\022]\n\026transition_route_group\030\001 \001(\01328.goog" + + "le.cloud.dialogflow.cx.v3beta1.Transitio" + + "nRouteGroupB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032." + + "google.protobuf.FieldMask\022\025\n\rlanguage_co" + + "de\030\003 \001(\t\"x\n!DeleteTransitionRouteGroupRe" + + "quest\022D\n\004name\030\001 \001(\tB6\340A\002\372A0\n.dialogflow." + + "googleapis.com/TransitionRouteGroup\022\r\n\005f" + + "orce\030\002 \001(\0102\367\013\n\025TransitionRouteGroups\022\212\002\n" + + "\031ListTransitionRouteGroups\022D.google.clou" + + "d.dialogflow.cx.v3beta1.ListTransitionRo" + + "uteGroupsRequest\032E.google.cloud.dialogfl" + + "ow.cx.v3beta1.ListTransitionRouteGroupsR" + + "esponse\"`\202\323\344\223\002Q\022O/v3beta1/{parent=projec" + + "ts/*/locations/*/agents/*/flows/*}/trans" + + "itionRouteGroups\332A\006parent\022\367\001\n\027GetTransit" + + "ionRouteGroup\022B.google.cloud.dialogflow." + + "cx.v3beta1.GetTransitionRouteGroupReques" + + "t\0328.google.cloud.dialogflow.cx.v3beta1.T" + + "ransitionRouteGroup\"^\202\323\344\223\002Q\022O/v3beta1/{n" + + "ame=projects/*/locations/*/agents/*/flow" + + "s/*/transitionRouteGroups/*}\332A\004name\022\257\002\n\032" + + "CreateTransitionRouteGroup\022E.google.clou" + + "d.dialogflow.cx.v3beta1.CreateTransition" + + "RouteGroupRequest\0328.google.cloud.dialogf" + + "low.cx.v3beta1.TransitionRouteGroup\"\217\001\202\323" + + "\344\223\002i\"O/v3beta1/{parent=projects/*/locati" + + "ons/*/agents/*/flows/*}/transitionRouteG" + + "roups:\026transition_route_group\332A\035parent,t" + + "ransition_route_group\022\314\002\n\032UpdateTransiti" + + "onRouteGroup\022E.google.cloud.dialogflow.c" + + "x.v3beta1.UpdateTransitionRouteGroupRequ" + + "est\0328.google.cloud.dialogflow.cx.v3beta1" + + ".TransitionRouteGroup\"\254\001\202\323\344\223\002\200\0012f/v3beta" + + "1/{transition_route_group.name=projects/" + + "*/locations/*/agents/*/flows/*/transitio" + + "nRouteGroups/*}:\026transition_route_group\332" + + "A\"transition_route_group,update_mask\022\333\001\n" + + "\032DeleteTransitionRouteGroup\022E.google.clo" + + "ud.dialogflow.cx.v3beta1.DeleteTransitio" + + "nRouteGroupRequest\032\026.google.protobuf.Emp" + + "ty\"^\202\323\344\223\002Q*O/v3beta1/{name=projects/*/lo" + + "cations/*/agents/*/flows/*/transitionRou" + + "teGroups/*}\332A\004name\032x\312A\031dialogflow.google" + + "apis.com\322AYhttps://www.googleapis.com/au" + + "th/cloud-platform,https://www.googleapis" + + ".com/auth/dialogflowB\270\001\n&com.google.clou" + + "d.dialogflow.cx.v3beta1B\031TransitionRoute" + + "GroupProtoP\001ZDgoogle.golang.org/genproto" + + "/googleapis/cloud/dialogflow/cx/v3beta1;" + + "cx\370\001\001\242\002\002DF\252\002\"Google.Cloud.Dialogflow.Cx." + + "V3Beta1b\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.api.ResourceProto.getDescriptor(), + com.google.cloud.dialogflow.cx.v3beta1.PageProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRouteGroup_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRouteGroup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_TransitionRouteGroup_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "TransitionRoutes", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "LanguageCode", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListTransitionRouteGroupsResponse_descriptor, + new java.lang.String[] { + "TransitionRouteGroups", "NextPageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetTransitionRouteGroupRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetTransitionRouteGroupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_GetTransitionRouteGroupRequest_descriptor, + new java.lang.String[] { + "Name", "LanguageCode", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateTransitionRouteGroupRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateTransitionRouteGroupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateTransitionRouteGroupRequest_descriptor, + new java.lang.String[] { + "Parent", "TransitionRouteGroup", "LanguageCode", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateTransitionRouteGroupRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateTransitionRouteGroupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateTransitionRouteGroupRequest_descriptor, + new java.lang.String[] { + "TransitionRouteGroup", "UpdateMask", "LanguageCode", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteTransitionRouteGroupRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteTransitionRouteGroupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteTransitionRouteGroupRequest_descriptor, + new java.lang.String[] { + "Name", "Force", + }); + 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.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.dialogflow.cx.v3beta1.PageProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteOrBuilder.java new file mode 100644 index 000000000..cb0c51c47 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteOrBuilder.java @@ -0,0 +1,227 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface TransitionRouteOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.TransitionRoute) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The unique identifier of this transition route.
+   * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The unique identifier of this transition route.
+   * 
+ * + * string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The unique identifier of an [Intent][google.cloud.dialogflow.cx.v3beta1.Intent].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * Indicates that the transition can only happen when the given intent is
+   * matched.
+   * At least one of `intent` or `condition` must be specified. When both
+   * `intent` and `condition` are specified, the transition can only happen
+   * when both are fulfilled.
+   * 
+ * + * string intent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The intent. + */ + java.lang.String getIntent(); + /** + * + * + *
+   * The unique identifier of an [Intent][google.cloud.dialogflow.cx.v3beta1.Intent].
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/intents/<Intent ID>`.
+   * Indicates that the transition can only happen when the given intent is
+   * matched.
+   * At least one of `intent` or `condition` must be specified. When both
+   * `intent` and `condition` are specified, the transition can only happen
+   * when both are fulfilled.
+   * 
+ * + * string intent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for intent. + */ + com.google.protobuf.ByteString getIntentBytes(); + + /** + * + * + *
+   * The condition to evaluate against [form parameters][google.cloud.dialogflow.cx.v3beta1.Form.parameters] or
+   * [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+   * See the [conditions
+   * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+   * At least one of `intent` or `condition` must be specified. When both
+   * `intent` and `condition` are specified, the transition can only happen
+   * when both are fulfilled.
+   * 
+ * + * string condition = 2; + * + * @return The condition. + */ + java.lang.String getCondition(); + /** + * + * + *
+   * The condition to evaluate against [form parameters][google.cloud.dialogflow.cx.v3beta1.Form.parameters] or
+   * [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters].
+   * See the [conditions
+   * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
+   * At least one of `intent` or `condition` must be specified. When both
+   * `intent` and `condition` are specified, the transition can only happen
+   * when both are fulfilled.
+   * 
+ * + * string condition = 2; + * + * @return The bytes for condition. + */ + com.google.protobuf.ByteString getConditionBytes(); + + /** + * + * + *
+   * The fulfillment to call when the condition is satisfied. At least one of
+   * `trigger_fulfillment` and `target` must be specified. When both are
+   * defined, `trigger_fulfillment` is executed first.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + * + * @return Whether the triggerFulfillment field is set. + */ + boolean hasTriggerFulfillment(); + /** + * + * + *
+   * The fulfillment to call when the condition is satisfied. At least one of
+   * `trigger_fulfillment` and `target` must be specified. When both are
+   * defined, `trigger_fulfillment` is executed first.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + * + * @return The triggerFulfillment. + */ + com.google.cloud.dialogflow.cx.v3beta1.Fulfillment getTriggerFulfillment(); + /** + * + * + *
+   * The fulfillment to call when the condition is satisfied. At least one of
+   * `trigger_fulfillment` and `target` must be specified. When both are
+   * defined, `trigger_fulfillment` is executed first.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Fulfillment trigger_fulfillment = 3; + */ + com.google.cloud.dialogflow.cx.v3beta1.FulfillmentOrBuilder getTriggerFulfillmentOrBuilder(); + + /** + * + * + *
+   * The target page to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string target_page = 4 [(.google.api.resource_reference) = { ... } + * + * @return The targetPage. + */ + java.lang.String getTargetPage(); + /** + * + * + *
+   * The target page to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string target_page = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetPage. + */ + com.google.protobuf.ByteString getTargetPageBytes(); + + /** + * + * + *
+   * The target flow to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string target_flow = 5 [(.google.api.resource_reference) = { ... } + * + * @return The targetFlow. + */ + java.lang.String getTargetFlow(); + /** + * + * + *
+   * The target flow to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string target_flow = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetFlow. + */ + com.google.protobuf.ByteString getTargetFlowBytes(); + + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRoute.TargetCase getTargetCase(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateAgentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateAgentRequest.java new file mode 100644 index 000000000..fae08853f --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateAgentRequest.java @@ -0,0 +1,1042 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest} + */ +public final class UpdateAgentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest) + UpdateAgentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateAgentRequest.newBuilder() to construct. + private UpdateAgentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateAgentRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateAgentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateAgentRequest( + 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.dialogflow.cx.v3beta1.Agent.Builder subBuilder = null; + if (agent_ != null) { + subBuilder = agent_.toBuilder(); + } + agent_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Agent.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(agent_); + agent_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + 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.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateAgentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateAgentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest.Builder.class); + } + + public static final int AGENT_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.cx.v3beta1.Agent agent_; + /** + * + * + *
+   * Required. The agent to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the agent field is set. + */ + @java.lang.Override + public boolean hasAgent() { + return agent_ != null; + } + /** + * + * + *
+   * Required. The agent to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The agent. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Agent getAgent() { + return agent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Agent.getDefaultInstance() + : agent_; + } + /** + * + * + *
+   * Required. The agent to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder getAgentOrBuilder() { + return getAgent(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + 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 (agent_ != null) { + output.writeMessage(1, getAgent()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (agent_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAgent()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.dialogflow.cx.v3beta1.UpdateAgentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest) obj; + + if (hasAgent() != other.hasAgent()) return false; + if (hasAgent()) { + if (!getAgent().equals(other.getAgent())) 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(); + if (hasAgent()) { + hash = (37 * hash) + AGENT_FIELD_NUMBER; + hash = (53 * hash) + getAgent().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.dialogflow.cx.v3beta1.UpdateAgentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest 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.dialogflow.cx.v3beta1.UpdateAgentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest 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.dialogflow.cx.v3beta1.UpdateAgentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest 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.dialogflow.cx.v3beta1.UpdateAgentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest 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.dialogflow.cx.v3beta1.UpdateAgentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest 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.dialogflow.cx.v3beta1.UpdateAgentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest) + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateAgentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateAgentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (agentBuilder_ == null) { + agent_ = null; + } else { + agent_ = null; + agentBuilder_ = 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.dialogflow.cx.v3beta1.AgentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateAgentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest(this); + if (agentBuilder_ == null) { + result.agent_ = agent_; + } else { + result.agent_ = agentBuilder_.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.dialogflow.cx.v3beta1.UpdateAgentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest.getDefaultInstance()) + return this; + if (other.hasAgent()) { + mergeAgent(other.getAgent()); + } + 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.dialogflow.cx.v3beta1.UpdateAgentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Agent agent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Agent, + com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder> + agentBuilder_; + /** + * + * + *
+     * Required. The agent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the agent field is set. + */ + public boolean hasAgent() { + return agentBuilder_ != null || agent_ != null; + } + /** + * + * + *
+     * Required. The agent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The agent. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Agent getAgent() { + if (agentBuilder_ == null) { + return agent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Agent.getDefaultInstance() + : agent_; + } else { + return agentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The agent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAgent(com.google.cloud.dialogflow.cx.v3beta1.Agent value) { + if (agentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + agent_ = value; + onChanged(); + } else { + agentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The agent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAgent(com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder builderForValue) { + if (agentBuilder_ == null) { + agent_ = builderForValue.build(); + onChanged(); + } else { + agentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The agent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAgent(com.google.cloud.dialogflow.cx.v3beta1.Agent value) { + if (agentBuilder_ == null) { + if (agent_ != null) { + agent_ = + com.google.cloud.dialogflow.cx.v3beta1.Agent.newBuilder(agent_) + .mergeFrom(value) + .buildPartial(); + } else { + agent_ = value; + } + onChanged(); + } else { + agentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The agent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAgent() { + if (agentBuilder_ == null) { + agent_ = null; + onChanged(); + } else { + agent_ = null; + agentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The agent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder getAgentBuilder() { + + onChanged(); + return getAgentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The agent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder getAgentOrBuilder() { + if (agentBuilder_ != null) { + return agentBuilder_.getMessageOrBuilder(); + } else { + return agent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Agent.getDefaultInstance() + : agent_; + } + } + /** + * + * + *
+     * Required. The agent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Agent, + com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder> + getAgentFieldBuilder() { + if (agentBuilder_ == null) { + agentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Agent, + com.google.cloud.dialogflow.cx.v3beta1.Agent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder>( + getAgent(), getParentForChildren(), isClean()); + agent_ = null; + } + return agentBuilder_; + } + + 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_; + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.dialogflow.cx.v3beta1.UpdateAgentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateAgentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateAgentRequest(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.dialogflow.cx.v3beta1.UpdateAgentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateAgentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateAgentRequestOrBuilder.java new file mode 100644 index 000000000..f591289eb --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateAgentRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/agent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface UpdateAgentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The agent to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the agent field is set. + */ + boolean hasAgent(); + /** + * + * + *
+   * Required. The agent to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The agent. + */ + com.google.cloud.dialogflow.cx.v3beta1.Agent getAgent(); + /** + * + * + *
+   * Required. The agent to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.AgentOrBuilder getAgentOrBuilder(); + + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateEntityTypeRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateEntityTypeRequest.java new file mode 100644 index 000000000..ff393d694 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateEntityTypeRequest.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/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest} + */ +public final class UpdateEntityTypeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest) + UpdateEntityTypeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateEntityTypeRequest.newBuilder() to construct. + private UpdateEntityTypeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateEntityTypeRequest() { + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateEntityTypeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateEntityTypeRequest( + 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.dialogflow.cx.v3beta1.EntityType.Builder subBuilder = null; + if (entityType_ != null) { + subBuilder = entityType_.toBuilder(); + } + entityType_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(entityType_); + entityType_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + 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.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest.Builder.class); + } + + public static final int ENTITY_TYPE_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.cx.v3beta1.EntityType entityType_; + /** + * + * + *
+   * Required. The entity type to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the entityType field is set. + */ + @java.lang.Override + public boolean hasEntityType() { + return entityType_ != null; + } + /** + * + * + *
+   * Required. The entity type to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The entityType. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityType getEntityType() { + return entityType_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.EntityType.getDefaultInstance() + : entityType_; + } + /** + * + * + *
+   * Required. The entity type to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder getEntityTypeOrBuilder() { + return getEntityType(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language of the following fields in `entity_type`:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language of the following fields in `entity_type`:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + @java.lang.Override + 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 (entityType_ != null) { + output.writeMessage(1, getEntityType()); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + 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 (entityType_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEntityType()); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + 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.dialogflow.cx.v3beta1.UpdateEntityTypeRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest) obj; + + if (hasEntityType() != other.hasEntityType()) return false; + if (hasEntityType()) { + if (!getEntityType().equals(other.getEntityType())) return false; + } + if (!getLanguageCode().equals(other.getLanguageCode())) 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(); + if (hasEntityType()) { + hash = (37 * hash) + ENTITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEntityType().hashCode(); + } + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().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.dialogflow.cx.v3beta1.UpdateEntityTypeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest 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.dialogflow.cx.v3beta1.UpdateEntityTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest 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.dialogflow.cx.v3beta1.UpdateEntityTypeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest 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.dialogflow.cx.v3beta1.UpdateEntityTypeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest 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.dialogflow.cx.v3beta1.UpdateEntityTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest 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.dialogflow.cx.v3beta1.UpdateEntityTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest) + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (entityTypeBuilder_ == null) { + entityType_ = null; + } else { + entityType_ = null; + entityTypeBuilder_ = null; + } + languageCode_ = ""; + + 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.dialogflow.cx.v3beta1.EntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEntityTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest(this); + if (entityTypeBuilder_ == null) { + result.entityType_ = entityType_; + } else { + result.entityType_ = entityTypeBuilder_.build(); + } + result.languageCode_ = languageCode_; + 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.dialogflow.cx.v3beta1.UpdateEntityTypeRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest.getDefaultInstance()) + return this; + if (other.hasEntityType()) { + mergeEntityType(other.getEntityType()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + 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.dialogflow.cx.v3beta1.UpdateEntityTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.EntityType entityType_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder> + entityTypeBuilder_; + /** + * + * + *
+     * Required. The entity type to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the entityType field is set. + */ + public boolean hasEntityType() { + return entityTypeBuilder_ != null || entityType_ != null; + } + /** + * + * + *
+     * Required. The entity type to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The entityType. + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType getEntityType() { + if (entityTypeBuilder_ == null) { + return entityType_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.EntityType.getDefaultInstance() + : entityType_; + } else { + return entityTypeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The entity type to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEntityType(com.google.cloud.dialogflow.cx.v3beta1.EntityType value) { + if (entityTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + entityType_ = value; + onChanged(); + } else { + entityTypeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The entity type to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEntityType( + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder builderForValue) { + if (entityTypeBuilder_ == null) { + entityType_ = builderForValue.build(); + onChanged(); + } else { + entityTypeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The entity type to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeEntityType(com.google.cloud.dialogflow.cx.v3beta1.EntityType value) { + if (entityTypeBuilder_ == null) { + if (entityType_ != null) { + entityType_ = + com.google.cloud.dialogflow.cx.v3beta1.EntityType.newBuilder(entityType_) + .mergeFrom(value) + .buildPartial(); + } else { + entityType_ = value; + } + onChanged(); + } else { + entityTypeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The entity type to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearEntityType() { + if (entityTypeBuilder_ == null) { + entityType_ = null; + onChanged(); + } else { + entityType_ = null; + entityTypeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The entity type to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder getEntityTypeBuilder() { + + onChanged(); + return getEntityTypeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The entity type to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder getEntityTypeOrBuilder() { + if (entityTypeBuilder_ != null) { + return entityTypeBuilder_.getMessageOrBuilder(); + } else { + return entityType_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.EntityType.getDefaultInstance() + : entityType_; + } + } + /** + * + * + *
+     * Required. The entity type to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder> + getEntityTypeFieldBuilder() { + if (entityTypeBuilder_ == null) { + entityTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.EntityType, + com.google.cloud.dialogflow.cx.v3beta1.EntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder>( + getEntityType(), getParentForChildren(), isClean()); + entityType_ = null; + } + return entityTypeBuilder_; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language of the following fields in `entity_type`:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `entity_type`:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `entity_type`:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `entity_type`:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `entity_type`:
+     * *   `EntityType.entities.value`
+     * *   `EntityType.entities.synonyms`
+     * *   `EntityType.excluded_phrases.value`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @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.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @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(); + } + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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.dialogflow.cx.v3beta1.UpdateEntityTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateEntityTypeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateEntityTypeRequest(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.dialogflow.cx.v3beta1.UpdateEntityTypeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateEntityTypeRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateEntityTypeRequestOrBuilder.java new file mode 100644 index 000000000..6a43b0cfa --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateEntityTypeRequestOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface UpdateEntityTypeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The entity type to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the entityType field is set. + */ + boolean hasEntityType(); + /** + * + * + *
+   * Required. The entity type to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The entityType. + */ + com.google.cloud.dialogflow.cx.v3beta1.EntityType getEntityType(); + /** + * + * + *
+   * Required. The entity type to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.EntityTypeOrBuilder getEntityTypeOrBuilder(); + + /** + * + * + *
+   * The language of the following fields in `entity_type`:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language of the following fields in `entity_type`:
+   * *   `EntityType.entities.value`
+   * *   `EntityType.entities.synonyms`
+   * *   `EntityType.excluded_phrases.value`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateEnvironmentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateEnvironmentRequest.java new file mode 100644 index 000000000..6456b38c2 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateEnvironmentRequest.java @@ -0,0 +1,1051 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Environments.UpdateEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.UpdateEnvironment].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest} + */ +public final class UpdateEnvironmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest) + UpdateEnvironmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateEnvironmentRequest.newBuilder() to construct. + private UpdateEnvironmentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateEnvironmentRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateEnvironmentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateEnvironmentRequest( + 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.dialogflow.cx.v3beta1.Environment.Builder subBuilder = null; + if (environment_ != null) { + subBuilder = environment_.toBuilder(); + } + environment_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Environment.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(environment_); + environment_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + 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.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEnvironmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEnvironmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest.Builder.class); + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.cx.v3beta1.Environment environment_; + /** + * + * + *
+   * Required. The environment to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the environment field is set. + */ + @java.lang.Override + public boolean hasEnvironment() { + return environment_ != null; + } + /** + * + * + *
+   * Required. The environment to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironment() { + return environment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Environment.getDefaultInstance() + : environment_; + } + /** + * + * + *
+   * Required. The environment to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder getEnvironmentOrBuilder() { + return getEnvironment(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + 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 (environment_ != null) { + output.writeMessage(1, getEnvironment()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (environment_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEnvironment()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.dialogflow.cx.v3beta1.UpdateEnvironmentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest) obj; + + if (hasEnvironment() != other.hasEnvironment()) return false; + if (hasEnvironment()) { + if (!getEnvironment().equals(other.getEnvironment())) 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(); + if (hasEnvironment()) { + hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + getEnvironment().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.dialogflow.cx.v3beta1.UpdateEnvironmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest 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.dialogflow.cx.v3beta1.UpdateEnvironmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest 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.dialogflow.cx.v3beta1.UpdateEnvironmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest 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.dialogflow.cx.v3beta1.UpdateEnvironmentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest 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.dialogflow.cx.v3beta1.UpdateEnvironmentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest 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.dialogflow.cx.v3beta1.UpdateEnvironmentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Environments.UpdateEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.UpdateEnvironment].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest) + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEnvironmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEnvironmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (environmentBuilder_ == null) { + environment_ = null; + } else { + environment_ = null; + environmentBuilder_ = 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.dialogflow.cx.v3beta1.EnvironmentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateEnvironmentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest(this); + if (environmentBuilder_ == null) { + result.environment_ = environment_; + } else { + result.environment_ = environmentBuilder_.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.dialogflow.cx.v3beta1.UpdateEnvironmentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest.getDefaultInstance()) + return this; + if (other.hasEnvironment()) { + mergeEnvironment(other.getEnvironment()); + } + 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.dialogflow.cx.v3beta1.UpdateEnvironmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Environment environment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment, + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder> + environmentBuilder_; + /** + * + * + *
+     * Required. The environment to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the environment field is set. + */ + public boolean hasEnvironment() { + return environmentBuilder_ != null || environment_ != null; + } + /** + * + * + *
+     * Required. The environment to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The environment. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironment() { + if (environmentBuilder_ == null) { + return environment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Environment.getDefaultInstance() + : environment_; + } else { + return environmentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The environment to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEnvironment(com.google.cloud.dialogflow.cx.v3beta1.Environment value) { + if (environmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + environment_ = value; + onChanged(); + } else { + environmentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The environment to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEnvironment( + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder builderForValue) { + if (environmentBuilder_ == null) { + environment_ = builderForValue.build(); + onChanged(); + } else { + environmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The environment to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeEnvironment(com.google.cloud.dialogflow.cx.v3beta1.Environment value) { + if (environmentBuilder_ == null) { + if (environment_ != null) { + environment_ = + com.google.cloud.dialogflow.cx.v3beta1.Environment.newBuilder(environment_) + .mergeFrom(value) + .buildPartial(); + } else { + environment_ = value; + } + onChanged(); + } else { + environmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The environment to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearEnvironment() { + if (environmentBuilder_ == null) { + environment_ = null; + onChanged(); + } else { + environment_ = null; + environmentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The environment to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder getEnvironmentBuilder() { + + onChanged(); + return getEnvironmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The environment to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder getEnvironmentOrBuilder() { + if (environmentBuilder_ != null) { + return environmentBuilder_.getMessageOrBuilder(); + } else { + return environment_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Environment.getDefaultInstance() + : environment_; + } + } + /** + * + * + *
+     * Required. The environment to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment, + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder> + getEnvironmentFieldBuilder() { + if (environmentBuilder_ == null) { + environmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Environment, + com.google.cloud.dialogflow.cx.v3beta1.Environment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder>( + getEnvironment(), getParentForChildren(), isClean()); + environment_ = null; + } + return environmentBuilder_; + } + + 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_; + /** + * + * + *
+     * Required. The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Required. The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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.dialogflow.cx.v3beta1.UpdateEnvironmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateEnvironmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateEnvironmentRequest(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.dialogflow.cx.v3beta1.UpdateEnvironmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateEnvironmentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateEnvironmentRequestOrBuilder.java new file mode 100644 index 000000000..03f67eebe --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateEnvironmentRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/environment.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface UpdateEnvironmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The environment to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the environment field is set. + */ + boolean hasEnvironment(); + /** + * + * + *
+   * Required. The environment to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The environment. + */ + com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironment(); + /** + * + * + *
+   * Required. The environment to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.EnvironmentOrBuilder getEnvironmentOrBuilder(); + + /** + * + * + *
+   * Required. The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateFlowRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateFlowRequest.java new file mode 100644 index 000000000..e410f4d33 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateFlowRequest.java @@ -0,0 +1,1281 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Flows.UpdateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.UpdateFlow].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest} + */ +public final class UpdateFlowRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest) + UpdateFlowRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateFlowRequest.newBuilder() to construct. + private UpdateFlowRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateFlowRequest() { + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateFlowRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateFlowRequest( + 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.dialogflow.cx.v3beta1.Flow.Builder subBuilder = null; + if (flow_ != null) { + subBuilder = flow_.toBuilder(); + } + flow_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Flow.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(flow_); + flow_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + 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; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateFlowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateFlowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest.Builder.class); + } + + public static final int FLOW_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.cx.v3beta1.Flow flow_; + /** + * + * + *
+   * Required. The flow to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the flow field is set. + */ + @java.lang.Override + public boolean hasFlow() { + return flow_ != null; + } + /** + * + * + *
+   * Required. The flow to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The flow. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Flow getFlow() { + return flow_ == null ? com.google.cloud.dialogflow.cx.v3beta1.Flow.getDefaultInstance() : flow_; + } + /** + * + * + *
+   * Required. The flow to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder getFlowOrBuilder() { + return getFlow(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The mask to control which fields get updated. If `update_mask` is not
+   * specified, an error will be returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. The mask to control which fields get updated. If `update_mask` is not
+   * specified, an error will be returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. The mask to control which fields get updated. If `update_mask` is not
+   * specified, an error will be returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language of the following fields in `flow`:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language of the following fields in `flow`:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (flow_ != null) { + output.writeMessage(1, getFlow()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (flow_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFlow()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest) obj; + + if (hasFlow() != other.hasFlow()) return false; + if (hasFlow()) { + if (!getFlow().equals(other.getFlow())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFlow()) { + hash = (37 * hash) + FLOW_FIELD_NUMBER; + hash = (53 * hash) + getFlow().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest 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.dialogflow.cx.v3beta1.UpdateFlowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest 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.dialogflow.cx.v3beta1.UpdateFlowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest 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.dialogflow.cx.v3beta1.UpdateFlowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest 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.dialogflow.cx.v3beta1.UpdateFlowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest 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.dialogflow.cx.v3beta1.UpdateFlowRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Flows.UpdateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.UpdateFlow].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest) + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateFlowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateFlowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (flowBuilder_ == null) { + flow_ = null; + } else { + flow_ = null; + flowBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.FlowProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateFlowRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest(this); + if (flowBuilder_ == null) { + result.flow_ = flow_; + } else { + result.flow_ = flowBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest.getDefaultInstance()) + return this; + if (other.hasFlow()) { + mergeFlow(other.getFlow()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Flow flow_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Flow, + com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder> + flowBuilder_; + /** + * + * + *
+     * Required. The flow to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the flow field is set. + */ + public boolean hasFlow() { + return flowBuilder_ != null || flow_ != null; + } + /** + * + * + *
+     * Required. The flow to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The flow. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Flow getFlow() { + if (flowBuilder_ == null) { + return flow_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Flow.getDefaultInstance() + : flow_; + } else { + return flowBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The flow to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFlow(com.google.cloud.dialogflow.cx.v3beta1.Flow value) { + if (flowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + flow_ = value; + onChanged(); + } else { + flowBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The flow to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFlow(com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder builderForValue) { + if (flowBuilder_ == null) { + flow_ = builderForValue.build(); + onChanged(); + } else { + flowBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The flow to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFlow(com.google.cloud.dialogflow.cx.v3beta1.Flow value) { + if (flowBuilder_ == null) { + if (flow_ != null) { + flow_ = + com.google.cloud.dialogflow.cx.v3beta1.Flow.newBuilder(flow_) + .mergeFrom(value) + .buildPartial(); + } else { + flow_ = value; + } + onChanged(); + } else { + flowBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The flow to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFlow() { + if (flowBuilder_ == null) { + flow_ = null; + onChanged(); + } else { + flow_ = null; + flowBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The flow to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder getFlowBuilder() { + + onChanged(); + return getFlowFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The flow to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder getFlowOrBuilder() { + if (flowBuilder_ != null) { + return flowBuilder_.getMessageOrBuilder(); + } else { + return flow_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Flow.getDefaultInstance() + : flow_; + } + } + /** + * + * + *
+     * Required. The flow to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Flow, + com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder> + getFlowFieldBuilder() { + if (flowBuilder_ == null) { + flowBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Flow, + com.google.cloud.dialogflow.cx.v3beta1.Flow.Builder, + com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder>( + getFlow(), getParentForChildren(), isClean()); + flow_ = null; + } + return flowBuilder_; + } + + 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_; + /** + * + * + *
+     * Required. The mask to control which fields get updated. If `update_mask` is not
+     * specified, an error will be returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. If `update_mask` is not
+     * specified, an error will be returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. If `update_mask` is not
+     * specified, an error will be returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. If `update_mask` is not
+     * specified, an error will be returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. If `update_mask` is not
+     * specified, an error will be returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. If `update_mask` is not
+     * specified, an error will be returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. If `update_mask` is not
+     * specified, an error will be returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. If `update_mask` is not
+     * specified, an error will be returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. If `update_mask` is not
+     * specified, an error will be returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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_; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language of the following fields in `flow`:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `flow`:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `flow`:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `flow`:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `flow`:
+     * *  `Flow.event_handlers.trigger_fulfillment.messages`
+     * *  `Flow.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateFlowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateFlowRequest(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.dialogflow.cx.v3beta1.UpdateFlowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateFlowRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateFlowRequestOrBuilder.java new file mode 100644 index 000000000..7b31b182d --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateFlowRequestOrBuilder.java @@ -0,0 +1,146 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/flow.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface UpdateFlowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The flow to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the flow field is set. + */ + boolean hasFlow(); + /** + * + * + *
+   * Required. The flow to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The flow. + */ + com.google.cloud.dialogflow.cx.v3beta1.Flow getFlow(); + /** + * + * + *
+   * Required. The flow to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Flow flow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.FlowOrBuilder getFlowOrBuilder(); + + /** + * + * + *
+   * Required. The mask to control which fields get updated. If `update_mask` is not
+   * specified, an error will be returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The mask to control which fields get updated. If `update_mask` is not
+   * specified, an error will be returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The mask to control which fields get updated. If `update_mask` is not
+   * specified, an error will be returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * The language of the following fields in `flow`:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language of the following fields in `flow`:
+   * *  `Flow.event_handlers.trigger_fulfillment.messages`
+   * *  `Flow.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateIntentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateIntentRequest.java new file mode 100644 index 000000000..a284be2ce --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateIntentRequest.java @@ -0,0 +1,1265 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest} + */ +public final class UpdateIntentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest) + UpdateIntentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateIntentRequest.newBuilder() to construct. + private UpdateIntentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateIntentRequest() { + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateIntentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateIntentRequest( + 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.dialogflow.cx.v3beta1.Intent.Builder subBuilder = null; + if (intent_ != null) { + subBuilder = intent_.toBuilder(); + } + intent_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Intent.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(intent_); + intent_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + 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.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest.Builder.class); + } + + public static final int INTENT_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.cx.v3beta1.Intent intent_; + /** + * + * + *
+   * Required. The intent to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the intent field is set. + */ + @java.lang.Override + public boolean hasIntent() { + return intent_ != null; + } + /** + * + * + *
+   * Required. The intent to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The intent. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent() { + return intent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance() + : intent_; + } + /** + * + * + *
+   * Required. The intent to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder() { + return getIntent(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language of the following fields in `intent`:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language of the following fields in `intent`:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + @java.lang.Override + 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 (intent_ != null) { + output.writeMessage(1, getIntent()); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + 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 (intent_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getIntent()); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + 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.dialogflow.cx.v3beta1.UpdateIntentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest) obj; + + if (hasIntent() != other.hasIntent()) return false; + if (hasIntent()) { + if (!getIntent().equals(other.getIntent())) return false; + } + if (!getLanguageCode().equals(other.getLanguageCode())) 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(); + if (hasIntent()) { + hash = (37 * hash) + INTENT_FIELD_NUMBER; + hash = (53 * hash) + getIntent().hashCode(); + } + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().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.dialogflow.cx.v3beta1.UpdateIntentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest 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.dialogflow.cx.v3beta1.UpdateIntentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest 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.dialogflow.cx.v3beta1.UpdateIntentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest 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.dialogflow.cx.v3beta1.UpdateIntentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest 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.dialogflow.cx.v3beta1.UpdateIntentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest 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.dialogflow.cx.v3beta1.UpdateIntentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest) + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateIntentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateIntentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (intentBuilder_ == null) { + intent_ = null; + } else { + intent_ = null; + intentBuilder_ = null; + } + languageCode_ = ""; + + 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.dialogflow.cx.v3beta1.IntentProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateIntentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest(this); + if (intentBuilder_ == null) { + result.intent_ = intent_; + } else { + result.intent_ = intentBuilder_.build(); + } + result.languageCode_ = languageCode_; + 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.dialogflow.cx.v3beta1.UpdateIntentRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest.getDefaultInstance()) + return this; + if (other.hasIntent()) { + mergeIntent(other.getIntent()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + 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.dialogflow.cx.v3beta1.UpdateIntentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Intent intent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder> + intentBuilder_; + /** + * + * + *
+     * Required. The intent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the intent field is set. + */ + public boolean hasIntent() { + return intentBuilder_ != null || intent_ != null; + } + /** + * + * + *
+     * Required. The intent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The intent. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent() { + if (intentBuilder_ == null) { + return intent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance() + : intent_; + } else { + return intentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The intent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setIntent(com.google.cloud.dialogflow.cx.v3beta1.Intent value) { + if (intentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + intent_ = value; + onChanged(); + } else { + intentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The intent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setIntent( + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder builderForValue) { + if (intentBuilder_ == null) { + intent_ = builderForValue.build(); + onChanged(); + } else { + intentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The intent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeIntent(com.google.cloud.dialogflow.cx.v3beta1.Intent value) { + if (intentBuilder_ == null) { + if (intent_ != null) { + intent_ = + com.google.cloud.dialogflow.cx.v3beta1.Intent.newBuilder(intent_) + .mergeFrom(value) + .buildPartial(); + } else { + intent_ = value; + } + onChanged(); + } else { + intentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The intent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearIntent() { + if (intentBuilder_ == null) { + intent_ = null; + onChanged(); + } else { + intent_ = null; + intentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The intent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder getIntentBuilder() { + + onChanged(); + return getIntentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The intent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder() { + if (intentBuilder_ != null) { + return intentBuilder_.getMessageOrBuilder(); + } else { + return intent_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Intent.getDefaultInstance() + : intent_; + } + } + /** + * + * + *
+     * Required. The intent to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder> + getIntentFieldBuilder() { + if (intentBuilder_ == null) { + intentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Intent, + com.google.cloud.dialogflow.cx.v3beta1.Intent.Builder, + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder>( + getIntent(), getParentForChildren(), isClean()); + intent_ = null; + } + return intentBuilder_; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language of the following fields in `intent`:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `intent`:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `intent`:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `intent`:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `intent`:
+     * *   `Intent.training_phrases.parts.text`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @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.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @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(); + } + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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.dialogflow.cx.v3beta1.UpdateIntentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateIntentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateIntentRequest(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.dialogflow.cx.v3beta1.UpdateIntentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateIntentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateIntentRequestOrBuilder.java new file mode 100644 index 000000000..aaeb01a63 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateIntentRequestOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/intent.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface UpdateIntentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The intent to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the intent field is set. + */ + boolean hasIntent(); + /** + * + * + *
+   * Required. The intent to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The intent. + */ + com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent(); + /** + * + * + *
+   * Required. The intent to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder(); + + /** + * + * + *
+   * The language of the following fields in `intent`:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language of the following fields in `intent`:
+   * *   `Intent.training_phrases.parts.text`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdatePageRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdatePageRequest.java new file mode 100644 index 000000000..87ffc31cb --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdatePageRequest.java @@ -0,0 +1,1297 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest} + */ +public final class UpdatePageRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest) + UpdatePageRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdatePageRequest.newBuilder() to construct. + private UpdatePageRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdatePageRequest() { + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdatePageRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdatePageRequest( + 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.dialogflow.cx.v3beta1.Page.Builder subBuilder = null; + if (page_ != null) { + subBuilder = page_.toBuilder(); + } + page_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Page.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(page_); + page_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + 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.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdatePageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdatePageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest.Builder.class); + } + + public static final int PAGE_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.cx.v3beta1.Page page_; + /** + * + * + *
+   * Required. The page to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the page field is set. + */ + @java.lang.Override + public boolean hasPage() { + return page_ != null; + } + /** + * + * + *
+   * Required. The page to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The page. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Page getPage() { + return page_ == null ? com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance() : page_; + } + /** + * + * + *
+   * Required. The page to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getPageOrBuilder() { + return getPage(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language of the following fields in `page`:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language of the following fields in `page`:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + @java.lang.Override + 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 (page_ != null) { + output.writeMessage(1, getPage()); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + 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 (page_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPage()); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + 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.dialogflow.cx.v3beta1.UpdatePageRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest) obj; + + if (hasPage() != other.hasPage()) return false; + if (hasPage()) { + if (!getPage().equals(other.getPage())) return false; + } + if (!getLanguageCode().equals(other.getLanguageCode())) 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(); + if (hasPage()) { + hash = (37 * hash) + PAGE_FIELD_NUMBER; + hash = (53 * hash) + getPage().hashCode(); + } + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().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.dialogflow.cx.v3beta1.UpdatePageRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest 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.dialogflow.cx.v3beta1.UpdatePageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest 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.dialogflow.cx.v3beta1.UpdatePageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest 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.dialogflow.cx.v3beta1.UpdatePageRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest 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.dialogflow.cx.v3beta1.UpdatePageRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest 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.dialogflow.cx.v3beta1.UpdatePageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest) + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdatePageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdatePageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (pageBuilder_ == null) { + page_ = null; + } else { + page_ = null; + pageBuilder_ = null; + } + languageCode_ = ""; + + 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.dialogflow.cx.v3beta1.PageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdatePageRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest(this); + if (pageBuilder_ == null) { + result.page_ = page_; + } else { + result.page_ = pageBuilder_.build(); + } + result.languageCode_ = languageCode_; + 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.dialogflow.cx.v3beta1.UpdatePageRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest.getDefaultInstance()) + return this; + if (other.hasPage()) { + mergePage(other.getPage()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + 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.dialogflow.cx.v3beta1.UpdatePageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Page page_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder> + pageBuilder_; + /** + * + * + *
+     * Required. The page to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the page field is set. + */ + public boolean hasPage() { + return pageBuilder_ != null || page_ != null; + } + /** + * + * + *
+     * Required. The page to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The page. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Page getPage() { + if (pageBuilder_ == null) { + return page_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance() + : page_; + } else { + return pageBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The page to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPage(com.google.cloud.dialogflow.cx.v3beta1.Page value) { + if (pageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + page_ = value; + onChanged(); + } else { + pageBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The page to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPage(com.google.cloud.dialogflow.cx.v3beta1.Page.Builder builderForValue) { + if (pageBuilder_ == null) { + page_ = builderForValue.build(); + onChanged(); + } else { + pageBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The page to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePage(com.google.cloud.dialogflow.cx.v3beta1.Page value) { + if (pageBuilder_ == null) { + if (page_ != null) { + page_ = + com.google.cloud.dialogflow.cx.v3beta1.Page.newBuilder(page_) + .mergeFrom(value) + .buildPartial(); + } else { + page_ = value; + } + onChanged(); + } else { + pageBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The page to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPage() { + if (pageBuilder_ == null) { + page_ = null; + onChanged(); + } else { + page_ = null; + pageBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The page to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Page.Builder getPageBuilder() { + + onChanged(); + return getPageFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The page to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getPageOrBuilder() { + if (pageBuilder_ != null) { + return pageBuilder_.getMessageOrBuilder(); + } else { + return page_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Page.getDefaultInstance() + : page_; + } + } + /** + * + * + *
+     * Required. The page to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder> + getPageFieldBuilder() { + if (pageBuilder_ == null) { + pageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Page, + com.google.cloud.dialogflow.cx.v3beta1.Page.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder>( + getPage(), getParentForChildren(), isClean()); + page_ = null; + } + return pageBuilder_; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language of the following fields in `page`:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `page`:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language of the following fields in `page`:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `page`:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language of the following fields in `page`:
+     * *  `Page.entry_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+     * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+     * *  `Page.transition_route.trigger_fulfillment.messages`
+     * *
+     * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 2; + * + * @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.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @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(); + } + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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.dialogflow.cx.v3beta1.UpdatePageRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdatePageRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdatePageRequest(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.dialogflow.cx.v3beta1.UpdatePageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdatePageRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdatePageRequestOrBuilder.java new file mode 100644 index 000000000..fc7bb633d --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdatePageRequestOrBuilder.java @@ -0,0 +1,151 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/page.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface UpdatePageRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The page to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the page field is set. + */ + boolean hasPage(); + /** + * + * + *
+   * Required. The page to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The page. + */ + com.google.cloud.dialogflow.cx.v3beta1.Page getPage(); + /** + * + * + *
+   * Required. The page to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Page page = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.PageOrBuilder getPageOrBuilder(); + + /** + * + * + *
+   * The language of the following fields in `page`:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language of the following fields in `page`:
+   * *  `Page.entry_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
+   * *  `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
+   * *  `Page.transition_route.trigger_fulfillment.messages`
+   * *
+   * `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateSessionEntityTypeRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateSessionEntityTypeRequest.java new file mode 100644 index 000000000..b80234224 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateSessionEntityTypeRequest.java @@ -0,0 +1,1074 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.UpdateSessionEntityType].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest} + */ +public final class UpdateSessionEntityTypeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest) + UpdateSessionEntityTypeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateSessionEntityTypeRequest.newBuilder() to construct. + private UpdateSessionEntityTypeRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSessionEntityTypeRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateSessionEntityTypeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateSessionEntityTypeRequest( + 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.dialogflow.cx.v3beta1.SessionEntityType.Builder subBuilder = null; + if (sessionEntityType_ != null) { + subBuilder = sessionEntityType_.toBuilder(); + } + sessionEntityType_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sessionEntityType_); + sessionEntityType_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + 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.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateSessionEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateSessionEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest.Builder.class); + } + + public static final int SESSION_ENTITY_TYPE_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType sessionEntityType_; + /** + * + * + *
+   * Required. The session entity type to update.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sessionEntityType field is set. + */ + @java.lang.Override + public boolean hasSessionEntityType() { + return sessionEntityType_ != null; + } + /** + * + * + *
+   * Required. The session entity type to update.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sessionEntityType. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityType() { + return sessionEntityType_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.getDefaultInstance() + : sessionEntityType_; + } + /** + * + * + *
+   * Required. The session entity type to update.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder + getSessionEntityTypeOrBuilder() { + return getSessionEntityType(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + 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 (sessionEntityType_ != null) { + output.writeMessage(1, getSessionEntityType()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sessionEntityType_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSessionEntityType()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest) obj; + + if (hasSessionEntityType() != other.hasSessionEntityType()) return false; + if (hasSessionEntityType()) { + if (!getSessionEntityType().equals(other.getSessionEntityType())) 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(); + if (hasSessionEntityType()) { + hash = (37 * hash) + SESSION_ENTITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getSessionEntityType().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.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + 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.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest 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.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.UpdateSessionEntityType].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest) + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateSessionEntityTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateSessionEntityTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (sessionEntityTypeBuilder_ == null) { + sessionEntityType_ = null; + } else { + sessionEntityType_ = null; + sessionEntityTypeBuilder_ = 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.dialogflow.cx.v3beta1.SessionEntityTypeProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateSessionEntityTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest(this); + if (sessionEntityTypeBuilder_ == null) { + result.sessionEntityType_ = sessionEntityType_; + } else { + result.sessionEntityType_ = sessionEntityTypeBuilder_.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.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + .getDefaultInstance()) return this; + if (other.hasSessionEntityType()) { + mergeSessionEntityType(other.getSessionEntityType()); + } + 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.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType sessionEntityType_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder> + sessionEntityTypeBuilder_; + /** + * + * + *
+     * Required. The session entity type to update.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sessionEntityType field is set. + */ + public boolean hasSessionEntityType() { + return sessionEntityTypeBuilder_ != null || sessionEntityType_ != null; + } + /** + * + * + *
+     * Required. The session entity type to update.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sessionEntityType. + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityType() { + if (sessionEntityTypeBuilder_ == null) { + return sessionEntityType_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.getDefaultInstance() + : sessionEntityType_; + } else { + return sessionEntityTypeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The session entity type to update.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType value) { + if (sessionEntityTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sessionEntityType_ = value; + onChanged(); + } else { + sessionEntityTypeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The session entity type to update.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder builderForValue) { + if (sessionEntityTypeBuilder_ == null) { + sessionEntityType_ = builderForValue.build(); + onChanged(); + } else { + sessionEntityTypeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The session entity type to update.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSessionEntityType( + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType value) { + if (sessionEntityTypeBuilder_ == null) { + if (sessionEntityType_ != null) { + sessionEntityType_ = + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.newBuilder( + sessionEntityType_) + .mergeFrom(value) + .buildPartial(); + } else { + sessionEntityType_ = value; + } + onChanged(); + } else { + sessionEntityTypeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The session entity type to update.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSessionEntityType() { + if (sessionEntityTypeBuilder_ == null) { + sessionEntityType_ = null; + onChanged(); + } else { + sessionEntityType_ = null; + sessionEntityTypeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The session entity type to update.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder + getSessionEntityTypeBuilder() { + + onChanged(); + return getSessionEntityTypeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The session entity type to update.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder + getSessionEntityTypeOrBuilder() { + if (sessionEntityTypeBuilder_ != null) { + return sessionEntityTypeBuilder_.getMessageOrBuilder(); + } else { + return sessionEntityType_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.getDefaultInstance() + : sessionEntityType_; + } + } + /** + * + * + *
+     * Required. The session entity type to update.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder> + getSessionEntityTypeFieldBuilder() { + if (sessionEntityTypeBuilder_ == null) { + sessionEntityTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder>( + getSessionEntityType(), getParentForChildren(), isClean()); + sessionEntityType_ = null; + } + return sessionEntityTypeBuilder_; + } + + 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_; + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSessionEntityTypeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateSessionEntityTypeRequest(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.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateSessionEntityTypeRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateSessionEntityTypeRequestOrBuilder.java new file mode 100644 index 000000000..e971b66ce --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateSessionEntityTypeRequestOrBuilder.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/session_entity_type.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface UpdateSessionEntityTypeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The session entity type to update.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the sessionEntityType field is set. + */ + boolean hasSessionEntityType(); + /** + * + * + *
+   * Required. The session entity type to update.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sessionEntityType. + */ + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityType(); + /** + * + * + *
+   * Required. The session entity type to update.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>`.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder getSessionEntityTypeOrBuilder(); + + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateTransitionRouteGroupRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateTransitionRouteGroupRequest.java new file mode 100644 index 000000000..79371a1e7 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateTransitionRouteGroupRequest.java @@ -0,0 +1,1285 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [TransitionRouteGroups.UpdateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.UpdateTransitionRouteGroup].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest} + */ +public final class UpdateTransitionRouteGroupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest) + UpdateTransitionRouteGroupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateTransitionRouteGroupRequest.newBuilder() to construct. + private UpdateTransitionRouteGroupRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateTransitionRouteGroupRequest() { + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateTransitionRouteGroupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateTransitionRouteGroupRequest( + 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.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder subBuilder = null; + if (transitionRouteGroup_ != null) { + subBuilder = transitionRouteGroup_.toBuilder(); + } + transitionRouteGroup_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(transitionRouteGroup_); + transitionRouteGroup_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + 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; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateTransitionRouteGroupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateTransitionRouteGroupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest.Builder.class); + } + + public static final int TRANSITION_ROUTE_GROUP_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transitionRouteGroup_; + /** + * + * + *
+   * Required. The transition route group to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the transitionRouteGroup field is set. + */ + @java.lang.Override + public boolean hasTransitionRouteGroup() { + return transitionRouteGroup_ != null; + } + /** + * + * + *
+   * Required. The transition route group to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The transitionRouteGroup. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup getTransitionRouteGroup() { + return transitionRouteGroup_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.getDefaultInstance() + : transitionRouteGroup_; + } + /** + * + * + *
+   * Required. The transition route group to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder + getTransitionRouteGroupOrBuilder() { + return getTransitionRouteGroup(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (transitionRouteGroup_ != null) { + output.writeMessage(1, getTransitionRouteGroup()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (transitionRouteGroup_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTransitionRouteGroup()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest) obj; + + if (hasTransitionRouteGroup() != other.hasTransitionRouteGroup()) return false; + if (hasTransitionRouteGroup()) { + if (!getTransitionRouteGroup().equals(other.getTransitionRouteGroup())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTransitionRouteGroup()) { + hash = (37 * hash) + TRANSITION_ROUTE_GROUP_FIELD_NUMBER; + hash = (53 * hash) + getTransitionRouteGroup().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + 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.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest 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.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [TransitionRouteGroups.UpdateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.UpdateTransitionRouteGroup].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest) + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateTransitionRouteGroupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateTransitionRouteGroupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (transitionRouteGroupBuilder_ == null) { + transitionRouteGroup_ = null; + } else { + transitionRouteGroup_ = null; + transitionRouteGroupBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateTransitionRouteGroupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest(this); + if (transitionRouteGroupBuilder_ == null) { + result.transitionRouteGroup_ = transitionRouteGroup_; + } else { + result.transitionRouteGroup_ = transitionRouteGroupBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + .getDefaultInstance()) return this; + if (other.hasTransitionRouteGroup()) { + mergeTransitionRouteGroup(other.getTransitionRouteGroup()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transitionRouteGroup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder> + transitionRouteGroupBuilder_; + /** + * + * + *
+     * Required. The transition route group to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the transitionRouteGroup field is set. + */ + public boolean hasTransitionRouteGroup() { + return transitionRouteGroupBuilder_ != null || transitionRouteGroup_ != null; + } + /** + * + * + *
+     * Required. The transition route group to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The transitionRouteGroup. + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup getTransitionRouteGroup() { + if (transitionRouteGroupBuilder_ == null) { + return transitionRouteGroup_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.getDefaultInstance() + : transitionRouteGroup_; + } else { + return transitionRouteGroupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The transition route group to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup value) { + if (transitionRouteGroupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transitionRouteGroup_ = value; + onChanged(); + } else { + transitionRouteGroupBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The transition route group to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder builderForValue) { + if (transitionRouteGroupBuilder_ == null) { + transitionRouteGroup_ = builderForValue.build(); + onChanged(); + } else { + transitionRouteGroupBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The transition route group to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeTransitionRouteGroup( + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup value) { + if (transitionRouteGroupBuilder_ == null) { + if (transitionRouteGroup_ != null) { + transitionRouteGroup_ = + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.newBuilder( + transitionRouteGroup_) + .mergeFrom(value) + .buildPartial(); + } else { + transitionRouteGroup_ = value; + } + onChanged(); + } else { + transitionRouteGroupBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The transition route group to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearTransitionRouteGroup() { + if (transitionRouteGroupBuilder_ == null) { + transitionRouteGroup_ = null; + onChanged(); + } else { + transitionRouteGroup_ = null; + transitionRouteGroupBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The transition route group to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder + getTransitionRouteGroupBuilder() { + + onChanged(); + return getTransitionRouteGroupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The transition route group to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder + getTransitionRouteGroupOrBuilder() { + if (transitionRouteGroupBuilder_ != null) { + return transitionRouteGroupBuilder_.getMessageOrBuilder(); + } else { + return transitionRouteGroup_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.getDefaultInstance() + : transitionRouteGroup_; + } + } + /** + * + * + *
+     * Required. The transition route group to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder> + getTransitionRouteGroupFieldBuilder() { + if (transitionRouteGroupBuilder_ == null) { + transitionRouteGroupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup.Builder, + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder>( + getTransitionRouteGroup(), getParentForChildren(), isClean()); + transitionRouteGroup_ = null; + } + return transitionRouteGroupBuilder_; + } + + 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_; + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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_; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The language to list transition route groups for. The field
+     * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+     * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+     * If not specified, the agent's default language is used.
+     * [Many
+     * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+     * are supported.
+     * Note: languages must be enabled in the agent before they can be used.
+     * 
+ * + * string language_code = 3; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateTransitionRouteGroupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateTransitionRouteGroupRequest(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.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateTransitionRouteGroupRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateTransitionRouteGroupRequestOrBuilder.java new file mode 100644 index 000000000..aadba9b09 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateTransitionRouteGroupRequestOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/transition_route_group.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface UpdateTransitionRouteGroupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The transition route group to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the transitionRouteGroup field is set. + */ + boolean hasTransitionRouteGroup(); + /** + * + * + *
+   * Required. The transition route group to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The transitionRouteGroup. + */ + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup getTransitionRouteGroup(); + /** + * + * + *
+   * Required. The transition route group to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup transition_route_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupOrBuilder + getTransitionRouteGroupOrBuilder(); + + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The language to list transition route groups for. The field
+   * [`messages`][TransitionRoute.trigger_fulfillment.messages] in
+   * [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent.
+   * If not specified, the agent's default language is used.
+   * [Many
+   * languages](https://cloud.google.com/dialogflow/docs/reference/language)
+   * are supported.
+   * Note: languages must be enabled in the agent before they can be used.
+   * 
+ * + * string language_code = 3; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateVersionRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateVersionRequest.java new file mode 100644 index 000000000..8ff0717b2 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateVersionRequest.java @@ -0,0 +1,1055 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Versions.UpdateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.UpdateVersion].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest} + */ +public final class UpdateVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest) + UpdateVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateVersionRequest.newBuilder() to construct. + private UpdateVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateVersionRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateVersionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateVersionRequest( + 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.dialogflow.cx.v3beta1.Version.Builder subBuilder = null; + if (version_ != null) { + subBuilder = version_.toBuilder(); + } + version_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Version.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(version_); + version_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + 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.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest.Builder.class); + } + + public static final int VERSION_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.cx.v3beta1.Version version_; + /** + * + * + *
+   * Required. The version to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the version field is set. + */ + @java.lang.Override + public boolean hasVersion() { + return version_ != null; + } + /** + * + * + *
+   * Required. The version to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The version. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Version getVersion() { + return version_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Version.getDefaultInstance() + : version_; + } + /** + * + * + *
+   * Required. The version to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder getVersionOrBuilder() { + return getVersion(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The mask to control which fields get updated. Currently only `description`
+   * and `display_name` can be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. The mask to control which fields get updated. Currently only `description`
+   * and `display_name` can be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. The mask to control which fields get updated. Currently only `description`
+   * and `display_name` can be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + 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 (version_ != null) { + output.writeMessage(1, getVersion()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (version_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getVersion()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.dialogflow.cx.v3beta1.UpdateVersionRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest) obj; + + if (hasVersion() != other.hasVersion()) return false; + if (hasVersion()) { + if (!getVersion().equals(other.getVersion())) 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(); + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().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.dialogflow.cx.v3beta1.UpdateVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest 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.dialogflow.cx.v3beta1.UpdateVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest 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.dialogflow.cx.v3beta1.UpdateVersionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest 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.dialogflow.cx.v3beta1.UpdateVersionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest 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.dialogflow.cx.v3beta1.UpdateVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest 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.dialogflow.cx.v3beta1.UpdateVersionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Versions.UpdateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.UpdateVersion].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest) + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (versionBuilder_ == null) { + version_ = null; + } else { + version_ = null; + versionBuilder_ = 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.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest(this); + if (versionBuilder_ == null) { + result.version_ = version_; + } else { + result.version_ = versionBuilder_.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.dialogflow.cx.v3beta1.UpdateVersionRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest.getDefaultInstance()) + return this; + if (other.hasVersion()) { + mergeVersion(other.getVersion()); + } + 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.dialogflow.cx.v3beta1.UpdateVersionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Version version_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Version, + com.google.cloud.dialogflow.cx.v3beta1.Version.Builder, + com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder> + versionBuilder_; + /** + * + * + *
+     * Required. The version to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the version field is set. + */ + public boolean hasVersion() { + return versionBuilder_ != null || version_ != null; + } + /** + * + * + *
+     * Required. The version to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The version. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Version getVersion() { + if (versionBuilder_ == null) { + return version_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Version.getDefaultInstance() + : version_; + } else { + return versionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The version to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setVersion(com.google.cloud.dialogflow.cx.v3beta1.Version value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + onChanged(); + } else { + versionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The version to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setVersion( + com.google.cloud.dialogflow.cx.v3beta1.Version.Builder builderForValue) { + if (versionBuilder_ == null) { + version_ = builderForValue.build(); + onChanged(); + } else { + versionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The version to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeVersion(com.google.cloud.dialogflow.cx.v3beta1.Version value) { + if (versionBuilder_ == null) { + if (version_ != null) { + version_ = + com.google.cloud.dialogflow.cx.v3beta1.Version.newBuilder(version_) + .mergeFrom(value) + .buildPartial(); + } else { + version_ = value; + } + onChanged(); + } else { + versionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The version to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearVersion() { + if (versionBuilder_ == null) { + version_ = null; + onChanged(); + } else { + version_ = null; + versionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The version to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Version.Builder getVersionBuilder() { + + onChanged(); + return getVersionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The version to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder getVersionOrBuilder() { + if (versionBuilder_ != null) { + return versionBuilder_.getMessageOrBuilder(); + } else { + return version_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Version.getDefaultInstance() + : version_; + } + } + /** + * + * + *
+     * Required. The version to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Version, + com.google.cloud.dialogflow.cx.v3beta1.Version.Builder, + com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder> + getVersionFieldBuilder() { + if (versionBuilder_ == null) { + versionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Version, + com.google.cloud.dialogflow.cx.v3beta1.Version.Builder, + com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder>( + getVersion(), getParentForChildren(), isClean()); + version_ = null; + } + return versionBuilder_; + } + + 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_; + /** + * + * + *
+     * Required. The mask to control which fields get updated. Currently only `description`
+     * and `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. Currently only `description`
+     * and `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. Currently only `description`
+     * and `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. Currently only `description`
+     * and `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. Currently only `description`
+     * and `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. Currently only `description`
+     * and `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. Currently only `description`
+     * and `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. Currently only `description`
+     * and `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. The mask to control which fields get updated. Currently only `description`
+     * and `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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.dialogflow.cx.v3beta1.UpdateVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateVersionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateVersionRequest(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.dialogflow.cx.v3beta1.UpdateVersionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateVersionRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateVersionRequestOrBuilder.java new file mode 100644 index 000000000..700e4e7cf --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateVersionRequestOrBuilder.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface UpdateVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The version to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the version field is set. + */ + boolean hasVersion(); + /** + * + * + *
+   * Required. The version to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The version. + */ + com.google.cloud.dialogflow.cx.v3beta1.Version getVersion(); + /** + * + * + *
+   * Required. The version to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder getVersionOrBuilder(); + + /** + * + * + *
+   * Required. The mask to control which fields get updated. Currently only `description`
+   * and `display_name` can be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The mask to control which fields get updated. Currently only `description`
+   * and `display_name` can be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The mask to control which fields get updated. Currently only `description`
+   * and `display_name` can be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateWebhookRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateWebhookRequest.java new file mode 100644 index 000000000..f1f9b3d16 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateWebhookRequest.java @@ -0,0 +1,1043 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook].
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest} + */ +public final class UpdateWebhookRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest) + UpdateWebhookRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateWebhookRequest.newBuilder() to construct. + private UpdateWebhookRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateWebhookRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateWebhookRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateWebhookRequest( + 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.dialogflow.cx.v3beta1.Webhook.Builder subBuilder = null; + if (webhook_ != null) { + subBuilder = webhook_.toBuilder(); + } + webhook_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(webhook_); + webhook_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + 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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateWebhookRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateWebhookRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest.Builder.class); + } + + public static final int WEBHOOK_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.cx.v3beta1.Webhook webhook_; + /** + * + * + *
+   * Required. The webhook to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the webhook field is set. + */ + @java.lang.Override + public boolean hasWebhook() { + return webhook_ != null; + } + /** + * + * + *
+   * Required. The webhook to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The webhook. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Webhook getWebhook() { + return webhook_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Webhook.getDefaultInstance() + : webhook_; + } + /** + * + * + *
+   * Required. The webhook to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder getWebhookOrBuilder() { + return getWebhook(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + 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 (webhook_ != null) { + output.writeMessage(1, getWebhook()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (webhook_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getWebhook()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.dialogflow.cx.v3beta1.UpdateWebhookRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest) obj; + + if (hasWebhook() != other.hasWebhook()) return false; + if (hasWebhook()) { + if (!getWebhook().equals(other.getWebhook())) 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(); + if (hasWebhook()) { + hash = (37 * hash) + WEBHOOK_FIELD_NUMBER; + hash = (53 * hash) + getWebhook().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.dialogflow.cx.v3beta1.UpdateWebhookRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest 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.dialogflow.cx.v3beta1.UpdateWebhookRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest 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.dialogflow.cx.v3beta1.UpdateWebhookRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest 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.dialogflow.cx.v3beta1.UpdateWebhookRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest 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.dialogflow.cx.v3beta1.UpdateWebhookRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest 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.dialogflow.cx.v3beta1.UpdateWebhookRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook].
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest) + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateWebhookRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateWebhookRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (webhookBuilder_ == null) { + webhook_ = null; + } else { + webhook_ = null; + webhookBuilder_ = 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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateWebhookRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest(this); + if (webhookBuilder_ == null) { + result.webhook_ = webhook_; + } else { + result.webhook_ = webhookBuilder_.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.dialogflow.cx.v3beta1.UpdateWebhookRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest.getDefaultInstance()) + return this; + if (other.hasWebhook()) { + mergeWebhook(other.getWebhook()); + } + 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.dialogflow.cx.v3beta1.UpdateWebhookRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.Webhook webhook_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Webhook, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder> + webhookBuilder_; + /** + * + * + *
+     * Required. The webhook to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the webhook field is set. + */ + public boolean hasWebhook() { + return webhookBuilder_ != null || webhook_ != null; + } + /** + * + * + *
+     * Required. The webhook to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The webhook. + */ + public com.google.cloud.dialogflow.cx.v3beta1.Webhook getWebhook() { + if (webhookBuilder_ == null) { + return webhook_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Webhook.getDefaultInstance() + : webhook_; + } else { + return webhookBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The webhook to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWebhook(com.google.cloud.dialogflow.cx.v3beta1.Webhook value) { + if (webhookBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + webhook_ = value; + onChanged(); + } else { + webhookBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The webhook to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWebhook( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder builderForValue) { + if (webhookBuilder_ == null) { + webhook_ = builderForValue.build(); + onChanged(); + } else { + webhookBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The webhook to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWebhook(com.google.cloud.dialogflow.cx.v3beta1.Webhook value) { + if (webhookBuilder_ == null) { + if (webhook_ != null) { + webhook_ = + com.google.cloud.dialogflow.cx.v3beta1.Webhook.newBuilder(webhook_) + .mergeFrom(value) + .buildPartial(); + } else { + webhook_ = value; + } + onChanged(); + } else { + webhookBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The webhook to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearWebhook() { + if (webhookBuilder_ == null) { + webhook_ = null; + onChanged(); + } else { + webhook_ = null; + webhookBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The webhook to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder getWebhookBuilder() { + + onChanged(); + return getWebhookFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The webhook to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder getWebhookOrBuilder() { + if (webhookBuilder_ != null) { + return webhookBuilder_.getMessageOrBuilder(); + } else { + return webhook_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.Webhook.getDefaultInstance() + : webhook_; + } + } + /** + * + * + *
+     * Required. The webhook to update.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Webhook, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder> + getWebhookFieldBuilder() { + if (webhookBuilder_ == null) { + webhookBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Webhook, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder>( + getWebhook(), getParentForChildren(), isClean()); + webhook_ = null; + } + return webhookBuilder_; + } + + 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_; + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The mask to control which fields get updated. If the mask is not present,
+     * all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.dialogflow.cx.v3beta1.UpdateWebhookRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateWebhookRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateWebhookRequest(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.dialogflow.cx.v3beta1.UpdateWebhookRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateWebhookRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateWebhookRequestOrBuilder.java new file mode 100644 index 000000000..169ad9fd6 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/UpdateWebhookRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface UpdateWebhookRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The webhook to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the webhook field is set. + */ + boolean hasWebhook(); + /** + * + * + *
+   * Required. The webhook to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The webhook. + */ + com.google.cloud.dialogflow.cx.v3beta1.Webhook getWebhook(); + /** + * + * + *
+   * Required. The webhook to update.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Webhook webhook = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder getWebhookOrBuilder(); + + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The mask to control which fields get updated. If the mask is not present,
+   * all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Version.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Version.java new file mode 100644 index 000000000..f36e7f86d --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Version.java @@ -0,0 +1,1965 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Represents a version of a flow.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Version} + */ +public final class Version extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Version) + VersionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Version.newBuilder() to construct. + private Version(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Version() { + name_ = ""; + displayName_ = ""; + description_ = ""; + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Version(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Version( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: + { + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.Builder subBuilder = null; + if (nluSettings_ != null) { + subBuilder = nluSettings_.toBuilder(); + } + nluSettings_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(nluSettings_); + nluSettings_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + 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 48: + { + int rawValue = input.readEnum(); + + state_ = 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.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Version_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Version_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Version.class, + com.google.cloud.dialogflow.cx.v3beta1.Version.Builder.class); + } + + /** + * + * + *
+   * The state of the version.
+   * 
+ * + * Protobuf enum {@code google.cloud.dialogflow.cx.v3beta1.Version.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. This value is not used.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Version is not ready to serve (e.g. training is running).
+     * 
+ * + * RUNNING = 1; + */ + RUNNING(1), + /** + * + * + *
+     * Training has succeeded and this version is ready to serve.
+     * 
+ * + * SUCCEEDED = 2; + */ + SUCCEEDED(2), + /** + * + * + *
+     * Version training failed.
+     * 
+ * + * FAILED = 3; + */ + FAILED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. This value is not used.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Version is not ready to serve (e.g. training is running).
+     * 
+ * + * RUNNING = 1; + */ + public static final int RUNNING_VALUE = 1; + /** + * + * + *
+     * Training has succeeded and this version is ready to serve.
+     * 
+ * + * SUCCEEDED = 2; + */ + public static final int SUCCEEDED_VALUE = 2; + /** + * + * + *
+     * Version training failed.
+     * 
+ * + * FAILED = 3; + */ + public static final int FAILED_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 State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return RUNNING; + case 2: + return SUCCEEDED; + case 3: + return FAILED; + 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 State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.Version.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State 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 State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.Version.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>. Version ID is a self-increasing
+   * number generated by Dialogflow upon version creation.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>. Version ID is a self-increasing
+   * number generated by Dialogflow upon version creation.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required. The human-readable name of the version. Limit of 64 characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The human-readable name of the version. Limit of 64 characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * The description of the version. The maximum length is 500 characters. If
+   * exceeded, the request is rejected.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The description of the version. The maximum length is 500 characters. If
+   * exceeded, the request is rejected.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + 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 NLU_SETTINGS_FIELD_NUMBER = 4; + private com.google.cloud.dialogflow.cx.v3beta1.NluSettings nluSettings_; + /** + * + * + *
+   * Output only. The NLU settings of the flow at version creation.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nluSettings field is set. + */ + @java.lang.Override + public boolean hasNluSettings() { + return nluSettings_ != null; + } + /** + * + * + *
+   * Output only. The NLU settings of the flow at version creation.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nluSettings. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.NluSettings getNluSettings() { + return nluSettings_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.NluSettings.getDefaultInstance() + : nluSettings_; + } + /** + * + * + *
+   * Output only. The NLU settings of the flow at version creation.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.NluSettingsOrBuilder getNluSettingsOrBuilder() { + return getNluSettings(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time of the version.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Create time of the version.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Create time of the version.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int STATE_FIELD_NUMBER = 6; + private int state_; + /** + * + * + *
+   * Output only. The state of this version. This field is read-only and cannot be set by
+   * create and update methods.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The state of this version. This field is read-only and cannot be set by
+   * create and update methods.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Version.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.Version.State result = + com.google.cloud.dialogflow.cx.v3beta1.Version.State.valueOf(state_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.Version.State.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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (nluSettings_ != null) { + output.writeMessage(4, getNluSettings()); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (state_ + != com.google.cloud.dialogflow.cx.v3beta1.Version.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, state_); + } + 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 (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (nluSettings_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getNluSettings()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (state_ + != com.google.cloud.dialogflow.cx.v3beta1.Version.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, state_); + } + 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.dialogflow.cx.v3beta1.Version)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Version other = + (com.google.cloud.dialogflow.cx.v3beta1.Version) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasNluSettings() != other.hasNluSettings()) return false; + if (hasNluSettings()) { + if (!getNluSettings().equals(other.getNluSettings())) return false; + } + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (state_ != other.state_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasNluSettings()) { + hash = (37 * hash) + NLU_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getNluSettings().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Version parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Version 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.dialogflow.cx.v3beta1.Version parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Version 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.dialogflow.cx.v3beta1.Version parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Version parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Version parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Version 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.dialogflow.cx.v3beta1.Version parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Version 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.dialogflow.cx.v3beta1.Version parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Version 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.dialogflow.cx.v3beta1.Version prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents a version of a flow.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Version} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Version) + com.google.cloud.dialogflow.cx.v3beta1.VersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Version_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Version_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Version.class, + com.google.cloud.dialogflow.cx.v3beta1.Version.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.Version.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_ = ""; + + displayName_ = ""; + + description_ = ""; + + if (nluSettingsBuilder_ == null) { + nluSettings_ = null; + } else { + nluSettings_ = null; + nluSettingsBuilder_ = null; + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + state_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.VersionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Version_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Version getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Version.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Version build() { + com.google.cloud.dialogflow.cx.v3beta1.Version result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Version buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Version result = + new com.google.cloud.dialogflow.cx.v3beta1.Version(this); + result.name_ = name_; + result.displayName_ = displayName_; + result.description_ = description_; + if (nluSettingsBuilder_ == null) { + result.nluSettings_ = nluSettings_; + } else { + result.nluSettings_ = nluSettingsBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.state_ = state_; + 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.dialogflow.cx.v3beta1.Version) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.Version) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Version other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.Version.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasNluSettings()) { + mergeNluSettings(other.getNluSettings()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + 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.dialogflow.cx.v3beta1.Version parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.dialogflow.cx.v3beta1.Version) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>. Version ID is a self-increasing
+     * number generated by Dialogflow upon version creation.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>. Version ID is a self-increasing
+     * number generated by Dialogflow upon version creation.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>. Version ID is a self-increasing
+     * number generated by Dialogflow upon version creation.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>. Version ID is a self-increasing
+     * number generated by Dialogflow upon version creation.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/versions/<Version ID>. Version ID is a self-increasing
+     * number generated by Dialogflow upon version creation.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The human-readable name of the version. Limit of 64 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the version. Limit of 64 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the version. Limit of 64 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the version. Limit of 64 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the version. Limit of 64 characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * The description of the version. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @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; + } + } + /** + * + * + *
+     * The description of the version. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @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; + } + } + /** + * + * + *
+     * The description of the version. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @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; + } + /** + * + * + *
+     * The description of the version. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the version. The maximum length is 500 characters. If
+     * exceeded, the request is rejected.
+     * 
+ * + * string description = 3; + * + * @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.dialogflow.cx.v3beta1.NluSettings nluSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.NluSettings, + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.Builder, + com.google.cloud.dialogflow.cx.v3beta1.NluSettingsOrBuilder> + nluSettingsBuilder_; + /** + * + * + *
+     * Output only. The NLU settings of the flow at version creation.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nluSettings field is set. + */ + public boolean hasNluSettings() { + return nluSettingsBuilder_ != null || nluSettings_ != null; + } + /** + * + * + *
+     * Output only. The NLU settings of the flow at version creation.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nluSettings. + */ + public com.google.cloud.dialogflow.cx.v3beta1.NluSettings getNluSettings() { + if (nluSettingsBuilder_ == null) { + return nluSettings_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.NluSettings.getDefaultInstance() + : nluSettings_; + } else { + return nluSettingsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The NLU settings of the flow at version creation.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNluSettings(com.google.cloud.dialogflow.cx.v3beta1.NluSettings value) { + if (nluSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + nluSettings_ = value; + onChanged(); + } else { + nluSettingsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The NLU settings of the flow at version creation.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNluSettings( + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.Builder builderForValue) { + if (nluSettingsBuilder_ == null) { + nluSettings_ = builderForValue.build(); + onChanged(); + } else { + nluSettingsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The NLU settings of the flow at version creation.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeNluSettings(com.google.cloud.dialogflow.cx.v3beta1.NluSettings value) { + if (nluSettingsBuilder_ == null) { + if (nluSettings_ != null) { + nluSettings_ = + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.newBuilder(nluSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + nluSettings_ = value; + } + onChanged(); + } else { + nluSettingsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The NLU settings of the flow at version creation.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearNluSettings() { + if (nluSettingsBuilder_ == null) { + nluSettings_ = null; + onChanged(); + } else { + nluSettings_ = null; + nluSettingsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The NLU settings of the flow at version creation.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.NluSettings.Builder getNluSettingsBuilder() { + + onChanged(); + return getNluSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The NLU settings of the flow at version creation.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.NluSettingsOrBuilder getNluSettingsOrBuilder() { + if (nluSettingsBuilder_ != null) { + return nluSettingsBuilder_.getMessageOrBuilder(); + } else { + return nluSettings_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.NluSettings.getDefaultInstance() + : nluSettings_; + } + } + /** + * + * + *
+     * Output only. The NLU settings of the flow at version creation.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.NluSettings, + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.Builder, + com.google.cloud.dialogflow.cx.v3beta1.NluSettingsOrBuilder> + getNluSettingsFieldBuilder() { + if (nluSettingsBuilder_ == null) { + nluSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.NluSettings, + com.google.cloud.dialogflow.cx.v3beta1.NluSettings.Builder, + com.google.cloud.dialogflow.cx.v3beta1.NluSettingsOrBuilder>( + getNluSettings(), getParentForChildren(), isClean()); + nluSettings_ = null; + } + return nluSettingsBuilder_; + } + + 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_; + /** + * + * + *
+     * Output only. Create time of the version.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Create time of the version.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Output only. Create time of the version.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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; + } + /** + * + * + *
+     * Output only. Create time of the version.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Create time of the version.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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; + } + /** + * + * + *
+     * Output only. Create time of the version.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Create time of the version.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Create time of the version.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Create time of the version.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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 int state_ = 0; + /** + * + * + *
+     * Output only. The state of this version. This field is read-only and cannot be set by
+     * create and update methods.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The state of this version. This field is read-only and cannot be set by
+     * create and update methods.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The state of this version. This field is read-only and cannot be set by
+     * create and update methods.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Version.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.Version.State result = + com.google.cloud.dialogflow.cx.v3beta1.Version.State.valueOf(state_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.Version.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The state of this version. This field is read-only and cannot be set by
+     * create and update methods.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.dialogflow.cx.v3beta1.Version.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The state of this version. This field is read-only and cannot be set by
+     * create and update methods.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 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.dialogflow.cx.v3beta1.Version) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Version) + private static final com.google.cloud.dialogflow.cx.v3beta1.Version DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Version(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Version getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Version parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Version(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.dialogflow.cx.v3beta1.Version getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionName.java new file mode 100644 index 000000000..1a80539be --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionName.java @@ -0,0 +1,268 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 VersionName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String agent; + private final String flow; + private final String version; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getFlow() { + return flow; + } + + public String getVersion() { + return version; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private VersionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + flow = Preconditions.checkNotNull(builder.getFlow()); + version = Preconditions.checkNotNull(builder.getVersion()); + } + + public static VersionName of( + String project, String location, String agent, String flow, String version) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setFlow(flow) + .setVersion(version) + .build(); + } + + public static String format( + String project, String location, String agent, String flow, String version) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setFlow(flow) + .setVersion(version) + .build() + .toString(); + } + + public static VersionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "VersionName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("agent"), + matchMap.get("flow"), + matchMap.get("version")); + } + + 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 (VersionName 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("agent", agent); + fieldMapBuilder.put("flow", flow); + fieldMapBuilder.put("version", version); + 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, "agent", agent, "flow", flow, "version", version); + } + + /** Builder for VersionName. */ + public static class Builder { + + private String project; + private String location; + private String agent; + private String flow; + private String version; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getFlow() { + return flow; + } + + public String getVersion() { + return version; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAgent(String agent) { + this.agent = agent; + return this; + } + + public Builder setFlow(String flow) { + this.flow = flow; + return this; + } + + public Builder setVersion(String version) { + this.version = version; + return this; + } + + private Builder() {} + + private Builder(VersionName versionName) { + project = versionName.project; + location = versionName.location; + agent = versionName.agent; + flow = versionName.flow; + version = versionName.version; + } + + public VersionName build() { + return new VersionName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof VersionName) { + VersionName that = (VersionName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.agent.equals(that.agent)) + && (this.flow.equals(that.flow)) + && (this.version.equals(that.version)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= agent.hashCode(); + h *= 1000003; + h ^= flow.hashCode(); + h *= 1000003; + h ^= version.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionOrBuilder.java new file mode 100644 index 000000000..ea44e274b --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionOrBuilder.java @@ -0,0 +1,216 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface VersionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Version) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>. Version ID is a self-increasing
+   * number generated by Dialogflow upon version creation.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/versions/<Version ID>. Version ID is a self-increasing
+   * number generated by Dialogflow upon version creation.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The human-readable name of the version. Limit of 64 characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The human-readable name of the version. Limit of 64 characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The description of the version. The maximum length is 500 characters. If
+   * exceeded, the request is rejected.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * The description of the version. The maximum length is 500 characters. If
+   * exceeded, the request is rejected.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The NLU settings of the flow at version creation.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nluSettings field is set. + */ + boolean hasNluSettings(); + /** + * + * + *
+   * Output only. The NLU settings of the flow at version creation.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nluSettings. + */ + com.google.cloud.dialogflow.cx.v3beta1.NluSettings getNluSettings(); + /** + * + * + *
+   * Output only. The NLU settings of the flow at version creation.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.NluSettings nlu_settings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.NluSettingsOrBuilder getNluSettingsOrBuilder(); + + /** + * + * + *
+   * Output only. Create time of the version.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time of the version.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time of the version.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The state of this version. This field is read-only and cannot be set by
+   * create and update methods.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The state of this version. This field is read-only and cannot be set by
+   * create and update methods.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.Version.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.dialogflow.cx.v3beta1.Version.State getState(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionProto.java new file mode 100644 index 000000000..86f16c116 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionProto.java @@ -0,0 +1,272 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/version.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class VersionProto { + private VersionProto() {} + + 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_dialogflow_cx_v3beta1_CreateVersionOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Version_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Version_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_GetVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_GetVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_LoadVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_LoadVersionRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/dialogflow/cx/v3beta1/ver" + + "sion.proto\022\"google.cloud.dialogflow.cx.v" + + "3beta1\032\034google/api/annotations.proto\032\027go" + + "ogle/api/client.proto\032\037google/api/field_" + + "behavior.proto\032\031google/api/resource.prot" + + "o\032-google/cloud/dialogflow/cx/v3beta1/fl" + + "ow.proto\032#google/longrunning/operations." + + "proto\032\033google/protobuf/empty.proto\032 goog" + + "le/protobuf/field_mask.proto\032\037google/pro" + + "tobuf/timestamp.proto\"Y\n\036CreateVersionOp" + + "erationMetadata\0227\n\007version\030\001 \001(\tB&\372A#\n!d" + + "ialogflow.googleapis.com/Version\"\330\003\n\007Ver" + + "sion\022\014\n\004name\030\001 \001(\t\022\031\n\014display_name\030\002 \001(\t" + + "B\003\340A\002\022\023\n\013description\030\003 \001(\t\022J\n\014nlu_settin" + + "gs\030\004 \001(\0132/.google.cloud.dialogflow.cx.v3" + + "beta1.NluSettingsB\003\340A\003\0224\n\013create_time\030\005 " + + "\001(\0132\032.google.protobuf.TimestampB\003\340A\003\022E\n\005" + + "state\030\006 \001(\01621.google.cloud.dialogflow.cx" + + ".v3beta1.Version.StateB\003\340A\003\"F\n\005State\022\025\n\021" + + "STATE_UNSPECIFIED\020\000\022\013\n\007RUNNING\020\001\022\r\n\tSUCC" + + "EEDED\020\002\022\n\n\006FAILED\020\003:~\352A{\n!dialogflow.goo" + + "gleapis.com/Version\022Vprojects/{project}/" + + "locations/{location}/agents/{agent}/flow" + + "s/{flow}/versions/{version}\"w\n\023ListVersi" + + "onsRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\022!dial" + + "ogflow.googleapis.com/Version\022\021\n\tpage_si" + + "ze\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"n\n\024ListVers" + + "ionsResponse\022=\n\010versions\030\001 \003(\0132+.google." + + "cloud.dialogflow.cx.v3beta1.Version\022\027\n\017n" + + "ext_page_token\030\002 \001(\t\"L\n\021GetVersionReques" + + "t\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!dialogflow.goog" + + "leapis.com/Version\"\224\001\n\024CreateVersionRequ" + + "est\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\022!dialogflow." + + "googleapis.com/Version\022A\n\007version\030\002 \001(\0132" + + "+.google.cloud.dialogflow.cx.v3beta1.Ver" + + "sionB\003\340A\002\"\217\001\n\024UpdateVersionRequest\022A\n\007ve" + + "rsion\030\001 \001(\0132+.google.cloud.dialogflow.cx" + + ".v3beta1.VersionB\003\340A\002\0224\n\013update_mask\030\002 \001" + + "(\0132\032.google.protobuf.FieldMaskB\003\340A\002\"O\n\024D" + + "eleteVersionRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372A" + + "#\n!dialogflow.googleapis.com/Version\"u\n\022" + + "LoadVersionRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#" + + "\n!dialogflow.googleapis.com/Version\022&\n\036a" + + "llow_override_agent_resources\030\002 \001(\0102\271\013\n\010" + + "Versions\022\326\001\n\014ListVersions\0227.google.cloud" + + ".dialogflow.cx.v3beta1.ListVersionsReque" + + "st\0328.google.cloud.dialogflow.cx.v3beta1." + + "ListVersionsResponse\"S\202\323\344\223\002D\022B/v3beta1/{" + + "parent=projects/*/locations/*/agents/*/f" + + "lows/*}/versions\332A\006parent\022\303\001\n\nGetVersion" + + "\0225.google.cloud.dialogflow.cx.v3beta1.Ge" + + "tVersionRequest\032+.google.cloud.dialogflo" + + "w.cx.v3beta1.Version\"Q\202\323\344\223\002D\022B/v3beta1/{" + + "name=projects/*/locations/*/agents/*/flo" + + "ws/*/versions/*}\332A\004name\022\373\001\n\rCreateVersio" + + "n\0228.google.cloud.dialogflow.cx.v3beta1.C" + + "reateVersionRequest\032\035.google.longrunning" + + ".Operation\"\220\001\202\323\344\223\002M\"B/v3beta1/{parent=pr" + + "ojects/*/locations/*/agents/*/flows/*}/v" + + "ersions:\007version\332A\016parent,version\312A)\n\007Ve" + + "rsion\022\036CreateVersionOperationMetadata\022\351\001" + + "\n\rUpdateVersion\0228.google.cloud.dialogflo" + + "w.cx.v3beta1.UpdateVersionRequest\032+.goog" + + "le.cloud.dialogflow.cx.v3beta1.Version\"q" + + "\202\323\344\223\002U2J/v3beta1/{version.name=projects/" + + "*/locations/*/agents/*/flows/*/versions/" + + "*}:\007version\332A\023version,update_mask\022\264\001\n\rDe" + + "leteVersion\0228.google.cloud.dialogflow.cx" + + ".v3beta1.DeleteVersionRequest\032\026.google.p" + + "rotobuf.Empty\"Q\202\323\344\223\002D*B/v3beta1/{name=pr" + + "ojects/*/locations/*/agents/*/flows/*/ve" + + "rsions/*}\332A\004name\022\362\001\n\013LoadVersion\0226.googl" + + "e.cloud.dialogflow.cx.v3beta1.LoadVersio" + + "nRequest\032\035.google.longrunning.Operation\"" + + "\213\001\202\323\344\223\002L\"G/v3beta1/{name=projects/*/loca" + + "tions/*/agents/*/flows/*/versions/*}:loa" + + "d:\001*\332A\004name\312A/\n\025google.protobuf.Empty\022\026g" + + "oogle.protobuf.Struct\032x\312A\031dialogflow.goo" + + "gleapis.com\322AYhttps://www.googleapis.com" + + "/auth/cloud-platform,https://www.googlea" + + "pis.com/auth/dialogflowB\253\001\n&com.google.c" + + "loud.dialogflow.cx.v3beta1B\014VersionProto" + + "P\001ZDgoogle.golang.org/genproto/googleapi" + + "s/cloud/dialogflow/cx/v3beta1;cx\370\001\001\242\002\002DF" + + "\252\002\"Google.Cloud.Dialogflow.Cx.V3Beta1b\006p" + + "roto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.dialogflow.cx.v3beta1.FlowProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionOperationMetadata_descriptor, + new java.lang.String[] { + "Version", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Version_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_Version_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Version_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Description", "NluSettings", "CreateTime", "State", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListVersionsResponse_descriptor, + new java.lang.String[] { + "Versions", "NextPageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_GetVersionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateVersionRequest_descriptor, + new java.lang.String[] { + "Parent", "Version", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateVersionRequest_descriptor, + new java.lang.String[] { + "Version", "UpdateMask", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteVersionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_LoadVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_dialogflow_cx_v3beta1_LoadVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_LoadVersionRequest_descriptor, + new java.lang.String[] { + "Name", "AllowOverrideAgentResources", + }); + 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.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.dialogflow.cx.v3beta1.FlowProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VoiceSelectionParams.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VoiceSelectionParams.java new file mode 100644 index 000000000..f03e09502 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VoiceSelectionParams.java @@ -0,0 +1,837 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Description of which voice to use for speech synthesis.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams} + */ +public final class VoiceSelectionParams extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams) + VoiceSelectionParamsOrBuilder { + private static final long serialVersionUID = 0L; + // Use VoiceSelectionParams.newBuilder() to construct. + private VoiceSelectionParams(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VoiceSelectionParams() { + name_ = ""; + ssmlGender_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VoiceSelectionParams(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private VoiceSelectionParams( + 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 16: + { + int rawValue = input.readEnum(); + + ssmlGender_ = 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.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_VoiceSelectionParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_VoiceSelectionParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.class, + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Optional. The name of the voice. If not set, the service will choose a
+   * voice based on the other parameters such as language_code and
+   * [ssml_gender][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.ssml_gender].
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The name of the voice. If not set, the service will choose a
+   * voice based on the other parameters such as language_code and
+   * [ssml_gender][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.ssml_gender].
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SSML_GENDER_FIELD_NUMBER = 2; + private int ssmlGender_; + /** + * + * + *
+   * Optional. The preferred gender of the voice. If not set, the service will
+   * choose a voice based on the other parameters such as language_code and
+   * [name][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a
+   * voice of the appropriate gender is not available, the synthesizer should
+   * substitute a voice with a different gender rather than failing the request.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender ssml_gender = 2; + * + * @return The enum numeric value on the wire for ssmlGender. + */ + @java.lang.Override + public int getSsmlGenderValue() { + return ssmlGender_; + } + /** + * + * + *
+   * Optional. The preferred gender of the voice. If not set, the service will
+   * choose a voice based on the other parameters such as language_code and
+   * [name][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a
+   * voice of the appropriate gender is not available, the synthesizer should
+   * substitute a voice with a different gender rather than failing the request.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender ssml_gender = 2; + * + * @return The ssmlGender. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender getSsmlGender() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender result = + com.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender.valueOf(ssmlGender_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender.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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (ssmlGender_ + != com.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender.SSML_VOICE_GENDER_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, ssmlGender_); + } + 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 (ssmlGender_ + != com.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender.SSML_VOICE_GENDER_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, ssmlGender_); + } + 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.dialogflow.cx.v3beta1.VoiceSelectionParams)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams other = + (com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams) obj; + + if (!getName().equals(other.getName())) return false; + if (ssmlGender_ != other.ssmlGender_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + SSML_GENDER_FIELD_NUMBER; + hash = (53 * hash) + ssmlGender_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams 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.dialogflow.cx.v3beta1.VoiceSelectionParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams 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.dialogflow.cx.v3beta1.VoiceSelectionParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams 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.dialogflow.cx.v3beta1.VoiceSelectionParams parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams 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.dialogflow.cx.v3beta1.VoiceSelectionParams parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams 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.dialogflow.cx.v3beta1.VoiceSelectionParams prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Description of which voice to use for speech synthesis.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams) + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_VoiceSelectionParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_VoiceSelectionParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.class, + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.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_ = ""; + + ssmlGender_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.AudioConfigProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_VoiceSelectionParams_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams build() { + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams result = + new com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams(this); + result.name_ = name_; + result.ssmlGender_ = ssmlGender_; + 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.dialogflow.cx.v3beta1.VoiceSelectionParams) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.ssmlGender_ != 0) { + setSsmlGenderValue(other.getSsmlGenderValue()); + } + 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.dialogflow.cx.v3beta1.VoiceSelectionParams parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Optional. The name of the voice. If not set, the service will choose a
+     * voice based on the other parameters such as language_code and
+     * [ssml_gender][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.ssml_gender].
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The name of the voice. If not set, the service will choose a
+     * voice based on the other parameters such as language_code and
+     * [ssml_gender][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.ssml_gender].
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The name of the voice. If not set, the service will choose a
+     * voice based on the other parameters such as language_code and
+     * [ssml_gender][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.ssml_gender].
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of the voice. If not set, the service will choose a
+     * voice based on the other parameters such as language_code and
+     * [ssml_gender][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.ssml_gender].
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of the voice. If not set, the service will choose a
+     * voice based on the other parameters such as language_code and
+     * [ssml_gender][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.ssml_gender].
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int ssmlGender_ = 0; + /** + * + * + *
+     * Optional. The preferred gender of the voice. If not set, the service will
+     * choose a voice based on the other parameters such as language_code and
+     * [name][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a
+     * voice of the appropriate gender is not available, the synthesizer should
+     * substitute a voice with a different gender rather than failing the request.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender ssml_gender = 2; + * + * @return The enum numeric value on the wire for ssmlGender. + */ + @java.lang.Override + public int getSsmlGenderValue() { + return ssmlGender_; + } + /** + * + * + *
+     * Optional. The preferred gender of the voice. If not set, the service will
+     * choose a voice based on the other parameters such as language_code and
+     * [name][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a
+     * voice of the appropriate gender is not available, the synthesizer should
+     * substitute a voice with a different gender rather than failing the request.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender ssml_gender = 2; + * + * @param value The enum numeric value on the wire for ssmlGender to set. + * @return This builder for chaining. + */ + public Builder setSsmlGenderValue(int value) { + + ssmlGender_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The preferred gender of the voice. If not set, the service will
+     * choose a voice based on the other parameters such as language_code and
+     * [name][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a
+     * voice of the appropriate gender is not available, the synthesizer should
+     * substitute a voice with a different gender rather than failing the request.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender ssml_gender = 2; + * + * @return The ssmlGender. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender getSsmlGender() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender result = + com.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender.valueOf(ssmlGender_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. The preferred gender of the voice. If not set, the service will
+     * choose a voice based on the other parameters such as language_code and
+     * [name][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a
+     * voice of the appropriate gender is not available, the synthesizer should
+     * substitute a voice with a different gender rather than failing the request.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender ssml_gender = 2; + * + * @param value The ssmlGender to set. + * @return This builder for chaining. + */ + public Builder setSsmlGender(com.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender value) { + if (value == null) { + throw new NullPointerException(); + } + + ssmlGender_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The preferred gender of the voice. If not set, the service will
+     * choose a voice based on the other parameters such as language_code and
+     * [name][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a
+     * voice of the appropriate gender is not available, the synthesizer should
+     * substitute a voice with a different gender rather than failing the request.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender ssml_gender = 2; + * + * @return This builder for chaining. + */ + public Builder clearSsmlGender() { + + ssmlGender_ = 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.dialogflow.cx.v3beta1.VoiceSelectionParams) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams) + private static final com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VoiceSelectionParams parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VoiceSelectionParams(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.dialogflow.cx.v3beta1.VoiceSelectionParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VoiceSelectionParamsOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VoiceSelectionParamsOrBuilder.java new file mode 100644 index 000000000..4ab2d9bc3 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VoiceSelectionParamsOrBuilder.java @@ -0,0 +1,87 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/audio_config.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface VoiceSelectionParamsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The name of the voice. If not set, the service will choose a
+   * voice based on the other parameters such as language_code and
+   * [ssml_gender][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.ssml_gender].
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Optional. The name of the voice. If not set, the service will choose a
+   * voice based on the other parameters such as language_code and
+   * [ssml_gender][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.ssml_gender].
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The preferred gender of the voice. If not set, the service will
+   * choose a voice based on the other parameters such as language_code and
+   * [name][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a
+   * voice of the appropriate gender is not available, the synthesizer should
+   * substitute a voice with a different gender rather than failing the request.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender ssml_gender = 2; + * + * @return The enum numeric value on the wire for ssmlGender. + */ + int getSsmlGenderValue(); + /** + * + * + *
+   * Optional. The preferred gender of the voice. If not set, the service will
+   * choose a voice based on the other parameters such as language_code and
+   * [name][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a
+   * voice of the appropriate gender is not available, the synthesizer should
+   * substitute a voice with a different gender rather than failing the request.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender ssml_gender = 2; + * + * @return The ssmlGender. + */ + com.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender getSsmlGender(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Webhook.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Webhook.java new file mode 100644 index 000000000..ca9061ccd --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Webhook.java @@ -0,0 +1,3136 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * Webhooks host the developer's business logic. During a session, webhooks
+ * allow the developer to use the data extracted by Dialogflow's natural
+ * language processing to generate dynamic responses, validate collected data,
+ * or trigger actions on the backend.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Webhook} + */ +public final class Webhook extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Webhook) + WebhookOrBuilder { + private static final long serialVersionUID = 0L; + // Use Webhook.newBuilder() to construct. + private Webhook(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Webhook() { + name_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Webhook(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Webhook( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 34: + { + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.Builder subBuilder = + null; + if (webhookCase_ == 4) { + subBuilder = + ((com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) webhook_) + .toBuilder(); + } + webhook_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) webhook_); + webhook_ = subBuilder.buildPartial(); + } + webhookCase_ = 4; + break; + } + case 40: + { + disabled_ = input.readBool(); + break; + } + case 50: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (timeout_ != null) { + subBuilder = timeout_.toBuilder(); + } + timeout_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timeout_); + timeout_ = 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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.class, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder.class); + } + + public interface GenericWebServiceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The webhook URI for receiving POST requests. It must use https protocol.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+     * Required. The webhook URI for receiving POST requests. It must use https protocol.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+     * The user name for HTTP Basic authentication.
+     * 
+ * + * string username = 2 [deprecated = true]; + * + * @return The username. + */ + @java.lang.Deprecated + java.lang.String getUsername(); + /** + * + * + *
+     * The user name for HTTP Basic authentication.
+     * 
+ * + * string username = 2 [deprecated = true]; + * + * @return The bytes for username. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * + * + *
+     * The password for HTTP Basic authentication.
+     * 
+ * + * string password = 3 [deprecated = true]; + * + * @return The password. + */ + @java.lang.Deprecated + java.lang.String getPassword(); + /** + * + * + *
+     * The password for HTTP Basic authentication.
+     * 
+ * + * string password = 3 [deprecated = true]; + * + * @return The bytes for password. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * + * + *
+     * The HTTP request headers to send together with webhook
+     * requests.
+     * 
+ * + * map<string, string> request_headers = 4; + */ + int getRequestHeadersCount(); + /** + * + * + *
+     * The HTTP request headers to send together with webhook
+     * requests.
+     * 
+ * + * map<string, string> request_headers = 4; + */ + boolean containsRequestHeaders(java.lang.String key); + /** Use {@link #getRequestHeadersMap()} instead. */ + @java.lang.Deprecated + java.util.Map getRequestHeaders(); + /** + * + * + *
+     * The HTTP request headers to send together with webhook
+     * requests.
+     * 
+ * + * map<string, string> request_headers = 4; + */ + java.util.Map getRequestHeadersMap(); + /** + * + * + *
+     * The HTTP request headers to send together with webhook
+     * requests.
+     * 
+ * + * map<string, string> request_headers = 4; + */ + java.lang.String getRequestHeadersOrDefault( + java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+     * The HTTP request headers to send together with webhook
+     * requests.
+     * 
+ * + * map<string, string> request_headers = 4; + */ + java.lang.String getRequestHeadersOrThrow(java.lang.String key); + } + /** + * + * + *
+   * Represents configuration for a generic web service.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService} + */ + public static final class GenericWebService extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) + GenericWebServiceOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenericWebService.newBuilder() to construct. + private GenericWebService(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenericWebService() { + uri_ = ""; + username_ = ""; + password_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenericWebService(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenericWebService( + 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(); + + username_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + password_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + requestHeaders_ = + com.google.protobuf.MapField.newMapField( + RequestHeadersDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry requestHeaders__ = + input.readMessage( + RequestHeadersDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + requestHeaders_ + .getMutableMap() + .put(requestHeaders__.getKey(), requestHeaders__.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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetRequestHeaders(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.class, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.Builder.class); + } + + public static final int URI_FIELD_NUMBER = 1; + private volatile java.lang.Object uri_; + /** + * + * + *
+     * Required. The webhook URI for receiving POST requests. It must use https protocol.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The webhook URI for receiving POST requests. It must use https protocol.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERNAME_FIELD_NUMBER = 2; + private volatile java.lang.Object username_; + /** + * + * + *
+     * The user name for HTTP Basic authentication.
+     * 
+ * + * string username = 2 [deprecated = true]; + * + * @return The username. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getUsername() { + java.lang.Object ref = username_; + 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(); + username_ = s; + return s; + } + } + /** + * + * + *
+     * The user name for HTTP Basic authentication.
+     * 
+ * + * string username = 2 [deprecated = true]; + * + * @return The bytes for username. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 3; + private volatile java.lang.Object password_; + /** + * + * + *
+     * The password for HTTP Basic authentication.
+     * 
+ * + * string password = 3 [deprecated = true]; + * + * @return The password. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getPassword() { + java.lang.Object ref = password_; + 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(); + password_ = s; + return s; + } + } + /** + * + * + *
+     * The password for HTTP Basic authentication.
+     * 
+ * + * string password = 3 [deprecated = true]; + * + * @return The bytes for password. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_HEADERS_FIELD_NUMBER = 4; + + private static final class RequestHeadersDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_RequestHeadersEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField requestHeaders_; + + private com.google.protobuf.MapField + internalGetRequestHeaders() { + if (requestHeaders_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RequestHeadersDefaultEntryHolder.defaultEntry); + } + return requestHeaders_; + } + + public int getRequestHeadersCount() { + return internalGetRequestHeaders().getMap().size(); + } + /** + * + * + *
+     * The HTTP request headers to send together with webhook
+     * requests.
+     * 
+ * + * map<string, string> request_headers = 4; + */ + @java.lang.Override + public boolean containsRequestHeaders(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetRequestHeaders().getMap().containsKey(key); + } + /** Use {@link #getRequestHeadersMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getRequestHeaders() { + return getRequestHeadersMap(); + } + /** + * + * + *
+     * The HTTP request headers to send together with webhook
+     * requests.
+     * 
+ * + * map<string, string> request_headers = 4; + */ + @java.lang.Override + public java.util.Map getRequestHeadersMap() { + return internalGetRequestHeaders().getMap(); + } + /** + * + * + *
+     * The HTTP request headers to send together with webhook
+     * requests.
+     * 
+ * + * map<string, string> request_headers = 4; + */ + @java.lang.Override + public java.lang.String getRequestHeadersOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetRequestHeaders().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The HTTP request headers to send together with webhook
+     * requests.
+     * 
+ * + * map<string, string> request_headers = 4; + */ + @java.lang.Override + public java.lang.String getRequestHeadersOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetRequestHeaders().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 (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + if (!getUsernameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, username_); + } + if (!getPasswordBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, password_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetRequestHeaders(), RequestHeadersDefaultEntryHolder.defaultEntry, 4); + 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 (!getUsernameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, username_); + } + if (!getPasswordBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, password_); + } + for (java.util.Map.Entry entry : + internalGetRequestHeaders().getMap().entrySet()) { + com.google.protobuf.MapEntry requestHeaders__ = + RequestHeadersDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, requestHeaders__); + } + 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.dialogflow.cx.v3beta1.Webhook.GenericWebService)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService other = + (com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) obj; + + if (!getUri().equals(other.getUri())) return false; + if (!getUsername().equals(other.getUsername())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (!internalGetRequestHeaders().equals(other.internalGetRequestHeaders())) 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) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + if (!internalGetRequestHeaders().getMap().isEmpty()) { + hash = (37 * hash) + REQUEST_HEADERS_FIELD_NUMBER; + hash = (53 * hash) + internalGetRequestHeaders().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService 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.dialogflow.cx.v3beta1.Webhook.GenericWebService parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService 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.dialogflow.cx.v3beta1.Webhook.GenericWebService parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService 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.dialogflow.cx.v3beta1.Webhook.GenericWebService + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + 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.dialogflow.cx.v3beta1.Webhook.GenericWebService parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService 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.dialogflow.cx.v3beta1.Webhook.GenericWebService prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Represents configuration for a generic web service.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebServiceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetRequestHeaders(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableRequestHeaders(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.class, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.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_ = ""; + + username_ = ""; + + password_ = ""; + + internalGetMutableRequestHeaders().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService build() { + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService result = + new com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService(this); + int from_bitField0_ = bitField0_; + result.uri_ = uri_; + result.username_ = username_; + result.password_ = password_; + result.requestHeaders_ = internalGetRequestHeaders(); + result.requestHeaders_.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.dialogflow.cx.v3beta1.Webhook.GenericWebService) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + .getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + onChanged(); + } + internalGetMutableRequestHeaders().mergeFrom(other.internalGetRequestHeaders()); + 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.dialogflow.cx.v3beta1.Webhook.GenericWebService parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object uri_ = ""; + /** + * + * + *
+       * Required. The webhook URI for receiving POST requests. It must use https protocol.
+       * 
+ * + * 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. The webhook URI for receiving POST requests. It must use https protocol.
+       * 
+ * + * 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. The webhook URI for receiving POST requests. It must use https protocol.
+       * 
+ * + * 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. The webhook URI for receiving POST requests. It must use https protocol.
+       * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The webhook URI for receiving POST requests. It must use https protocol.
+       * 
+ * + * 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 java.lang.Object username_ = ""; + /** + * + * + *
+       * The user name for HTTP Basic authentication.
+       * 
+ * + * string username = 2 [deprecated = true]; + * + * @return The username. + */ + @java.lang.Deprecated + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The user name for HTTP Basic authentication.
+       * 
+ * + * string username = 2 [deprecated = true]; + * + * @return The bytes for username. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The user name for HTTP Basic authentication.
+       * 
+ * + * string username = 2 [deprecated = true]; + * + * @param value The username to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + username_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The user name for HTTP Basic authentication.
+       * 
+ * + * string username = 2 [deprecated = true]; + * + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearUsername() { + + username_ = getDefaultInstance().getUsername(); + onChanged(); + return this; + } + /** + * + * + *
+       * The user name for HTTP Basic authentication.
+       * 
+ * + * string username = 2 [deprecated = true]; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + username_ = value; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + /** + * + * + *
+       * The password for HTTP Basic authentication.
+       * 
+ * + * string password = 3 [deprecated = true]; + * + * @return The password. + */ + @java.lang.Deprecated + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The password for HTTP Basic authentication.
+       * 
+ * + * string password = 3 [deprecated = true]; + * + * @return The bytes for password. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The password for HTTP Basic authentication.
+       * 
+ * + * string password = 3 [deprecated = true]; + * + * @param value The password to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + password_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The password for HTTP Basic authentication.
+       * 
+ * + * string password = 3 [deprecated = true]; + * + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearPassword() { + + password_ = getDefaultInstance().getPassword(); + onChanged(); + return this; + } + /** + * + * + *
+       * The password for HTTP Basic authentication.
+       * 
+ * + * string password = 3 [deprecated = true]; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + password_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField requestHeaders_; + + private com.google.protobuf.MapField + internalGetRequestHeaders() { + if (requestHeaders_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RequestHeadersDefaultEntryHolder.defaultEntry); + } + return requestHeaders_; + } + + private com.google.protobuf.MapField + internalGetMutableRequestHeaders() { + onChanged(); + ; + if (requestHeaders_ == null) { + requestHeaders_ = + com.google.protobuf.MapField.newMapField( + RequestHeadersDefaultEntryHolder.defaultEntry); + } + if (!requestHeaders_.isMutable()) { + requestHeaders_ = requestHeaders_.copy(); + } + return requestHeaders_; + } + + public int getRequestHeadersCount() { + return internalGetRequestHeaders().getMap().size(); + } + /** + * + * + *
+       * The HTTP request headers to send together with webhook
+       * requests.
+       * 
+ * + * map<string, string> request_headers = 4; + */ + @java.lang.Override + public boolean containsRequestHeaders(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetRequestHeaders().getMap().containsKey(key); + } + /** Use {@link #getRequestHeadersMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getRequestHeaders() { + return getRequestHeadersMap(); + } + /** + * + * + *
+       * The HTTP request headers to send together with webhook
+       * requests.
+       * 
+ * + * map<string, string> request_headers = 4; + */ + @java.lang.Override + public java.util.Map getRequestHeadersMap() { + return internalGetRequestHeaders().getMap(); + } + /** + * + * + *
+       * The HTTP request headers to send together with webhook
+       * requests.
+       * 
+ * + * map<string, string> request_headers = 4; + */ + @java.lang.Override + public java.lang.String getRequestHeadersOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetRequestHeaders().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * The HTTP request headers to send together with webhook
+       * requests.
+       * 
+ * + * map<string, string> request_headers = 4; + */ + @java.lang.Override + public java.lang.String getRequestHeadersOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetRequestHeaders().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearRequestHeaders() { + internalGetMutableRequestHeaders().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * The HTTP request headers to send together with webhook
+       * requests.
+       * 
+ * + * map<string, string> request_headers = 4; + */ + public Builder removeRequestHeaders(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableRequestHeaders().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableRequestHeaders() { + return internalGetMutableRequestHeaders().getMutableMap(); + } + /** + * + * + *
+       * The HTTP request headers to send together with webhook
+       * requests.
+       * 
+ * + * map<string, string> request_headers = 4; + */ + public Builder putRequestHeaders(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableRequestHeaders().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * The HTTP request headers to send together with webhook
+       * requests.
+       * 
+ * + * map<string, string> request_headers = 4; + */ + public Builder putAllRequestHeaders( + java.util.Map values) { + internalGetMutableRequestHeaders().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.dialogflow.cx.v3beta1.Webhook.GenericWebService) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) + private static final com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenericWebService parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenericWebService(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.dialogflow.cx.v3beta1.Webhook.GenericWebService + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int webhookCase_ = 0; + private java.lang.Object webhook_; + + public enum WebhookCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GENERIC_WEB_SERVICE(4), + WEBHOOK_NOT_SET(0); + private final int value; + + private WebhookCase(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 WebhookCase valueOf(int value) { + return forNumber(value); + } + + public static WebhookCase forNumber(int value) { + switch (value) { + case 4: + return GENERIC_WEB_SERVICE; + case 0: + return WEBHOOK_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public WebhookCase getWebhookCase() { + return WebhookCase.forNumber(webhookCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The unique identifier of the webhook.
+   * Required for the [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook] method.
+   * [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook] populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The unique identifier of the webhook.
+   * Required for the [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook] method.
+   * [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook] populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required. The human-readable name of the webhook, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The human-readable name of the webhook, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GENERIC_WEB_SERVICE_FIELD_NUMBER = 4; + /** + * + * + *
+   * Configuration for a generic web service.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + * + * @return Whether the genericWebService field is set. + */ + @java.lang.Override + public boolean hasGenericWebService() { + return webhookCase_ == 4; + } + /** + * + * + *
+   * Configuration for a generic web service.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + * + * @return The genericWebService. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService getGenericWebService() { + if (webhookCase_ == 4) { + return (com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) webhook_; + } + return com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.getDefaultInstance(); + } + /** + * + * + *
+   * Configuration for a generic web service.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebServiceOrBuilder + getGenericWebServiceOrBuilder() { + if (webhookCase_ == 4) { + return (com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) webhook_; + } + return com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.getDefaultInstance(); + } + + public static final int TIMEOUT_FIELD_NUMBER = 6; + private com.google.protobuf.Duration timeout_; + /** + * + * + *
+   * Webhook execution timeout. Execution is considered failed if Dialogflow
+   * doesn't receive a response from webhook at the end of the timeout period.
+   * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+   * 
+ * + * .google.protobuf.Duration timeout = 6; + * + * @return Whether the timeout field is set. + */ + @java.lang.Override + public boolean hasTimeout() { + return timeout_ != null; + } + /** + * + * + *
+   * Webhook execution timeout. Execution is considered failed if Dialogflow
+   * doesn't receive a response from webhook at the end of the timeout period.
+   * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+   * 
+ * + * .google.protobuf.Duration timeout = 6; + * + * @return The timeout. + */ + @java.lang.Override + public com.google.protobuf.Duration getTimeout() { + return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_; + } + /** + * + * + *
+   * Webhook execution timeout. Execution is considered failed if Dialogflow
+   * doesn't receive a response from webhook at the end of the timeout period.
+   * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+   * 
+ * + * .google.protobuf.Duration timeout = 6; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder() { + return getTimeout(); + } + + public static final int DISABLED_FIELD_NUMBER = 5; + private boolean disabled_; + /** + * + * + *
+   * Indicates whether the webhook is disabled.
+   * 
+ * + * bool disabled = 5; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + 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 (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (webhookCase_ == 4) { + output.writeMessage( + 4, (com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) webhook_); + } + if (disabled_ != false) { + output.writeBool(5, disabled_); + } + if (timeout_ != null) { + output.writeMessage(6, getTimeout()); + } + 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 (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (webhookCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) webhook_); + } + if (disabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, disabled_); + } + if (timeout_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getTimeout()); + } + 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.dialogflow.cx.v3beta1.Webhook)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.Webhook other = + (com.google.cloud.dialogflow.cx.v3beta1.Webhook) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasTimeout() != other.hasTimeout()) return false; + if (hasTimeout()) { + if (!getTimeout().equals(other.getTimeout())) return false; + } + if (getDisabled() != other.getDisabled()) return false; + if (!getWebhookCase().equals(other.getWebhookCase())) return false; + switch (webhookCase_) { + case 4: + if (!getGenericWebService().equals(other.getGenericWebService())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (hasTimeout()) { + hash = (37 * hash) + TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getTimeout().hashCode(); + } + hash = (37 * hash) + DISABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisabled()); + switch (webhookCase_) { + case 4: + hash = (37 * hash) + GENERIC_WEB_SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getGenericWebService().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook 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.dialogflow.cx.v3beta1.Webhook parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook 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.dialogflow.cx.v3beta1.Webhook parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook 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.dialogflow.cx.v3beta1.Webhook parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook 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.dialogflow.cx.v3beta1.Webhook parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook 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.dialogflow.cx.v3beta1.Webhook 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; + } + /** + * + * + *
+   * Webhooks host the developer's business logic. During a session, webhooks
+   * allow the developer to use the data extracted by Dialogflow's natural
+   * language processing to generate dynamic responses, validate collected data,
+   * or trigger actions on the backend.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.Webhook} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.Webhook) + com.google.cloud.dialogflow.cx.v3beta1.WebhookOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.class, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.Webhook.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_ = ""; + + displayName_ = ""; + + if (timeoutBuilder_ == null) { + timeout_ = null; + } else { + timeout_ = null; + timeoutBuilder_ = null; + } + disabled_ = false; + + webhookCase_ = 0; + webhook_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Webhook getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.Webhook.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Webhook build() { + com.google.cloud.dialogflow.cx.v3beta1.Webhook result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Webhook buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.Webhook result = + new com.google.cloud.dialogflow.cx.v3beta1.Webhook(this); + result.name_ = name_; + result.displayName_ = displayName_; + if (webhookCase_ == 4) { + if (genericWebServiceBuilder_ == null) { + result.webhook_ = webhook_; + } else { + result.webhook_ = genericWebServiceBuilder_.build(); + } + } + if (timeoutBuilder_ == null) { + result.timeout_ = timeout_; + } else { + result.timeout_ = timeoutBuilder_.build(); + } + result.disabled_ = disabled_; + result.webhookCase_ = webhookCase_; + 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.dialogflow.cx.v3beta1.Webhook) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.Webhook) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Webhook other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.Webhook.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.hasTimeout()) { + mergeTimeout(other.getTimeout()); + } + if (other.getDisabled() != false) { + setDisabled(other.getDisabled()); + } + switch (other.getWebhookCase()) { + case GENERIC_WEB_SERVICE: + { + mergeGenericWebService(other.getGenericWebService()); + break; + } + case WEBHOOK_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.dialogflow.cx.v3beta1.Webhook parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.dialogflow.cx.v3beta1.Webhook) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int webhookCase_ = 0; + private java.lang.Object webhook_; + + public WebhookCase getWebhookCase() { + return WebhookCase.forNumber(webhookCase_); + } + + public Builder clearWebhook() { + webhookCase_ = 0; + webhook_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The unique identifier of the webhook.
+     * Required for the [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook] method.
+     * [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook] populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unique identifier of the webhook.
+     * Required for the [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook] method.
+     * [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook] populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unique identifier of the webhook.
+     * Required for the [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook] method.
+     * [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook] populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the webhook.
+     * Required for the [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook] method.
+     * [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook] populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the webhook.
+     * Required for the [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook] method.
+     * [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook] populates the name automatically.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/webhooks/<Webhook ID>`.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The human-readable name of the webhook, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the webhook, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The human-readable name of the webhook, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the webhook, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The human-readable name of the webhook, unique within the agent.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebServiceOrBuilder> + genericWebServiceBuilder_; + /** + * + * + *
+     * Configuration for a generic web service.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + * + * @return Whether the genericWebService field is set. + */ + @java.lang.Override + public boolean hasGenericWebService() { + return webhookCase_ == 4; + } + /** + * + * + *
+     * Configuration for a generic web service.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + * + * @return The genericWebService. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService getGenericWebService() { + if (genericWebServiceBuilder_ == null) { + if (webhookCase_ == 4) { + return (com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) webhook_; + } + return com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + .getDefaultInstance(); + } else { + if (webhookCase_ == 4) { + return genericWebServiceBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Configuration for a generic web service.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + */ + public Builder setGenericWebService( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService value) { + if (genericWebServiceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + webhook_ = value; + onChanged(); + } else { + genericWebServiceBuilder_.setMessage(value); + } + webhookCase_ = 4; + return this; + } + /** + * + * + *
+     * Configuration for a generic web service.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + */ + public Builder setGenericWebService( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.Builder builderForValue) { + if (genericWebServiceBuilder_ == null) { + webhook_ = builderForValue.build(); + onChanged(); + } else { + genericWebServiceBuilder_.setMessage(builderForValue.build()); + } + webhookCase_ = 4; + return this; + } + /** + * + * + *
+     * Configuration for a generic web service.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + */ + public Builder mergeGenericWebService( + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService value) { + if (genericWebServiceBuilder_ == null) { + if (webhookCase_ == 4 + && webhook_ + != com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + .getDefaultInstance()) { + webhook_ = + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.newBuilder( + (com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) webhook_) + .mergeFrom(value) + .buildPartial(); + } else { + webhook_ = value; + } + onChanged(); + } else { + if (webhookCase_ == 4) { + genericWebServiceBuilder_.mergeFrom(value); + } + genericWebServiceBuilder_.setMessage(value); + } + webhookCase_ = 4; + return this; + } + /** + * + * + *
+     * Configuration for a generic web service.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + */ + public Builder clearGenericWebService() { + if (genericWebServiceBuilder_ == null) { + if (webhookCase_ == 4) { + webhookCase_ = 0; + webhook_ = null; + onChanged(); + } + } else { + if (webhookCase_ == 4) { + webhookCase_ = 0; + webhook_ = null; + } + genericWebServiceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Configuration for a generic web service.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.Builder + getGenericWebServiceBuilder() { + return getGenericWebServiceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Configuration for a generic web service.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebServiceOrBuilder + getGenericWebServiceOrBuilder() { + if ((webhookCase_ == 4) && (genericWebServiceBuilder_ != null)) { + return genericWebServiceBuilder_.getMessageOrBuilder(); + } else { + if (webhookCase_ == 4) { + return (com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) webhook_; + } + return com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Configuration for a generic web service.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebServiceOrBuilder> + getGenericWebServiceFieldBuilder() { + if (genericWebServiceBuilder_ == null) { + if (!(webhookCase_ == 4)) { + webhook_ = + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.getDefaultInstance(); + } + genericWebServiceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.Builder, + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebServiceOrBuilder>( + (com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService) webhook_, + getParentForChildren(), + isClean()); + webhook_ = null; + } + webhookCase_ = 4; + onChanged(); + ; + return genericWebServiceBuilder_; + } + + private com.google.protobuf.Duration timeout_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + timeoutBuilder_; + /** + * + * + *
+     * Webhook execution timeout. Execution is considered failed if Dialogflow
+     * doesn't receive a response from webhook at the end of the timeout period.
+     * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 6; + * + * @return Whether the timeout field is set. + */ + public boolean hasTimeout() { + return timeoutBuilder_ != null || timeout_ != null; + } + /** + * + * + *
+     * Webhook execution timeout. Execution is considered failed if Dialogflow
+     * doesn't receive a response from webhook at the end of the timeout period.
+     * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 6; + * + * @return The timeout. + */ + public com.google.protobuf.Duration getTimeout() { + if (timeoutBuilder_ == null) { + return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_; + } else { + return timeoutBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Webhook execution timeout. Execution is considered failed if Dialogflow
+     * doesn't receive a response from webhook at the end of the timeout period.
+     * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 6; + */ + public Builder setTimeout(com.google.protobuf.Duration value) { + if (timeoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeout_ = value; + onChanged(); + } else { + timeoutBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Webhook execution timeout. Execution is considered failed if Dialogflow
+     * doesn't receive a response from webhook at the end of the timeout period.
+     * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 6; + */ + public Builder setTimeout(com.google.protobuf.Duration.Builder builderForValue) { + if (timeoutBuilder_ == null) { + timeout_ = builderForValue.build(); + onChanged(); + } else { + timeoutBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Webhook execution timeout. Execution is considered failed if Dialogflow
+     * doesn't receive a response from webhook at the end of the timeout period.
+     * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 6; + */ + public Builder mergeTimeout(com.google.protobuf.Duration value) { + if (timeoutBuilder_ == null) { + if (timeout_ != null) { + timeout_ = + com.google.protobuf.Duration.newBuilder(timeout_).mergeFrom(value).buildPartial(); + } else { + timeout_ = value; + } + onChanged(); + } else { + timeoutBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Webhook execution timeout. Execution is considered failed if Dialogflow
+     * doesn't receive a response from webhook at the end of the timeout period.
+     * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 6; + */ + public Builder clearTimeout() { + if (timeoutBuilder_ == null) { + timeout_ = null; + onChanged(); + } else { + timeout_ = null; + timeoutBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Webhook execution timeout. Execution is considered failed if Dialogflow
+     * doesn't receive a response from webhook at the end of the timeout period.
+     * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 6; + */ + public com.google.protobuf.Duration.Builder getTimeoutBuilder() { + + onChanged(); + return getTimeoutFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Webhook execution timeout. Execution is considered failed if Dialogflow
+     * doesn't receive a response from webhook at the end of the timeout period.
+     * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 6; + */ + public com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder() { + if (timeoutBuilder_ != null) { + return timeoutBuilder_.getMessageOrBuilder(); + } else { + return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_; + } + } + /** + * + * + *
+     * Webhook execution timeout. Execution is considered failed if Dialogflow
+     * doesn't receive a response from webhook at the end of the timeout period.
+     * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTimeoutFieldBuilder() { + if (timeoutBuilder_ == null) { + timeoutBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getTimeout(), getParentForChildren(), isClean()); + timeout_ = null; + } + return timeoutBuilder_; + } + + private boolean disabled_; + /** + * + * + *
+     * Indicates whether the webhook is disabled.
+     * 
+ * + * bool disabled = 5; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + /** + * + * + *
+     * Indicates whether the webhook is disabled.
+     * 
+ * + * bool disabled = 5; + * + * @param value The disabled to set. + * @return This builder for chaining. + */ + public Builder setDisabled(boolean value) { + + disabled_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates whether the webhook is disabled.
+     * 
+ * + * bool disabled = 5; + * + * @return This builder for chaining. + */ + public Builder clearDisabled() { + + disabled_ = 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.dialogflow.cx.v3beta1.Webhook) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.Webhook) + private static final com.google.cloud.dialogflow.cx.v3beta1.Webhook DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.Webhook(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.Webhook getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Webhook parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Webhook(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.dialogflow.cx.v3beta1.Webhook getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookName.java new file mode 100644 index 000000000..980ad9e20 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookName.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.dialogflow.cx.v3beta1; + +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 WebhookName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String agent; + private final String webhook; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getWebhook() { + return webhook; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private WebhookName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + webhook = Preconditions.checkNotNull(builder.getWebhook()); + } + + public static WebhookName of(String project, String location, String agent, String webhook) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setWebhook(webhook) + .build(); + } + + public static String format(String project, String location, String agent, String webhook) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAgent(agent) + .setWebhook(webhook) + .build() + .toString(); + } + + public static WebhookName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "WebhookName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("agent"), + matchMap.get("webhook")); + } + + 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 (WebhookName 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("agent", agent); + fieldMapBuilder.put("webhook", webhook); + 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, "agent", agent, "webhook", webhook); + } + + /** Builder for WebhookName. */ + public static class Builder { + + private String project; + private String location; + private String agent; + private String webhook; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAgent() { + return agent; + } + + public String getWebhook() { + return webhook; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAgent(String agent) { + this.agent = agent; + return this; + } + + public Builder setWebhook(String webhook) { + this.webhook = webhook; + return this; + } + + private Builder() {} + + private Builder(WebhookName webhookName) { + project = webhookName.project; + location = webhookName.location; + agent = webhookName.agent; + webhook = webhookName.webhook; + } + + public WebhookName build() { + return new WebhookName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof WebhookName) { + WebhookName that = (WebhookName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.agent.equals(that.agent)) + && (this.webhook.equals(that.webhook)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= agent.hashCode(); + h *= 1000003; + h ^= webhook.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookOrBuilder.java new file mode 100644 index 000000000..d34f019a5 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookOrBuilder.java @@ -0,0 +1,178 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface WebhookOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.Webhook) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique identifier of the webhook.
+   * Required for the [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook] method.
+   * [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook] populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The unique identifier of the webhook.
+   * Required for the [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook] method.
+   * [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook] populates the name automatically.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/webhooks/<Webhook ID>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The human-readable name of the webhook, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The human-readable name of the webhook, unique within the agent.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Configuration for a generic web service.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + * + * @return Whether the genericWebService field is set. + */ + boolean hasGenericWebService(); + /** + * + * + *
+   * Configuration for a generic web service.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + * + * @return The genericWebService. + */ + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService getGenericWebService(); + /** + * + * + *
+   * Configuration for a generic web service.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService generic_web_service = 4; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebServiceOrBuilder + getGenericWebServiceOrBuilder(); + + /** + * + * + *
+   * Webhook execution timeout. Execution is considered failed if Dialogflow
+   * doesn't receive a response from webhook at the end of the timeout period.
+   * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+   * 
+ * + * .google.protobuf.Duration timeout = 6; + * + * @return Whether the timeout field is set. + */ + boolean hasTimeout(); + /** + * + * + *
+   * Webhook execution timeout. Execution is considered failed if Dialogflow
+   * doesn't receive a response from webhook at the end of the timeout period.
+   * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+   * 
+ * + * .google.protobuf.Duration timeout = 6; + * + * @return The timeout. + */ + com.google.protobuf.Duration getTimeout(); + /** + * + * + *
+   * Webhook execution timeout. Execution is considered failed if Dialogflow
+   * doesn't receive a response from webhook at the end of the timeout period.
+   * Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
+   * 
+ * + * .google.protobuf.Duration timeout = 6; + */ + com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder(); + + /** + * + * + *
+   * Indicates whether the webhook is disabled.
+   * 
+ * + * bool disabled = 5; + * + * @return The disabled. + */ + boolean getDisabled(); + + public com.google.cloud.dialogflow.cx.v3beta1.Webhook.WebhookCase getWebhookCase(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookProto.java new file mode 100644 index 000000000..f3351a60f --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookProto.java @@ -0,0 +1,497 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public final class WebhookProto { + private WebhookProto() {} + + 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_dialogflow_cx_v3beta1_Webhook_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_RequestHeadersEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_RequestHeadersEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_GetWebhookRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_GetWebhookRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateWebhookRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateWebhookRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateWebhookRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateWebhookRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteWebhookRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteWebhookRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_FulfillmentInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_FulfillmentInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_IntentParameterValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_IntentParameterValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_ParametersEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_ParametersEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_FulfillmentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_FulfillmentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_ParameterInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_ParameterInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_ParametersEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_ParametersEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/dialogflow/cx/v3beta1/web" + + "hook.proto\022\"google.cloud.dialogflow.cx.v" + + "3beta1\032\034google/api/annotations.proto\032\027go" + + "ogle/api/client.proto\032\037google/api/field_" + + "behavior.proto\032\031google/api/resource.prot" + + "o\0329google/cloud/dialogflow/cx/v3beta1/re" + + "sponse_message.proto\032\036google/protobuf/du" + + "ration.proto\032\033google/protobuf/empty.prot" + + "o\032 google/protobuf/field_mask.proto\032\034goo" + + "gle/protobuf/struct.proto\"\303\004\n\007Webhook\022\014\n" + + "\004name\030\001 \001(\t\022\031\n\014display_name\030\002 \001(\tB\003\340A\002\022\\" + + "\n\023generic_web_service\030\004 \001(\0132=.google.clo" + + "ud.dialogflow.cx.v3beta1.Webhook.Generic" + + "WebServiceH\000\022*\n\007timeout\030\006 \001(\0132\031.google.p" + + "rotobuf.Duration\022\020\n\010disabled\030\005 \001(\010\032\364\001\n\021G" + + "enericWebService\022\020\n\003uri\030\001 \001(\tB\003\340A\002\022\024\n\010us" + + "ername\030\002 \001(\tB\002\030\001\022\024\n\010password\030\003 \001(\tB\002\030\001\022j" + + "\n\017request_headers\030\004 \003(\0132Q.google.cloud.d" + + "ialogflow.cx.v3beta1.Webhook.GenericWebS" + + "ervice.RequestHeadersEntry\0325\n\023RequestHea" + + "dersEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" + + "\001:q\352An\n!dialogflow.googleapis.com/Webhoo" + + "k\022Iprojects/{project}/locations/{locatio" + + "n}/agents/{agent}/webhooks/{webhook}B\t\n\007" + + "webhook\"w\n\023ListWebhooksRequest\0229\n\006parent" + + "\030\001 \001(\tB)\340A\002\372A#\022!dialogflow.googleapis.co" + + "m/Webhook\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_tok" + + "en\030\003 \001(\t\"n\n\024ListWebhooksResponse\022=\n\010webh" + + "ooks\030\001 \003(\0132+.google.cloud.dialogflow.cx." + + "v3beta1.Webhook\022\027\n\017next_page_token\030\002 \001(\t" + + "\"L\n\021GetWebhookRequest\0227\n\004name\030\001 \001(\tB)\340A\002" + + "\372A#\n!dialogflow.googleapis.com/Webhook\"\224" + + "\001\n\024CreateWebhookRequest\0229\n\006parent\030\001 \001(\tB" + + ")\340A\002\372A#\022!dialogflow.googleapis.com/Webho" + + "ok\022A\n\007webhook\030\002 \001(\0132+.google.cloud.dialo" + + "gflow.cx.v3beta1.WebhookB\003\340A\002\"\212\001\n\024Update" + + "WebhookRequest\022A\n\007webhook\030\001 \001(\0132+.google" + + ".cloud.dialogflow.cx.v3beta1.WebhookB\003\340A" + + "\002\022/\n\013update_mask\030\002 \001(\0132\032.google.protobuf" + + ".FieldMask\"O\n\024DeleteWebhookRequest\0227\n\004na" + + "me\030\001 \001(\tB)\340A\002\372A#\n!dialogflow.googleapis." + + "com/Webhook\"\234\007\n\016WebhookRequest\022!\n\031detect" + + "_intent_response_id\030\001 \001(\t\022\\\n\020fulfillment" + + "_info\030\006 \001(\0132B.google.cloud.dialogflow.cx" + + ".v3beta1.WebhookRequest.FulfillmentInfo\022" + + "R\n\013intent_info\030\003 \001(\0132=.google.cloud.dial" + + "ogflow.cx.v3beta1.WebhookRequest.IntentI" + + "nfo\022?\n\tpage_info\030\004 \001(\0132,.google.cloud.di" + + "alogflow.cx.v3beta1.PageInfo\022E\n\014session_" + + "info\030\005 \001(\0132/.google.cloud.dialogflow.cx." + + "v3beta1.SessionInfo\022E\n\010messages\030\007 \003(\01323." + + "google.cloud.dialogflow.cx.v3beta1.Respo" + + "nseMessage\022(\n\007payload\030\010 \001(\0132\027.google.pro" + + "tobuf.Struct\032\036\n\017FulfillmentInfo\022\013\n\003tag\030\001" + + " \001(\t\032\233\003\n\nIntentInfo\022B\n\023last_matched_inte" + + "nt\030\001 \001(\tB%\372A\"\n dialogflow.googleapis.com" + + "/Intent\022a\n\nparameters\030\002 \003(\0132M.google.clo" + + "ud.dialogflow.cx.v3beta1.WebhookRequest." + + "IntentInfo.ParametersEntry\032^\n\024IntentPara" + + "meterValue\022\026\n\016original_value\030\001 \001(\t\022.\n\016re" + + "solved_value\030\002 \001(\0132\026.google.protobuf.Val" + + "ue\032\205\001\n\017ParametersEntry\022\013\n\003key\030\001 \001(\t\022a\n\005v" + + "alue\030\002 \001(\0132R.google.cloud.dialogflow.cx." + + "v3beta1.WebhookRequest.IntentInfo.Intent" + + "ParameterValue:\0028\001\"\310\005\n\017WebhookResponse\022e" + + "\n\024fulfillment_response\030\001 \001(\0132G.google.cl" + + "oud.dialogflow.cx.v3beta1.WebhookRespons" + + "e.FulfillmentResponse\022?\n\tpage_info\030\002 \001(\013" + + "2,.google.cloud.dialogflow.cx.v3beta1.Pa" + + "geInfo\022E\n\014session_info\030\003 \001(\0132/.google.cl" + + "oud.dialogflow.cx.v3beta1.SessionInfo\022(\n" + + "\007payload\030\004 \001(\0132\027.google.protobuf.Struct\022" + + ":\n\013target_page\030\005 \001(\tB#\372A \n\036dialogflow.go" + + "ogleapis.com/PageH\000\022:\n\013target_flow\030\006 \001(\t" + + "B#\372A \n\036dialogflow.googleapis.com/FlowH\000\032" + + "\225\002\n\023FulfillmentResponse\022E\n\010messages\030\001 \003(" + + "\01323.google.cloud.dialogflow.cx.v3beta1.R" + + "esponseMessage\022m\n\016merge_behavior\030\002 \001(\0162U" + + ".google.cloud.dialogflow.cx.v3beta1.Webh" + + "ookResponse.FulfillmentResponse.MergeBeh" + + "avior\"H\n\rMergeBehavior\022\036\n\032MERGE_BEHAVIOR" + + "_UNSPECIFIED\020\000\022\n\n\006APPEND\020\001\022\013\n\007REPLACE\020\002B" + + "\014\n\ntransition\"\254\004\n\010PageInfo\0229\n\014current_pa" + + "ge\030\001 \001(\tB#\372A \n\036dialogflow.googleapis.com" + + "/Page\022H\n\tform_info\030\003 \001(\01325.google.cloud." + + "dialogflow.cx.v3beta1.PageInfo.FormInfo\032" + + "\232\003\n\010FormInfo\022[\n\016parameter_info\030\002 \003(\0132C.g" + + "oogle.cloud.dialogflow.cx.v3beta1.PageIn" + + "fo.FormInfo.ParameterInfo\032\260\002\n\rParameterI" + + "nfo\022\024\n\014display_name\030\001 \001(\t\022\020\n\010required\030\002 " + + "\001(\010\022a\n\005state\030\003 \001(\0162R.google.cloud.dialog" + + "flow.cx.v3beta1.PageInfo.FormInfo.Parame" + + "terInfo.ParameterState\022%\n\005value\030\004 \001(\0132\026." + + "google.protobuf.Value\022\026\n\016just_collected\030" + + "\005 \001(\010\"U\n\016ParameterState\022\037\n\033PARAMETER_STA" + + "TE_UNSPECIFIED\020\000\022\t\n\005EMPTY\020\001\022\013\n\007INVALID\020\002" + + "\022\n\n\006FILLED\020\003\"\346\001\n\013SessionInfo\0227\n\007session\030" + + "\001 \001(\tB&\372A#\n!dialogflow.googleapis.com/Se" + + "ssion\022S\n\nparameters\030\002 \003(\0132?.google.cloud" + + ".dialogflow.cx.v3beta1.SessionInfo.Param" + + "etersEntry\032I\n\017ParametersEntry\022\013\n\003key\030\001 \001" + + "(\t\022%\n\005value\030\002 \001(\0132\026.google.protobuf.Valu" + + "e:\0028\0012\375\010\n\010Webhooks\022\316\001\n\014ListWebhooks\0227.go" + + "ogle.cloud.dialogflow.cx.v3beta1.ListWeb" + + "hooksRequest\0328.google.cloud.dialogflow.c" + + "x.v3beta1.ListWebhooksResponse\"K\202\323\344\223\002<\022:" + + "/v3beta1/{parent=projects/*/locations/*/" + + "agents/*}/webhooks\332A\006parent\022\273\001\n\nGetWebho" + + "ok\0225.google.cloud.dialogflow.cx.v3beta1." + + "GetWebhookRequest\032+.google.cloud.dialogf" + + "low.cx.v3beta1.Webhook\"I\202\323\344\223\002<\022:/v3beta1" + + "/{name=projects/*/locations/*/agents/*/w" + + "ebhooks/*}\332A\004name\022\324\001\n\rCreateWebhook\0228.go" + + "ogle.cloud.dialogflow.cx.v3beta1.CreateW" + + "ebhookRequest\032+.google.cloud.dialogflow." + + "cx.v3beta1.Webhook\"\\\202\323\344\223\002E\":/v3beta1/{pa" + + "rent=projects/*/locations/*/agents/*}/we" + + "bhooks:\007webhook\332A\016parent,webhook\022\341\001\n\rUpd" + + "ateWebhook\0228.google.cloud.dialogflow.cx." + + "v3beta1.UpdateWebhookRequest\032+.google.cl" + + "oud.dialogflow.cx.v3beta1.Webhook\"i\202\323\344\223\002" + + "M2B/v3beta1/{webhook.name=projects/*/loc" + + "ations/*/agents/*/webhooks/*}:\007webhook\332A" + + "\023webhook,update_mask\022\254\001\n\rDeleteWebhook\0228" + + ".google.cloud.dialogflow.cx.v3beta1.Dele" + + "teWebhookRequest\032\026.google.protobuf.Empty" + + "\"I\202\323\344\223\002<*:/v3beta1/{name=projects/*/loca" + + "tions/*/agents/*/webhooks/*}\332A\004name\032x\312A\031" + + "dialogflow.googleapis.com\322AYhttps://www." + + "googleapis.com/auth/cloud-platform,https" + + "://www.googleapis.com/auth/dialogflowB\253\001" + + "\n&com.google.cloud.dialogflow.cx.v3beta1" + + "B\014WebhookProtoP\001ZDgoogle.golang.org/genp" + + "roto/googleapis/cloud/dialogflow/cx/v3be" + + "ta1;cx\370\001\001\242\002\002DF\252\002\"Google.Cloud.Dialogflow" + + ".Cx.V3Beta1b\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.api.ResourceProto.getDescriptor(), + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "GenericWebService", "Timeout", "Disabled", "Webhook", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_descriptor, + new java.lang.String[] { + "Uri", "Username", "Password", "RequestHeaders", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_RequestHeadersEntry_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_RequestHeadersEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_Webhook_GenericWebService_RequestHeadersEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ListWebhooksResponse_descriptor, + new java.lang.String[] { + "Webhooks", "NextPageToken", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetWebhookRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_dialogflow_cx_v3beta1_GetWebhookRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_GetWebhookRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateWebhookRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateWebhookRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_CreateWebhookRequest_descriptor, + new java.lang.String[] { + "Parent", "Webhook", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateWebhookRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateWebhookRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_UpdateWebhookRequest_descriptor, + new java.lang.String[] { + "Webhook", "UpdateMask", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteWebhookRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteWebhookRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_DeleteWebhookRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_descriptor, + new java.lang.String[] { + "DetectIntentResponseId", + "FulfillmentInfo", + "IntentInfo", + "PageInfo", + "SessionInfo", + "Messages", + "Payload", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_FulfillmentInfo_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_FulfillmentInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_FulfillmentInfo_descriptor, + new java.lang.String[] { + "Tag", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_descriptor, + new java.lang.String[] { + "LastMatchedIntent", "Parameters", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_IntentParameterValue_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_IntentParameterValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_IntentParameterValue_descriptor, + new java.lang.String[] { + "OriginalValue", "ResolvedValue", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_ParametersEntry_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_ParametersEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_ParametersEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_descriptor, + new java.lang.String[] { + "FulfillmentResponse", + "PageInfo", + "SessionInfo", + "Payload", + "TargetPage", + "TargetFlow", + "Transition", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_FulfillmentResponse_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_FulfillmentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_FulfillmentResponse_descriptor, + new java.lang.String[] { + "Messages", "MergeBehavior", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_descriptor, + new java.lang.String[] { + "CurrentPage", "FormInfo", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_descriptor, + new java.lang.String[] { + "ParameterInfo", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_ParameterInfo_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_ParameterInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_PageInfo_FormInfo_ParameterInfo_descriptor, + new java.lang.String[] { + "DisplayName", "Required", "State", "Value", "JustCollected", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_descriptor, + new java.lang.String[] { + "Session", "Parameters", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_ParametersEntry_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_ParametersEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_SessionInfo_ParametersEntry_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.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookRequest.java new file mode 100644 index 000000000..54559d8d0 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookRequest.java @@ -0,0 +1,5584 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The request message for a webhook call.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.WebhookRequest} + */ +public final class WebhookRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.WebhookRequest) + WebhookRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebhookRequest.newBuilder() to construct. + private WebhookRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WebhookRequest() { + detectIntentResponseId_ = ""; + messages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WebhookRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WebhookRequest( + 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(); + + detectIntentResponseId_ = s; + break; + } + case 26: + { + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.Builder subBuilder = + null; + if (intentInfo_ != null) { + subBuilder = intentInfo_.toBuilder(); + } + intentInfo_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(intentInfo_); + intentInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder subBuilder = null; + if (pageInfo_ != null) { + subBuilder = pageInfo_.toBuilder(); + } + pageInfo_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(pageInfo_); + pageInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder subBuilder = null; + if (sessionInfo_ != null) { + subBuilder = sessionInfo_.toBuilder(); + } + sessionInfo_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sessionInfo_); + sessionInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.Builder + subBuilder = null; + if (fulfillmentInfo_ != null) { + subBuilder = fulfillmentInfo_.toBuilder(); + } + fulfillmentInfo_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fulfillmentInfo_); + fulfillmentInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + messages_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage>(); + mutable_bitField0_ |= 0x00000001; + } + messages_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.parser(), + extensionRegistry)); + break; + } + case 66: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (payload_ != null) { + subBuilder = payload_.toBuilder(); + } + payload_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(payload_); + payload_ = 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)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.Builder.class); + } + + public interface FulfillmentInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Always present. The tag used to identify which fulfillment is being
+     * called.
+     * 
+ * + * string tag = 1; + * + * @return The tag. + */ + java.lang.String getTag(); + /** + * + * + *
+     * Always present. The tag used to identify which fulfillment is being
+     * called.
+     * 
+ * + * string tag = 1; + * + * @return The bytes for tag. + */ + com.google.protobuf.ByteString getTagBytes(); + } + /** + * + * + *
+   * Represents fulfillment information communicated to the webhook.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo} + */ + public static final class FulfillmentInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo) + FulfillmentInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use FulfillmentInfo.newBuilder() to construct. + private FulfillmentInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FulfillmentInfo() { + tag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FulfillmentInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FulfillmentInfo( + 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(); + + tag_ = 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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_FulfillmentInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_FulfillmentInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.class, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.Builder.class); + } + + public static final int TAG_FIELD_NUMBER = 1; + private volatile java.lang.Object tag_; + /** + * + * + *
+     * Always present. The tag used to identify which fulfillment is being
+     * called.
+     * 
+ * + * string tag = 1; + * + * @return The tag. + */ + @java.lang.Override + public java.lang.String getTag() { + java.lang.Object ref = tag_; + 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(); + tag_ = s; + return s; + } + } + /** + * + * + *
+     * Always present. The tag used to identify which fulfillment is being
+     * called.
+     * 
+ * + * string tag = 1; + * + * @return The bytes for tag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTagBytes() { + java.lang.Object ref = tag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tag_ = 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 (!getTagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tag_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tag_); + } + 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.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo other = + (com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo) obj; + + if (!getTag().equals(other.getTag())) 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) + TAG_FIELD_NUMBER; + hash = (53 * hash) + getTag().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo 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.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo 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.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo 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.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + 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.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo 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.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Represents fulfillment information communicated to the webhook.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo) + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_FulfillmentInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_FulfillmentInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.class, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.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(); + tag_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_FulfillmentInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo build() { + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo result = + new com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo(this); + result.tag_ = tag_; + 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.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + .getDefaultInstance()) return this; + if (!other.getTag().isEmpty()) { + tag_ = other.tag_; + 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.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object tag_ = ""; + /** + * + * + *
+       * Always present. The tag used to identify which fulfillment is being
+       * called.
+       * 
+ * + * string tag = 1; + * + * @return The tag. + */ + public java.lang.String getTag() { + java.lang.Object ref = tag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Always present. The tag used to identify which fulfillment is being
+       * called.
+       * 
+ * + * string tag = 1; + * + * @return The bytes for tag. + */ + public com.google.protobuf.ByteString getTagBytes() { + java.lang.Object ref = tag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Always present. The tag used to identify which fulfillment is being
+       * called.
+       * 
+ * + * string tag = 1; + * + * @param value The tag to set. + * @return This builder for chaining. + */ + public Builder setTag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + tag_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Always present. The tag used to identify which fulfillment is being
+       * called.
+       * 
+ * + * string tag = 1; + * + * @return This builder for chaining. + */ + public Builder clearTag() { + + tag_ = getDefaultInstance().getTag(); + onChanged(); + return this; + } + /** + * + * + *
+       * Always present. The tag used to identify which fulfillment is being
+       * called.
+       * 
+ * + * string tag = 1; + * + * @param value The bytes for tag to set. + * @return This builder for chaining. + */ + public Builder setTagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + tag_ = 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.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo) + private static final com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FulfillmentInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FulfillmentInfo(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.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface IntentInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Always present. The unique identifier of the last matched
+     * [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. Format: `projects/<Project ID>/locations/<Location
+     * ID>/agents/<Agent ID>/intents/<Intent ID>`.
+     * 
+ * + * string last_matched_intent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The lastMatchedIntent. + */ + java.lang.String getLastMatchedIntent(); + /** + * + * + *
+     * Always present. The unique identifier of the last matched
+     * [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. Format: `projects/<Project ID>/locations/<Location
+     * ID>/agents/<Agent ID>/intents/<Intent ID>`.
+     * 
+ * + * string last_matched_intent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for lastMatchedIntent. + */ + com.google.protobuf.ByteString getLastMatchedIntentBytes(); + + /** + * + * + *
+     * Parameters identified as a result of intent matching. This is a map of
+     * the name of the identified parameter to the value of the parameter
+     * identified from the user's utterance. All parameters defined in the
+     * matched intent that are identified will be surfaced here.
+     * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + int getParametersCount(); + /** + * + * + *
+     * Parameters identified as a result of intent matching. This is a map of
+     * the name of the identified parameter to the value of the parameter
+     * identified from the user's utterance. All parameters defined in the
+     * matched intent that are identified will be surfaced here.
+     * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + boolean containsParameters(java.lang.String key); + /** Use {@link #getParametersMap()} instead. */ + @java.lang.Deprecated + java.util.Map< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + getParameters(); + /** + * + * + *
+     * Parameters identified as a result of intent matching. This is a map of
+     * the name of the identified parameter to the value of the parameter
+     * identified from the user's utterance. All parameters defined in the
+     * matched intent that are identified will be surfaced here.
+     * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + java.util.Map< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + getParametersMap(); + /** + * + * + *
+     * Parameters identified as a result of intent matching. This is a map of
+     * the name of the identified parameter to the value of the parameter
+     * identified from the user's utterance. All parameters defined in the
+     * matched intent that are identified will be surfaced here.
+     * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + getParametersOrDefault( + java.lang.String key, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + defaultValue); + /** + * + * + *
+     * Parameters identified as a result of intent matching. This is a map of
+     * the name of the identified parameter to the value of the parameter
+     * identified from the user's utterance. All parameters defined in the
+     * matched intent that are identified will be surfaced here.
+     * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + getParametersOrThrow(java.lang.String key); + } + /** + * + * + *
+   * Represents intent information communicated to the webhook.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo} + */ + public static final class IntentInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo) + IntentInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use IntentInfo.newBuilder() to construct. + private IntentInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IntentInfo() { + lastMatchedIntent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IntentInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IntentInfo( + 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(); + + lastMatchedIntent_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + parameters_ = + com.google.protobuf.MapField.newMapField( + ParametersDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue> + parameters__ = + input.readMessage( + ParametersDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + parameters_.getMutableMap().put(parameters__.getKey(), parameters__.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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetParameters(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.class, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.Builder.class); + } + + public interface IntentParameterValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Always present. Original text value extracted from user utterance.
+       * 
+ * + * string original_value = 1; + * + * @return The originalValue. + */ + java.lang.String getOriginalValue(); + /** + * + * + *
+       * Always present. Original text value extracted from user utterance.
+       * 
+ * + * string original_value = 1; + * + * @return The bytes for originalValue. + */ + com.google.protobuf.ByteString getOriginalValueBytes(); + + /** + * + * + *
+       * Always present. Structured value for the parameter extracted from user
+       * utterance.
+       * 
+ * + * .google.protobuf.Value resolved_value = 2; + * + * @return Whether the resolvedValue field is set. + */ + boolean hasResolvedValue(); + /** + * + * + *
+       * Always present. Structured value for the parameter extracted from user
+       * utterance.
+       * 
+ * + * .google.protobuf.Value resolved_value = 2; + * + * @return The resolvedValue. + */ + com.google.protobuf.Value getResolvedValue(); + /** + * + * + *
+       * Always present. Structured value for the parameter extracted from user
+       * utterance.
+       * 
+ * + * .google.protobuf.Value resolved_value = 2; + */ + com.google.protobuf.ValueOrBuilder getResolvedValueOrBuilder(); + } + /** + * + * + *
+     * Represents a value for an intent parameter.
+     * 
+ * + * Protobuf type {@code + * google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue} + */ + public static final class IntentParameterValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue) + IntentParameterValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use IntentParameterValue.newBuilder() to construct. + private IntentParameterValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IntentParameterValue() { + originalValue_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IntentParameterValue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IntentParameterValue( + 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(); + + originalValue_ = s; + break; + } + case 18: + { + com.google.protobuf.Value.Builder subBuilder = null; + if (resolvedValue_ != null) { + subBuilder = resolvedValue_.toBuilder(); + } + resolvedValue_ = + input.readMessage(com.google.protobuf.Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resolvedValue_); + resolvedValue_ = 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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_IntentParameterValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_IntentParameterValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue.class, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue.Builder.class); + } + + public static final int ORIGINAL_VALUE_FIELD_NUMBER = 1; + private volatile java.lang.Object originalValue_; + /** + * + * + *
+       * Always present. Original text value extracted from user utterance.
+       * 
+ * + * string original_value = 1; + * + * @return The originalValue. + */ + @java.lang.Override + public java.lang.String getOriginalValue() { + java.lang.Object ref = originalValue_; + 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(); + originalValue_ = s; + return s; + } + } + /** + * + * + *
+       * Always present. Original text value extracted from user utterance.
+       * 
+ * + * string original_value = 1; + * + * @return The bytes for originalValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOriginalValueBytes() { + java.lang.Object ref = originalValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + originalValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOLVED_VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.Value resolvedValue_; + /** + * + * + *
+       * Always present. Structured value for the parameter extracted from user
+       * utterance.
+       * 
+ * + * .google.protobuf.Value resolved_value = 2; + * + * @return Whether the resolvedValue field is set. + */ + @java.lang.Override + public boolean hasResolvedValue() { + return resolvedValue_ != null; + } + /** + * + * + *
+       * Always present. Structured value for the parameter extracted from user
+       * utterance.
+       * 
+ * + * .google.protobuf.Value resolved_value = 2; + * + * @return The resolvedValue. + */ + @java.lang.Override + public com.google.protobuf.Value getResolvedValue() { + return resolvedValue_ == null + ? com.google.protobuf.Value.getDefaultInstance() + : resolvedValue_; + } + /** + * + * + *
+       * Always present. Structured value for the parameter extracted from user
+       * utterance.
+       * 
+ * + * .google.protobuf.Value resolved_value = 2; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getResolvedValueOrBuilder() { + return getResolvedValue(); + } + + 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 (!getOriginalValueBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, originalValue_); + } + if (resolvedValue_ != null) { + output.writeMessage(2, getResolvedValue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getOriginalValueBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, originalValue_); + } + if (resolvedValue_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getResolvedValue()); + } + 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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + other = + (com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue) + obj; + + if (!getOriginalValue().equals(other.getOriginalValue())) return false; + if (hasResolvedValue() != other.hasResolvedValue()) return false; + if (hasResolvedValue()) { + if (!getResolvedValue().equals(other.getResolvedValue())) 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) + ORIGINAL_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getOriginalValue().hashCode(); + if (hasResolvedValue()) { + hash = (37 * hash) + RESOLVED_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getResolvedValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue + 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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue + 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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue + 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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue + 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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue + 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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Represents a value for an intent parameter.
+       * 
+ * + * Protobuf type {@code + * google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue) + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_IntentParameterValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_IntentParameterValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue.class, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue.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(); + originalValue_ = ""; + + if (resolvedValueBuilder_ == null) { + resolvedValue_ = null; + } else { + resolvedValue_ = null; + resolvedValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_IntentParameterValue_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + build() { + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + result = + new com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue(this); + result.originalValue_ = originalValue_; + if (resolvedValueBuilder_ == null) { + result.resolvedValue_ = resolvedValue_; + } else { + result.resolvedValue_ = resolvedValueBuilder_.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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue.getDefaultInstance()) return this; + if (!other.getOriginalValue().isEmpty()) { + originalValue_ = other.originalValue_; + onChanged(); + } + if (other.hasResolvedValue()) { + mergeResolvedValue(other.getResolvedValue()); + } + 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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object originalValue_ = ""; + /** + * + * + *
+         * Always present. Original text value extracted from user utterance.
+         * 
+ * + * string original_value = 1; + * + * @return The originalValue. + */ + public java.lang.String getOriginalValue() { + java.lang.Object ref = originalValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + originalValue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Always present. Original text value extracted from user utterance.
+         * 
+ * + * string original_value = 1; + * + * @return The bytes for originalValue. + */ + public com.google.protobuf.ByteString getOriginalValueBytes() { + java.lang.Object ref = originalValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + originalValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Always present. Original text value extracted from user utterance.
+         * 
+ * + * string original_value = 1; + * + * @param value The originalValue to set. + * @return This builder for chaining. + */ + public Builder setOriginalValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + originalValue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Always present. Original text value extracted from user utterance.
+         * 
+ * + * string original_value = 1; + * + * @return This builder for chaining. + */ + public Builder clearOriginalValue() { + + originalValue_ = getDefaultInstance().getOriginalValue(); + onChanged(); + return this; + } + /** + * + * + *
+         * Always present. Original text value extracted from user utterance.
+         * 
+ * + * string original_value = 1; + * + * @param value The bytes for originalValue to set. + * @return This builder for chaining. + */ + public Builder setOriginalValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + originalValue_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Value resolvedValue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + resolvedValueBuilder_; + /** + * + * + *
+         * Always present. Structured value for the parameter extracted from user
+         * utterance.
+         * 
+ * + * .google.protobuf.Value resolved_value = 2; + * + * @return Whether the resolvedValue field is set. + */ + public boolean hasResolvedValue() { + return resolvedValueBuilder_ != null || resolvedValue_ != null; + } + /** + * + * + *
+         * Always present. Structured value for the parameter extracted from user
+         * utterance.
+         * 
+ * + * .google.protobuf.Value resolved_value = 2; + * + * @return The resolvedValue. + */ + public com.google.protobuf.Value getResolvedValue() { + if (resolvedValueBuilder_ == null) { + return resolvedValue_ == null + ? com.google.protobuf.Value.getDefaultInstance() + : resolvedValue_; + } else { + return resolvedValueBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Always present. Structured value for the parameter extracted from user
+         * utterance.
+         * 
+ * + * .google.protobuf.Value resolved_value = 2; + */ + public Builder setResolvedValue(com.google.protobuf.Value value) { + if (resolvedValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resolvedValue_ = value; + onChanged(); + } else { + resolvedValueBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+         * Always present. Structured value for the parameter extracted from user
+         * utterance.
+         * 
+ * + * .google.protobuf.Value resolved_value = 2; + */ + public Builder setResolvedValue(com.google.protobuf.Value.Builder builderForValue) { + if (resolvedValueBuilder_ == null) { + resolvedValue_ = builderForValue.build(); + onChanged(); + } else { + resolvedValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+         * Always present. Structured value for the parameter extracted from user
+         * utterance.
+         * 
+ * + * .google.protobuf.Value resolved_value = 2; + */ + public Builder mergeResolvedValue(com.google.protobuf.Value value) { + if (resolvedValueBuilder_ == null) { + if (resolvedValue_ != null) { + resolvedValue_ = + com.google.protobuf.Value.newBuilder(resolvedValue_) + .mergeFrom(value) + .buildPartial(); + } else { + resolvedValue_ = value; + } + onChanged(); + } else { + resolvedValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+         * Always present. Structured value for the parameter extracted from user
+         * utterance.
+         * 
+ * + * .google.protobuf.Value resolved_value = 2; + */ + public Builder clearResolvedValue() { + if (resolvedValueBuilder_ == null) { + resolvedValue_ = null; + onChanged(); + } else { + resolvedValue_ = null; + resolvedValueBuilder_ = null; + } + + return this; + } + /** + * + * + *
+         * Always present. Structured value for the parameter extracted from user
+         * utterance.
+         * 
+ * + * .google.protobuf.Value resolved_value = 2; + */ + public com.google.protobuf.Value.Builder getResolvedValueBuilder() { + + onChanged(); + return getResolvedValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Always present. Structured value for the parameter extracted from user
+         * utterance.
+         * 
+ * + * .google.protobuf.Value resolved_value = 2; + */ + public com.google.protobuf.ValueOrBuilder getResolvedValueOrBuilder() { + if (resolvedValueBuilder_ != null) { + return resolvedValueBuilder_.getMessageOrBuilder(); + } else { + return resolvedValue_ == null + ? com.google.protobuf.Value.getDefaultInstance() + : resolvedValue_; + } + } + /** + * + * + *
+         * Always present. Structured value for the parameter extracted from user
+         * utterance.
+         * 
+ * + * .google.protobuf.Value resolved_value = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getResolvedValueFieldBuilder() { + if (resolvedValueBuilder_ == null) { + resolvedValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getResolvedValue(), getParentForChildren(), isClean()); + resolvedValue_ = null; + } + return resolvedValueBuilder_; + } + + @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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue) + private static final com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IntentParameterValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IntentParameterValue(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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int LAST_MATCHED_INTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object lastMatchedIntent_; + /** + * + * + *
+     * Always present. The unique identifier of the last matched
+     * [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. Format: `projects/<Project ID>/locations/<Location
+     * ID>/agents/<Agent ID>/intents/<Intent ID>`.
+     * 
+ * + * string last_matched_intent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The lastMatchedIntent. + */ + @java.lang.Override + public java.lang.String getLastMatchedIntent() { + java.lang.Object ref = lastMatchedIntent_; + 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(); + lastMatchedIntent_ = s; + return s; + } + } + /** + * + * + *
+     * Always present. The unique identifier of the last matched
+     * [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. Format: `projects/<Project ID>/locations/<Location
+     * ID>/agents/<Agent ID>/intents/<Intent ID>`.
+     * 
+ * + * string last_matched_intent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for lastMatchedIntent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastMatchedIntentBytes() { + java.lang.Object ref = lastMatchedIntent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastMatchedIntent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARAMETERS_FIELD_NUMBER = 2; + + private static final class ParametersDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_ParametersEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + parameters_; + + private com.google.protobuf.MapField< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + internalGetParameters() { + if (parameters_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ParametersDefaultEntryHolder.defaultEntry); + } + return parameters_; + } + + public int getParametersCount() { + return internalGetParameters().getMap().size(); + } + /** + * + * + *
+     * Parameters identified as a result of intent matching. This is a map of
+     * the name of the identified parameter to the value of the parameter
+     * identified from the user's utterance. All parameters defined in the
+     * matched intent that are identified will be surfaced here.
+     * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + @java.lang.Override + public boolean containsParameters(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetParameters().getMap().containsKey(key); + } + /** Use {@link #getParametersMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + getParameters() { + return getParametersMap(); + } + /** + * + * + *
+     * Parameters identified as a result of intent matching. This is a map of
+     * the name of the identified parameter to the value of the parameter
+     * identified from the user's utterance. All parameters defined in the
+     * matched intent that are identified will be surfaced here.
+     * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + getParametersMap() { + return internalGetParameters().getMap(); + } + /** + * + * + *
+     * Parameters identified as a result of intent matching. This is a map of
+     * the name of the identified parameter to the value of the parameter
+     * identified from the user's utterance. All parameters defined in the
+     * matched intent that are identified will be surfaced here.
+     * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + getParametersOrDefault( + java.lang.String key, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + map = internalGetParameters().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Parameters identified as a result of intent matching. This is a map of
+     * the name of the identified parameter to the value of the parameter
+     * identified from the user's utterance. All parameters defined in the
+     * matched intent that are identified will be surfaced here.
+     * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + getParametersOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + map = internalGetParameters().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 (!getLastMatchedIntentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, lastMatchedIntent_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetParameters(), ParametersDefaultEntryHolder.defaultEntry, 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLastMatchedIntentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, lastMatchedIntent_); + } + for (java.util.Map.Entry< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + entry : internalGetParameters().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue> + parameters__ = + ParametersDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, parameters__); + } + 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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo other = + (com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo) obj; + + if (!getLastMatchedIntent().equals(other.getLastMatchedIntent())) return false; + if (!internalGetParameters().equals(other.internalGetParameters())) 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) + LAST_MATCHED_INTENT_FIELD_NUMBER; + hash = (53 * hash) + getLastMatchedIntent().hashCode(); + if (!internalGetParameters().getMap().isEmpty()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + internalGetParameters().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo 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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo 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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo 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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + 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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo 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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Represents intent information communicated to the webhook.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo) + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetParameters(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableParameters(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.class, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.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(); + lastMatchedIntent_ = ""; + + internalGetMutableParameters().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_IntentInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo build() { + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo result = + new com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo(this); + int from_bitField0_ = bitField0_; + result.lastMatchedIntent_ = lastMatchedIntent_; + result.parameters_ = internalGetParameters(); + result.parameters_.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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .getDefaultInstance()) return this; + if (!other.getLastMatchedIntent().isEmpty()) { + lastMatchedIntent_ = other.lastMatchedIntent_; + onChanged(); + } + internalGetMutableParameters().mergeFrom(other.internalGetParameters()); + 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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object lastMatchedIntent_ = ""; + /** + * + * + *
+       * Always present. The unique identifier of the last matched
+       * [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. Format: `projects/<Project ID>/locations/<Location
+       * ID>/agents/<Agent ID>/intents/<Intent ID>`.
+       * 
+ * + * string last_matched_intent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The lastMatchedIntent. + */ + public java.lang.String getLastMatchedIntent() { + java.lang.Object ref = lastMatchedIntent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lastMatchedIntent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Always present. The unique identifier of the last matched
+       * [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. Format: `projects/<Project ID>/locations/<Location
+       * ID>/agents/<Agent ID>/intents/<Intent ID>`.
+       * 
+ * + * string last_matched_intent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for lastMatchedIntent. + */ + public com.google.protobuf.ByteString getLastMatchedIntentBytes() { + java.lang.Object ref = lastMatchedIntent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastMatchedIntent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Always present. The unique identifier of the last matched
+       * [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. Format: `projects/<Project ID>/locations/<Location
+       * ID>/agents/<Agent ID>/intents/<Intent ID>`.
+       * 
+ * + * string last_matched_intent = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The lastMatchedIntent to set. + * @return This builder for chaining. + */ + public Builder setLastMatchedIntent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + lastMatchedIntent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Always present. The unique identifier of the last matched
+       * [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. Format: `projects/<Project ID>/locations/<Location
+       * ID>/agents/<Agent ID>/intents/<Intent ID>`.
+       * 
+ * + * string last_matched_intent = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearLastMatchedIntent() { + + lastMatchedIntent_ = getDefaultInstance().getLastMatchedIntent(); + onChanged(); + return this; + } + /** + * + * + *
+       * Always present. The unique identifier of the last matched
+       * [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. Format: `projects/<Project ID>/locations/<Location
+       * ID>/agents/<Agent ID>/intents/<Intent ID>`.
+       * 
+ * + * string last_matched_intent = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for lastMatchedIntent to set. + * @return This builder for chaining. + */ + public Builder setLastMatchedIntentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + lastMatchedIntent_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + parameters_; + + private com.google.protobuf.MapField< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + internalGetParameters() { + if (parameters_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ParametersDefaultEntryHolder.defaultEntry); + } + return parameters_; + } + + private com.google.protobuf.MapField< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + internalGetMutableParameters() { + onChanged(); + ; + if (parameters_ == null) { + parameters_ = + com.google.protobuf.MapField.newMapField(ParametersDefaultEntryHolder.defaultEntry); + } + if (!parameters_.isMutable()) { + parameters_ = parameters_.copy(); + } + return parameters_; + } + + public int getParametersCount() { + return internalGetParameters().getMap().size(); + } + /** + * + * + *
+       * Parameters identified as a result of intent matching. This is a map of
+       * the name of the identified parameter to the value of the parameter
+       * identified from the user's utterance. All parameters defined in the
+       * matched intent that are identified will be surfaced here.
+       * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + @java.lang.Override + public boolean containsParameters(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetParameters().getMap().containsKey(key); + } + /** Use {@link #getParametersMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + getParameters() { + return getParametersMap(); + } + /** + * + * + *
+       * Parameters identified as a result of intent matching. This is a map of
+       * the name of the identified parameter to the value of the parameter
+       * identified from the user's utterance. All parameters defined in the
+       * matched intent that are identified will be surfaced here.
+       * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + getParametersMap() { + return internalGetParameters().getMap(); + } + /** + * + * + *
+       * Parameters identified as a result of intent matching. This is a map of
+       * the name of the identified parameter to the value of the parameter
+       * identified from the user's utterance. All parameters defined in the
+       * matched intent that are identified will be surfaced here.
+       * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + getParametersOrDefault( + java.lang.String key, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue> + map = internalGetParameters().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * Parameters identified as a result of intent matching. This is a map of
+       * the name of the identified parameter to the value of the parameter
+       * identified from the user's utterance. All parameters defined in the
+       * matched intent that are identified will be surfaced here.
+       * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + getParametersOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue> + map = internalGetParameters().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearParameters() { + internalGetMutableParameters().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * Parameters identified as a result of intent matching. This is a map of
+       * the name of the identified parameter to the value of the parameter
+       * identified from the user's utterance. All parameters defined in the
+       * matched intent that are identified will be surfaced here.
+       * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + public Builder removeParameters(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableParameters().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> + getMutableParameters() { + return internalGetMutableParameters().getMutableMap(); + } + /** + * + * + *
+       * Parameters identified as a result of intent matching. This is a map of
+       * the name of the identified parameter to the value of the parameter
+       * identified from the user's utterance. All parameters defined in the
+       * matched intent that are identified will be surfaced here.
+       * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + public Builder putParameters( + java.lang.String key, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue + value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableParameters().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * Parameters identified as a result of intent matching. This is a map of
+       * the name of the identified parameter to the value of the parameter
+       * identified from the user's utterance. All parameters defined in the
+       * matched intent that are identified will be surfaced here.
+       * 
+ * + * + * map<string, .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.IntentParameterValue> parameters = 2; + * + */ + public Builder putAllParameters( + java.util.Map< + java.lang.String, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + .IntentParameterValue> + values) { + internalGetMutableParameters().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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo) + private static final com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IntentInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IntentInfo(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.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int DETECT_INTENT_RESPONSE_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object detectIntentResponseId_; + /** + * + * + *
+   * Always present. The unique identifier of the [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse] that
+   * will be returned to the API caller.
+   * 
+ * + * string detect_intent_response_id = 1; + * + * @return The detectIntentResponseId. + */ + @java.lang.Override + public java.lang.String getDetectIntentResponseId() { + java.lang.Object ref = detectIntentResponseId_; + 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(); + detectIntentResponseId_ = s; + return s; + } + } + /** + * + * + *
+   * Always present. The unique identifier of the [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse] that
+   * will be returned to the API caller.
+   * 
+ * + * string detect_intent_response_id = 1; + * + * @return The bytes for detectIntentResponseId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDetectIntentResponseIdBytes() { + java.lang.Object ref = detectIntentResponseId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detectIntentResponseId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FULFILLMENT_INFO_FIELD_NUMBER = 6; + private com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillmentInfo_; + /** + * + * + *
+   * Always present. Information about the fulfillment that triggered this
+   * webhook call.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + * + * @return Whether the fulfillmentInfo field is set. + */ + @java.lang.Override + public boolean hasFulfillmentInfo() { + return fulfillmentInfo_ != null; + } + /** + * + * + *
+   * Always present. Information about the fulfillment that triggered this
+   * webhook call.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + * + * @return The fulfillmentInfo. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + getFulfillmentInfo() { + return fulfillmentInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.getDefaultInstance() + : fulfillmentInfo_; + } + /** + * + * + *
+   * Always present. Information about the fulfillment that triggered this
+   * webhook call.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfoOrBuilder + getFulfillmentInfoOrBuilder() { + return getFulfillmentInfo(); + } + + public static final int INTENT_INFO_FIELD_NUMBER = 3; + private com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intentInfo_; + /** + * + * + *
+   * Information about the last matched intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + * + * @return Whether the intentInfo field is set. + */ + @java.lang.Override + public boolean hasIntentInfo() { + return intentInfo_ != null; + } + /** + * + * + *
+   * Information about the last matched intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + * + * @return The intentInfo. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo getIntentInfo() { + return intentInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.getDefaultInstance() + : intentInfo_; + } + /** + * + * + *
+   * Information about the last matched intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfoOrBuilder + getIntentInfoOrBuilder() { + return getIntentInfo(); + } + + public static final int PAGE_INFO_FIELD_NUMBER = 4; + private com.google.cloud.dialogflow.cx.v3beta1.PageInfo pageInfo_; + /** + * + * + *
+   * Information about page status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + * + * @return Whether the pageInfo field is set. + */ + @java.lang.Override + public boolean hasPageInfo() { + return pageInfo_ != null; + } + /** + * + * + *
+   * Information about page status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + * + * @return The pageInfo. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo getPageInfo() { + return pageInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.getDefaultInstance() + : pageInfo_; + } + /** + * + * + *
+   * Information about page status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder getPageInfoOrBuilder() { + return getPageInfo(); + } + + public static final int SESSION_INFO_FIELD_NUMBER = 5; + private com.google.cloud.dialogflow.cx.v3beta1.SessionInfo sessionInfo_; + /** + * + * + *
+   * Information about session status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + * + * @return Whether the sessionInfo field is set. + */ + @java.lang.Override + public boolean hasSessionInfo() { + return sessionInfo_ != null; + } + /** + * + * + *
+   * Information about session status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + * + * @return The sessionInfo. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionInfo getSessionInfo() { + return sessionInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.getDefaultInstance() + : sessionInfo_; + } + /** + * + * + *
+   * Information about session status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder getSessionInfoOrBuilder() { + return getSessionInfo(); + } + + public static final int MESSAGES_FIELD_NUMBER = 7; + private java.util.List messages_; + /** + * + * + *
+   * The list of rich message responses to present to the user. Webhook can
+   * choose to append or replace this list in
+   * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + @java.lang.Override + public java.util.List getMessagesList() { + return messages_; + } + /** + * + * + *
+   * The list of rich message responses to present to the user. Webhook can
+   * choose to append or replace this list in
+   * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + @java.lang.Override + public java.util.List + getMessagesOrBuilderList() { + return messages_; + } + /** + * + * + *
+   * The list of rich message responses to present to the user. Webhook can
+   * choose to append or replace this list in
+   * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + @java.lang.Override + public int getMessagesCount() { + return messages_.size(); + } + /** + * + * + *
+   * The list of rich message responses to present to the user. Webhook can
+   * choose to append or replace this list in
+   * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessages(int index) { + return messages_.get(index); + } + /** + * + * + *
+   * The list of rich message responses to present to the user. Webhook can
+   * choose to append or replace this list in
+   * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder getMessagesOrBuilder( + int index) { + return messages_.get(index); + } + + public static final int PAYLOAD_FIELD_NUMBER = 8; + private com.google.protobuf.Struct payload_; + /** + * + * + *
+   * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+   * 
+ * + * .google.protobuf.Struct payload = 8; + * + * @return Whether the payload field is set. + */ + @java.lang.Override + public boolean hasPayload() { + return payload_ != null; + } + /** + * + * + *
+   * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+   * 
+ * + * .google.protobuf.Struct payload = 8; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.Struct getPayload() { + return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; + } + /** + * + * + *
+   * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+   * 
+ * + * .google.protobuf.Struct payload = 8; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { + return getPayload(); + } + + 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 (!getDetectIntentResponseIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, detectIntentResponseId_); + } + if (intentInfo_ != null) { + output.writeMessage(3, getIntentInfo()); + } + if (pageInfo_ != null) { + output.writeMessage(4, getPageInfo()); + } + if (sessionInfo_ != null) { + output.writeMessage(5, getSessionInfo()); + } + if (fulfillmentInfo_ != null) { + output.writeMessage(6, getFulfillmentInfo()); + } + for (int i = 0; i < messages_.size(); i++) { + output.writeMessage(7, messages_.get(i)); + } + if (payload_ != null) { + output.writeMessage(8, getPayload()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDetectIntentResponseIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, detectIntentResponseId_); + } + if (intentInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getIntentInfo()); + } + if (pageInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getPageInfo()); + } + if (sessionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getSessionInfo()); + } + if (fulfillmentInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getFulfillmentInfo()); + } + for (int i = 0; i < messages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, messages_.get(i)); + } + if (payload_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getPayload()); + } + 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.dialogflow.cx.v3beta1.WebhookRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest other = + (com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest) obj; + + if (!getDetectIntentResponseId().equals(other.getDetectIntentResponseId())) return false; + if (hasFulfillmentInfo() != other.hasFulfillmentInfo()) return false; + if (hasFulfillmentInfo()) { + if (!getFulfillmentInfo().equals(other.getFulfillmentInfo())) return false; + } + if (hasIntentInfo() != other.hasIntentInfo()) return false; + if (hasIntentInfo()) { + if (!getIntentInfo().equals(other.getIntentInfo())) return false; + } + if (hasPageInfo() != other.hasPageInfo()) return false; + if (hasPageInfo()) { + if (!getPageInfo().equals(other.getPageInfo())) return false; + } + if (hasSessionInfo() != other.hasSessionInfo()) return false; + if (hasSessionInfo()) { + if (!getSessionInfo().equals(other.getSessionInfo())) return false; + } + if (!getMessagesList().equals(other.getMessagesList())) return false; + if (hasPayload() != other.hasPayload()) return false; + if (hasPayload()) { + if (!getPayload().equals(other.getPayload())) 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) + DETECT_INTENT_RESPONSE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDetectIntentResponseId().hashCode(); + if (hasFulfillmentInfo()) { + hash = (37 * hash) + FULFILLMENT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getFulfillmentInfo().hashCode(); + } + if (hasIntentInfo()) { + hash = (37 * hash) + INTENT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getIntentInfo().hashCode(); + } + if (hasPageInfo()) { + hash = (37 * hash) + PAGE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getPageInfo().hashCode(); + } + if (hasSessionInfo()) { + hash = (37 * hash) + SESSION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getSessionInfo().hashCode(); + } + if (getMessagesCount() > 0) { + hash = (37 * hash) + MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getMessagesList().hashCode(); + } + if (hasPayload()) { + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest 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.dialogflow.cx.v3beta1.WebhookRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest 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.dialogflow.cx.v3beta1.WebhookRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest 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.dialogflow.cx.v3beta1.WebhookRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest 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.dialogflow.cx.v3beta1.WebhookRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest 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.dialogflow.cx.v3beta1.WebhookRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for a webhook call.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.WebhookRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.WebhookRequest) + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.class, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMessagesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + detectIntentResponseId_ = ""; + + if (fulfillmentInfoBuilder_ == null) { + fulfillmentInfo_ = null; + } else { + fulfillmentInfo_ = null; + fulfillmentInfoBuilder_ = null; + } + if (intentInfoBuilder_ == null) { + intentInfo_ = null; + } else { + intentInfo_ = null; + intentInfoBuilder_ = null; + } + if (pageInfoBuilder_ == null) { + pageInfo_ = null; + } else { + pageInfo_ = null; + pageInfoBuilder_ = null; + } + if (sessionInfoBuilder_ == null) { + sessionInfo_ = null; + } else { + sessionInfo_ = null; + sessionInfoBuilder_ = null; + } + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + messagesBuilder_.clear(); + } + if (payloadBuilder_ == null) { + payload_ = null; + } else { + payload_ = null; + payloadBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest build() { + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest result = + new com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest(this); + int from_bitField0_ = bitField0_; + result.detectIntentResponseId_ = detectIntentResponseId_; + if (fulfillmentInfoBuilder_ == null) { + result.fulfillmentInfo_ = fulfillmentInfo_; + } else { + result.fulfillmentInfo_ = fulfillmentInfoBuilder_.build(); + } + if (intentInfoBuilder_ == null) { + result.intentInfo_ = intentInfo_; + } else { + result.intentInfo_ = intentInfoBuilder_.build(); + } + if (pageInfoBuilder_ == null) { + result.pageInfo_ = pageInfo_; + } else { + result.pageInfo_ = pageInfoBuilder_.build(); + } + if (sessionInfoBuilder_ == null) { + result.sessionInfo_ = sessionInfo_; + } else { + result.sessionInfo_ = sessionInfoBuilder_.build(); + } + if (messagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.messages_ = messages_; + } else { + result.messages_ = messagesBuilder_.build(); + } + if (payloadBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = payloadBuilder_.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.dialogflow.cx.v3beta1.WebhookRequest) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.getDefaultInstance()) + return this; + if (!other.getDetectIntentResponseId().isEmpty()) { + detectIntentResponseId_ = other.detectIntentResponseId_; + onChanged(); + } + if (other.hasFulfillmentInfo()) { + mergeFulfillmentInfo(other.getFulfillmentInfo()); + } + if (other.hasIntentInfo()) { + mergeIntentInfo(other.getIntentInfo()); + } + if (other.hasPageInfo()) { + mergePageInfo(other.getPageInfo()); + } + if (other.hasSessionInfo()) { + mergeSessionInfo(other.getSessionInfo()); + } + if (messagesBuilder_ == null) { + if (!other.messages_.isEmpty()) { + if (messages_.isEmpty()) { + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMessagesIsMutable(); + messages_.addAll(other.messages_); + } + onChanged(); + } + } else { + if (!other.messages_.isEmpty()) { + if (messagesBuilder_.isEmpty()) { + messagesBuilder_.dispose(); + messagesBuilder_ = null; + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000001); + messagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMessagesFieldBuilder() + : null; + } else { + messagesBuilder_.addAllMessages(other.messages_); + } + } + } + if (other.hasPayload()) { + mergePayload(other.getPayload()); + } + 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.dialogflow.cx.v3beta1.WebhookRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object detectIntentResponseId_ = ""; + /** + * + * + *
+     * Always present. The unique identifier of the [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse] that
+     * will be returned to the API caller.
+     * 
+ * + * string detect_intent_response_id = 1; + * + * @return The detectIntentResponseId. + */ + public java.lang.String getDetectIntentResponseId() { + java.lang.Object ref = detectIntentResponseId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detectIntentResponseId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Always present. The unique identifier of the [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse] that
+     * will be returned to the API caller.
+     * 
+ * + * string detect_intent_response_id = 1; + * + * @return The bytes for detectIntentResponseId. + */ + public com.google.protobuf.ByteString getDetectIntentResponseIdBytes() { + java.lang.Object ref = detectIntentResponseId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detectIntentResponseId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Always present. The unique identifier of the [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse] that
+     * will be returned to the API caller.
+     * 
+ * + * string detect_intent_response_id = 1; + * + * @param value The detectIntentResponseId to set. + * @return This builder for chaining. + */ + public Builder setDetectIntentResponseId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + detectIntentResponseId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Always present. The unique identifier of the [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse] that
+     * will be returned to the API caller.
+     * 
+ * + * string detect_intent_response_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearDetectIntentResponseId() { + + detectIntentResponseId_ = getDefaultInstance().getDetectIntentResponseId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Always present. The unique identifier of the [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse] that
+     * will be returned to the API caller.
+     * 
+ * + * string detect_intent_response_id = 1; + * + * @param value The bytes for detectIntentResponseId to set. + * @return This builder for chaining. + */ + public Builder setDetectIntentResponseIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + detectIntentResponseId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillmentInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfoOrBuilder> + fulfillmentInfoBuilder_; + /** + * + * + *
+     * Always present. Information about the fulfillment that triggered this
+     * webhook call.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + * + * @return Whether the fulfillmentInfo field is set. + */ + public boolean hasFulfillmentInfo() { + return fulfillmentInfoBuilder_ != null || fulfillmentInfo_ != null; + } + /** + * + * + *
+     * Always present. Information about the fulfillment that triggered this
+     * webhook call.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + * + * @return The fulfillmentInfo. + */ + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + getFulfillmentInfo() { + if (fulfillmentInfoBuilder_ == null) { + return fulfillmentInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + .getDefaultInstance() + : fulfillmentInfo_; + } else { + return fulfillmentInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Always present. Information about the fulfillment that triggered this
+     * webhook call.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + */ + public Builder setFulfillmentInfo( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo value) { + if (fulfillmentInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fulfillmentInfo_ = value; + onChanged(); + } else { + fulfillmentInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Always present. Information about the fulfillment that triggered this
+     * webhook call.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + */ + public Builder setFulfillmentInfo( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.Builder + builderForValue) { + if (fulfillmentInfoBuilder_ == null) { + fulfillmentInfo_ = builderForValue.build(); + onChanged(); + } else { + fulfillmentInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Always present. Information about the fulfillment that triggered this
+     * webhook call.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + */ + public Builder mergeFulfillmentInfo( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo value) { + if (fulfillmentInfoBuilder_ == null) { + if (fulfillmentInfo_ != null) { + fulfillmentInfo_ = + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.newBuilder( + fulfillmentInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + fulfillmentInfo_ = value; + } + onChanged(); + } else { + fulfillmentInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Always present. Information about the fulfillment that triggered this
+     * webhook call.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + */ + public Builder clearFulfillmentInfo() { + if (fulfillmentInfoBuilder_ == null) { + fulfillmentInfo_ = null; + onChanged(); + } else { + fulfillmentInfo_ = null; + fulfillmentInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Always present. Information about the fulfillment that triggered this
+     * webhook call.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.Builder + getFulfillmentInfoBuilder() { + + onChanged(); + return getFulfillmentInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Always present. Information about the fulfillment that triggered this
+     * webhook call.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfoOrBuilder + getFulfillmentInfoOrBuilder() { + if (fulfillmentInfoBuilder_ != null) { + return fulfillmentInfoBuilder_.getMessageOrBuilder(); + } else { + return fulfillmentInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo + .getDefaultInstance() + : fulfillmentInfo_; + } + } + /** + * + * + *
+     * Always present. Information about the fulfillment that triggered this
+     * webhook call.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfoOrBuilder> + getFulfillmentInfoFieldBuilder() { + if (fulfillmentInfoBuilder_ == null) { + fulfillmentInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfoOrBuilder>( + getFulfillmentInfo(), getParentForChildren(), isClean()); + fulfillmentInfo_ = null; + } + return fulfillmentInfoBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intentInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfoOrBuilder> + intentInfoBuilder_; + /** + * + * + *
+     * Information about the last matched intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + * + * @return Whether the intentInfo field is set. + */ + public boolean hasIntentInfo() { + return intentInfoBuilder_ != null || intentInfo_ != null; + } + /** + * + * + *
+     * Information about the last matched intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + * + * @return The intentInfo. + */ + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo getIntentInfo() { + if (intentInfoBuilder_ == null) { + return intentInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.getDefaultInstance() + : intentInfo_; + } else { + return intentInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Information about the last matched intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + */ + public Builder setIntentInfo( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo value) { + if (intentInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + intentInfo_ = value; + onChanged(); + } else { + intentInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Information about the last matched intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + */ + public Builder setIntentInfo( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.Builder builderForValue) { + if (intentInfoBuilder_ == null) { + intentInfo_ = builderForValue.build(); + onChanged(); + } else { + intentInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Information about the last matched intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + */ + public Builder mergeIntentInfo( + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo value) { + if (intentInfoBuilder_ == null) { + if (intentInfo_ != null) { + intentInfo_ = + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.newBuilder( + intentInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + intentInfo_ = value; + } + onChanged(); + } else { + intentInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Information about the last matched intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + */ + public Builder clearIntentInfo() { + if (intentInfoBuilder_ == null) { + intentInfo_ = null; + onChanged(); + } else { + intentInfo_ = null; + intentInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Information about the last matched intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + */ + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.Builder + getIntentInfoBuilder() { + + onChanged(); + return getIntentInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Information about the last matched intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + */ + public com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfoOrBuilder + getIntentInfoOrBuilder() { + if (intentInfoBuilder_ != null) { + return intentInfoBuilder_.getMessageOrBuilder(); + } else { + return intentInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.getDefaultInstance() + : intentInfo_; + } + } + /** + * + * + *
+     * Information about the last matched intent.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfoOrBuilder> + getIntentInfoFieldBuilder() { + if (intentInfoBuilder_ == null) { + intentInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfoOrBuilder>( + getIntentInfo(), getParentForChildren(), isClean()); + intentInfo_ = null; + } + return intentInfoBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.PageInfo pageInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder> + pageInfoBuilder_; + /** + * + * + *
+     * Information about page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + * + * @return Whether the pageInfo field is set. + */ + public boolean hasPageInfo() { + return pageInfoBuilder_ != null || pageInfo_ != null; + } + /** + * + * + *
+     * Information about page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + * + * @return The pageInfo. + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo getPageInfo() { + if (pageInfoBuilder_ == null) { + return pageInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.getDefaultInstance() + : pageInfo_; + } else { + return pageInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Information about page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + */ + public Builder setPageInfo(com.google.cloud.dialogflow.cx.v3beta1.PageInfo value) { + if (pageInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pageInfo_ = value; + onChanged(); + } else { + pageInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Information about page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + */ + public Builder setPageInfo( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder builderForValue) { + if (pageInfoBuilder_ == null) { + pageInfo_ = builderForValue.build(); + onChanged(); + } else { + pageInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Information about page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + */ + public Builder mergePageInfo(com.google.cloud.dialogflow.cx.v3beta1.PageInfo value) { + if (pageInfoBuilder_ == null) { + if (pageInfo_ != null) { + pageInfo_ = + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.newBuilder(pageInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + pageInfo_ = value; + } + onChanged(); + } else { + pageInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Information about page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + */ + public Builder clearPageInfo() { + if (pageInfoBuilder_ == null) { + pageInfo_ = null; + onChanged(); + } else { + pageInfo_ = null; + pageInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Information about page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder getPageInfoBuilder() { + + onChanged(); + return getPageInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Information about page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder getPageInfoOrBuilder() { + if (pageInfoBuilder_ != null) { + return pageInfoBuilder_.getMessageOrBuilder(); + } else { + return pageInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.getDefaultInstance() + : pageInfo_; + } + } + /** + * + * + *
+     * Information about page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder> + getPageInfoFieldBuilder() { + if (pageInfoBuilder_ == null) { + pageInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder>( + getPageInfo(), getParentForChildren(), isClean()); + pageInfo_ = null; + } + return pageInfoBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.SessionInfo sessionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo, + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder> + sessionInfoBuilder_; + /** + * + * + *
+     * Information about session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + * + * @return Whether the sessionInfo field is set. + */ + public boolean hasSessionInfo() { + return sessionInfoBuilder_ != null || sessionInfo_ != null; + } + /** + * + * + *
+     * Information about session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + * + * @return The sessionInfo. + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionInfo getSessionInfo() { + if (sessionInfoBuilder_ == null) { + return sessionInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.getDefaultInstance() + : sessionInfo_; + } else { + return sessionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Information about session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + */ + public Builder setSessionInfo(com.google.cloud.dialogflow.cx.v3beta1.SessionInfo value) { + if (sessionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sessionInfo_ = value; + onChanged(); + } else { + sessionInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Information about session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + */ + public Builder setSessionInfo( + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder builderForValue) { + if (sessionInfoBuilder_ == null) { + sessionInfo_ = builderForValue.build(); + onChanged(); + } else { + sessionInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Information about session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + */ + public Builder mergeSessionInfo(com.google.cloud.dialogflow.cx.v3beta1.SessionInfo value) { + if (sessionInfoBuilder_ == null) { + if (sessionInfo_ != null) { + sessionInfo_ = + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.newBuilder(sessionInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + sessionInfo_ = value; + } + onChanged(); + } else { + sessionInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Information about session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + */ + public Builder clearSessionInfo() { + if (sessionInfoBuilder_ == null) { + sessionInfo_ = null; + onChanged(); + } else { + sessionInfo_ = null; + sessionInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Information about session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder getSessionInfoBuilder() { + + onChanged(); + return getSessionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Information about session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder getSessionInfoOrBuilder() { + if (sessionInfoBuilder_ != null) { + return sessionInfoBuilder_.getMessageOrBuilder(); + } else { + return sessionInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.getDefaultInstance() + : sessionInfo_; + } + } + /** + * + * + *
+     * Information about session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo, + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder> + getSessionInfoFieldBuilder() { + if (sessionInfoBuilder_ == null) { + sessionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo, + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder>( + getSessionInfo(), getParentForChildren(), isClean()); + sessionInfo_ = null; + } + return sessionInfoBuilder_; + } + + private java.util.List messages_ = + java.util.Collections.emptyList(); + + private void ensureMessagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + messages_ = + new java.util.ArrayList( + messages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder> + messagesBuilder_; + + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public java.util.List + getMessagesList() { + if (messagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(messages_); + } else { + return messagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public int getMessagesCount() { + if (messagesBuilder_ == null) { + return messages_.size(); + } else { + return messagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessages(int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public Builder setMessages( + int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.set(index, value); + onChanged(); + } else { + messagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public Builder setMessages( + int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.set(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public Builder addMessages(com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(value); + onChanged(); + } else { + messagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public Builder addMessages( + int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(index, value); + onChanged(); + } else { + messagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public Builder addMessages( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public Builder addMessages( + int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public Builder addAllMessages( + java.lang.Iterable + values) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, messages_); + onChanged(); + } else { + messagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public Builder clearMessages() { + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + messagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public Builder removeMessages(int index) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.remove(index); + onChanged(); + } else { + messagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder getMessagesBuilder( + int index) { + return getMessagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder getMessagesOrBuilder( + int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public java.util.List + getMessagesOrBuilderList() { + if (messagesBuilder_ != null) { + return messagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(messages_); + } + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder addMessagesBuilder() { + return getMessagesFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance()); + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder addMessagesBuilder( + int index) { + return getMessagesFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance()); + } + /** + * + * + *
+     * The list of rich message responses to present to the user. Webhook can
+     * choose to append or replace this list in
+     * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + public java.util.List + getMessagesBuilderList() { + return getMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder> + getMessagesFieldBuilder() { + if (messagesBuilder_ == null) { + messagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder>( + messages_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + messages_ = null; + } + return messagesBuilder_; + } + + private com.google.protobuf.Struct payload_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + payloadBuilder_; + /** + * + * + *
+     * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+     * 
+ * + * .google.protobuf.Struct payload = 8; + * + * @return Whether the payload field is set. + */ + public boolean hasPayload() { + return payloadBuilder_ != null || payload_ != null; + } + /** + * + * + *
+     * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+     * 
+ * + * .google.protobuf.Struct payload = 8; + * + * @return The payload. + */ + public com.google.protobuf.Struct getPayload() { + if (payloadBuilder_ == null) { + return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; + } else { + return payloadBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+     * 
+ * + * .google.protobuf.Struct payload = 8; + */ + public Builder setPayload(com.google.protobuf.Struct value) { + if (payloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + payloadBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+     * 
+ * + * .google.protobuf.Struct payload = 8; + */ + public Builder setPayload(com.google.protobuf.Struct.Builder builderForValue) { + if (payloadBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + payloadBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+     * 
+ * + * .google.protobuf.Struct payload = 8; + */ + public Builder mergePayload(com.google.protobuf.Struct value) { + if (payloadBuilder_ == null) { + if (payload_ != null) { + payload_ = + com.google.protobuf.Struct.newBuilder(payload_).mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + payloadBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+     * 
+ * + * .google.protobuf.Struct payload = 8; + */ + public Builder clearPayload() { + if (payloadBuilder_ == null) { + payload_ = null; + onChanged(); + } else { + payload_ = null; + payloadBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+     * 
+ * + * .google.protobuf.Struct payload = 8; + */ + public com.google.protobuf.Struct.Builder getPayloadBuilder() { + + onChanged(); + return getPayloadFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+     * 
+ * + * .google.protobuf.Struct payload = 8; + */ + public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { + if (payloadBuilder_ != null) { + return payloadBuilder_.getMessageOrBuilder(); + } else { + return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; + } + } + /** + * + * + *
+     * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+     * 
+ * + * .google.protobuf.Struct payload = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getPayloadFieldBuilder() { + if (payloadBuilder_ == null) { + payloadBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getPayload(), getParentForChildren(), isClean()); + payload_ = null; + } + return payloadBuilder_; + } + + @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.dialogflow.cx.v3beta1.WebhookRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.WebhookRequest) + private static final com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WebhookRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WebhookRequest(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.dialogflow.cx.v3beta1.WebhookRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookRequestOrBuilder.java new file mode 100644 index 000000000..88aac4b74 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookRequestOrBuilder.java @@ -0,0 +1,297 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface WebhookRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.WebhookRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Always present. The unique identifier of the [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse] that
+   * will be returned to the API caller.
+   * 
+ * + * string detect_intent_response_id = 1; + * + * @return The detectIntentResponseId. + */ + java.lang.String getDetectIntentResponseId(); + /** + * + * + *
+   * Always present. The unique identifier of the [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse] that
+   * will be returned to the API caller.
+   * 
+ * + * string detect_intent_response_id = 1; + * + * @return The bytes for detectIntentResponseId. + */ + com.google.protobuf.ByteString getDetectIntentResponseIdBytes(); + + /** + * + * + *
+   * Always present. Information about the fulfillment that triggered this
+   * webhook call.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + * + * @return Whether the fulfillmentInfo field is set. + */ + boolean hasFulfillmentInfo(); + /** + * + * + *
+   * Always present. Information about the fulfillment that triggered this
+   * webhook call.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + * + * @return The fulfillmentInfo. + */ + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo getFulfillmentInfo(); + /** + * + * + *
+   * Always present. Information about the fulfillment that triggered this
+   * webhook call.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo fulfillment_info = 6; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfoOrBuilder + getFulfillmentInfoOrBuilder(); + + /** + * + * + *
+   * Information about the last matched intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + * + * @return Whether the intentInfo field is set. + */ + boolean hasIntentInfo(); + /** + * + * + *
+   * Information about the last matched intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + * + * @return The intentInfo. + */ + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo getIntentInfo(); + /** + * + * + *
+   * Information about the last matched intent.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfo intent_info = 3; + */ + com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.IntentInfoOrBuilder + getIntentInfoOrBuilder(); + + /** + * + * + *
+   * Information about page status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + * + * @return Whether the pageInfo field is set. + */ + boolean hasPageInfo(); + /** + * + * + *
+   * Information about page status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + * + * @return The pageInfo. + */ + com.google.cloud.dialogflow.cx.v3beta1.PageInfo getPageInfo(); + /** + * + * + *
+   * Information about page status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 4; + */ + com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder getPageInfoOrBuilder(); + + /** + * + * + *
+   * Information about session status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + * + * @return Whether the sessionInfo field is set. + */ + boolean hasSessionInfo(); + /** + * + * + *
+   * Information about session status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + * + * @return The sessionInfo. + */ + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo getSessionInfo(); + /** + * + * + *
+   * Information about session status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 5; + */ + com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder getSessionInfoOrBuilder(); + + /** + * + * + *
+   * The list of rich message responses to present to the user. Webhook can
+   * choose to append or replace this list in
+   * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + java.util.List getMessagesList(); + /** + * + * + *
+   * The list of rich message responses to present to the user. Webhook can
+   * choose to append or replace this list in
+   * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessages(int index); + /** + * + * + *
+   * The list of rich message responses to present to the user. Webhook can
+   * choose to append or replace this list in
+   * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + int getMessagesCount(); + /** + * + * + *
+   * The list of rich message responses to present to the user. Webhook can
+   * choose to append or replace this list in
+   * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + java.util.List + getMessagesOrBuilderList(); + /** + * + * + *
+   * The list of rich message responses to present to the user. Webhook can
+   * choose to append or replace this list in
+   * [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response];
+   * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 7; + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder getMessagesOrBuilder(int index); + + /** + * + * + *
+   * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+   * 
+ * + * .google.protobuf.Struct payload = 8; + * + * @return Whether the payload field is set. + */ + boolean hasPayload(); + /** + * + * + *
+   * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+   * 
+ * + * .google.protobuf.Struct payload = 8; + * + * @return The payload. + */ + com.google.protobuf.Struct getPayload(); + /** + * + * + *
+   * Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload].
+   * 
+ * + * .google.protobuf.Struct payload = 8; + */ + com.google.protobuf.StructOrBuilder getPayloadOrBuilder(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookResponse.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookResponse.java new file mode 100644 index 000000000..f0fd8ac36 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookResponse.java @@ -0,0 +1,3573 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +/** + * + * + *
+ * The response message for a webhook call.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.WebhookResponse} + */ +public final class WebhookResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.WebhookResponse) + WebhookResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebhookResponse.newBuilder() to construct. + private WebhookResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WebhookResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WebhookResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WebhookResponse( + 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.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.Builder + subBuilder = null; + if (fulfillmentResponse_ != null) { + subBuilder = fulfillmentResponse_.toBuilder(); + } + fulfillmentResponse_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fulfillmentResponse_); + fulfillmentResponse_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder subBuilder = null; + if (pageInfo_ != null) { + subBuilder = pageInfo_.toBuilder(); + } + pageInfo_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(pageInfo_); + pageInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder subBuilder = null; + if (sessionInfo_ != null) { + subBuilder = sessionInfo_.toBuilder(); + } + sessionInfo_ = + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sessionInfo_); + sessionInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (payload_ != null) { + subBuilder = payload_.toBuilder(); + } + payload_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(payload_); + payload_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + transitionCase_ = 5; + transition_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + transitionCase_ = 6; + transition_ = 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.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.Builder.class); + } + + public interface FulfillmentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + java.util.List getMessagesList(); + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessages(int index); + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + int getMessagesCount(); + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + java.util.List + getMessagesOrBuilderList(); + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder getMessagesOrBuilder(int index); + + /** + * + * + *
+     * Merge behavior for `messages`.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2; + * + * + * @return The enum numeric value on the wire for mergeBehavior. + */ + int getMergeBehaviorValue(); + /** + * + * + *
+     * Merge behavior for `messages`.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2; + * + * + * @return The mergeBehavior. + */ + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior + getMergeBehavior(); + } + /** + * + * + *
+   * Represents a fulfillment response to the user.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse} + */ + public static final class FulfillmentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse) + FulfillmentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use FulfillmentResponse.newBuilder() to construct. + private FulfillmentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FulfillmentResponse() { + messages_ = java.util.Collections.emptyList(); + mergeBehavior_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FulfillmentResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FulfillmentResponse( + 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)) { + messages_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage>(); + mutable_bitField0_ |= 0x00000001; + } + messages_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.parser(), + extensionRegistry)); + break; + } + case 16: + { + int rawValue = input.readEnum(); + + mergeBehavior_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_FulfillmentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_FulfillmentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.Builder + .class); + } + + /** + * + * + *
+     * Defines merge behavior for `messages`.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior} + */ + public enum MergeBehavior implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Not specified. `APPEND` will be used.
+       * 
+ * + * MERGE_BEHAVIOR_UNSPECIFIED = 0; + */ + MERGE_BEHAVIOR_UNSPECIFIED(0), + /** + * + * + *
+       * `messages` will be appended to the list of messages waiting to be sent
+       * to the user.
+       * 
+ * + * APPEND = 1; + */ + APPEND(1), + /** + * + * + *
+       * `messages` will replace the list of messages waiting to be sent to the
+       * user.
+       * 
+ * + * REPLACE = 2; + */ + REPLACE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Not specified. `APPEND` will be used.
+       * 
+ * + * MERGE_BEHAVIOR_UNSPECIFIED = 0; + */ + public static final int MERGE_BEHAVIOR_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * `messages` will be appended to the list of messages waiting to be sent
+       * to the user.
+       * 
+ * + * APPEND = 1; + */ + public static final int APPEND_VALUE = 1; + /** + * + * + *
+       * `messages` will replace the list of messages waiting to be sent to the
+       * user.
+       * 
+ * + * REPLACE = 2; + */ + public static final int REPLACE_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MergeBehavior 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 MergeBehavior forNumber(int value) { + switch (value) { + case 0: + return MERGE_BEHAVIOR_UNSPECIFIED; + case 1: + return APPEND; + case 2: + return REPLACE; + 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 MergeBehavior findValueByNumber(int number) { + return MergeBehavior.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final MergeBehavior[] VALUES = values(); + + public static MergeBehavior 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 MergeBehavior(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior) + } + + public static final int MESSAGES_FIELD_NUMBER = 1; + private java.util.List messages_; + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + @java.lang.Override + public java.util.List + getMessagesList() { + return messages_; + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + @java.lang.Override + public java.util.List + getMessagesOrBuilderList() { + return messages_; + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + @java.lang.Override + public int getMessagesCount() { + return messages_.size(); + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessages(int index) { + return messages_.get(index); + } + /** + * + * + *
+     * The list of rich message responses to present to the user.
+     * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder getMessagesOrBuilder( + int index) { + return messages_.get(index); + } + + public static final int MERGE_BEHAVIOR_FIELD_NUMBER = 2; + private int mergeBehavior_; + /** + * + * + *
+     * Merge behavior for `messages`.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2; + * + * + * @return The enum numeric value on the wire for mergeBehavior. + */ + @java.lang.Override + public int getMergeBehaviorValue() { + return mergeBehavior_; + } + /** + * + * + *
+     * Merge behavior for `messages`.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2; + * + * + * @return The mergeBehavior. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior + getMergeBehavior() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior + result = + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + .MergeBehavior.valueOf(mergeBehavior_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior + .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 { + for (int i = 0; i < messages_.size(); i++) { + output.writeMessage(1, messages_.get(i)); + } + if (mergeBehavior_ + != com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + .MergeBehavior.MERGE_BEHAVIOR_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, mergeBehavior_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < messages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, messages_.get(i)); + } + if (mergeBehavior_ + != com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + .MergeBehavior.MERGE_BEHAVIOR_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, mergeBehavior_); + } + 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.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse) obj; + + if (!getMessagesList().equals(other.getMessagesList())) return false; + if (mergeBehavior_ != other.mergeBehavior_) 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 (getMessagesCount() > 0) { + hash = (37 * hash) + MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getMessagesList().hashCode(); + } + hash = (37 * hash) + MERGE_BEHAVIOR_FIELD_NUMBER; + hash = (53 * hash) + mergeBehavior_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + 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.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + 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.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + 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.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + 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.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + 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.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Represents a fulfillment response to the user.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse) + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_FulfillmentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_FulfillmentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.Builder + .class); + } + + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMessagesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + messagesBuilder_.clear(); + } + mergeBehavior_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_FulfillmentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse(this); + int from_bitField0_ = bitField0_; + if (messagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.messages_ = messages_; + } else { + result.messages_ = messagesBuilder_.build(); + } + result.mergeBehavior_ = mergeBehavior_; + 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.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + .getDefaultInstance()) return this; + if (messagesBuilder_ == null) { + if (!other.messages_.isEmpty()) { + if (messages_.isEmpty()) { + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMessagesIsMutable(); + messages_.addAll(other.messages_); + } + onChanged(); + } + } else { + if (!other.messages_.isEmpty()) { + if (messagesBuilder_.isEmpty()) { + messagesBuilder_.dispose(); + messagesBuilder_ = null; + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000001); + messagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMessagesFieldBuilder() + : null; + } else { + messagesBuilder_.addAllMessages(other.messages_); + } + } + } + if (other.mergeBehavior_ != 0) { + setMergeBehaviorValue(other.getMergeBehaviorValue()); + } + 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.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List messages_ = + java.util.Collections.emptyList(); + + private void ensureMessagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + messages_ = + new java.util.ArrayList( + messages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder> + messagesBuilder_; + + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public java.util.List + getMessagesList() { + if (messagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(messages_); + } else { + return messagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public int getMessagesCount() { + if (messagesBuilder_ == null) { + return messages_.size(); + } else { + return messagesBuilder_.getCount(); + } + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessages(int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder setMessages( + int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.set(index, value); + onChanged(); + } else { + messagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder setMessages( + int index, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.set(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder addMessages(com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(value); + onChanged(); + } else { + messagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder addMessages( + int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(index, value); + onChanged(); + } else { + messagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder addMessages( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder addMessages( + int index, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder addAllMessages( + java.lang.Iterable + values) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, messages_); + onChanged(); + } else { + messagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder clearMessages() { + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + messagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public Builder removeMessages(int index) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.remove(index); + onChanged(); + } else { + messagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder getMessagesBuilder( + int index) { + return getMessagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder getMessagesOrBuilder( + int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public java.util.List< + ? extends com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder> + getMessagesOrBuilderList() { + if (messagesBuilder_ != null) { + return messagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(messages_); + } + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder addMessagesBuilder() { + return getMessagesFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance()); + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder addMessagesBuilder( + int index) { + return getMessagesFieldBuilder() + .addBuilder( + index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance()); + } + /** + * + * + *
+       * The list of rich message responses to present to the user.
+       * 
+ * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1; + */ + public java.util.List + getMessagesBuilderList() { + return getMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder> + getMessagesFieldBuilder() { + if (messagesBuilder_ == null) { + messagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder>( + messages_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + messages_ = null; + } + return messagesBuilder_; + } + + private int mergeBehavior_ = 0; + /** + * + * + *
+       * Merge behavior for `messages`.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2; + * + * + * @return The enum numeric value on the wire for mergeBehavior. + */ + @java.lang.Override + public int getMergeBehaviorValue() { + return mergeBehavior_; + } + /** + * + * + *
+       * Merge behavior for `messages`.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2; + * + * + * @param value The enum numeric value on the wire for mergeBehavior to set. + * @return This builder for chaining. + */ + public Builder setMergeBehaviorValue(int value) { + + mergeBehavior_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Merge behavior for `messages`.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2; + * + * + * @return The mergeBehavior. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + .MergeBehavior + getMergeBehavior() { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior + result = + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + .MergeBehavior.valueOf(mergeBehavior_); + return result == null + ? com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + .MergeBehavior.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Merge behavior for `messages`.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2; + * + * + * @param value The mergeBehavior to set. + * @return This builder for chaining. + */ + public Builder setMergeBehavior( + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior + value) { + if (value == null) { + throw new NullPointerException(); + } + + mergeBehavior_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Merge behavior for `messages`.
+       * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearMergeBehavior() { + + mergeBehavior_ = 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.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FulfillmentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FulfillmentResponse(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.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int transitionCase_ = 0; + private java.lang.Object transition_; + + public enum TransitionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TARGET_PAGE(5), + TARGET_FLOW(6), + TRANSITION_NOT_SET(0); + private final int value; + + private TransitionCase(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 TransitionCase valueOf(int value) { + return forNumber(value); + } + + public static TransitionCase forNumber(int value) { + switch (value) { + case 5: + return TARGET_PAGE; + case 6: + return TARGET_FLOW; + case 0: + return TRANSITION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TransitionCase getTransitionCase() { + return TransitionCase.forNumber(transitionCase_); + } + + public static final int FULFILLMENT_RESPONSE_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + fulfillmentResponse_; + /** + * + * + *
+   * The fulfillment response to send to the user. This field can be omitted by
+   * the webhook if it does not intend to send any response to the user.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + * + * @return Whether the fulfillmentResponse field is set. + */ + @java.lang.Override + public boolean hasFulfillmentResponse() { + return fulfillmentResponse_ != null; + } + /** + * + * + *
+   * The fulfillment response to send to the user. This field can be omitted by
+   * the webhook if it does not intend to send any response to the user.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + * + * @return The fulfillmentResponse. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + getFulfillmentResponse() { + return fulfillmentResponse_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + .getDefaultInstance() + : fulfillmentResponse_; + } + /** + * + * + *
+   * The fulfillment response to send to the user. This field can be omitted by
+   * the webhook if it does not intend to send any response to the user.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponseOrBuilder + getFulfillmentResponseOrBuilder() { + return getFulfillmentResponse(); + } + + public static final int PAGE_INFO_FIELD_NUMBER = 2; + private com.google.cloud.dialogflow.cx.v3beta1.PageInfo pageInfo_; + /** + * + * + *
+   * Information about page status. This field can be omitted by the webhook if
+   * it does not intend to modify page status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + * + * @return Whether the pageInfo field is set. + */ + @java.lang.Override + public boolean hasPageInfo() { + return pageInfo_ != null; + } + /** + * + * + *
+   * Information about page status. This field can be omitted by the webhook if
+   * it does not intend to modify page status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + * + * @return The pageInfo. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo getPageInfo() { + return pageInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.getDefaultInstance() + : pageInfo_; + } + /** + * + * + *
+   * Information about page status. This field can be omitted by the webhook if
+   * it does not intend to modify page status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder getPageInfoOrBuilder() { + return getPageInfo(); + } + + public static final int SESSION_INFO_FIELD_NUMBER = 3; + private com.google.cloud.dialogflow.cx.v3beta1.SessionInfo sessionInfo_; + /** + * + * + *
+   * Information about session status. This field can be omitted by the webhook
+   * if it does not intend to modify session status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + * + * @return Whether the sessionInfo field is set. + */ + @java.lang.Override + public boolean hasSessionInfo() { + return sessionInfo_ != null; + } + /** + * + * + *
+   * Information about session status. This field can be omitted by the webhook
+   * if it does not intend to modify session status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + * + * @return The sessionInfo. + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionInfo getSessionInfo() { + return sessionInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.getDefaultInstance() + : sessionInfo_; + } + /** + * + * + *
+   * Information about session status. This field can be omitted by the webhook
+   * if it does not intend to modify session status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder getSessionInfoOrBuilder() { + return getSessionInfo(); + } + + public static final int PAYLOAD_FIELD_NUMBER = 4; + private com.google.protobuf.Struct payload_; + /** + * + * + *
+   * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+   * 
+ * + * .google.protobuf.Struct payload = 4; + * + * @return Whether the payload field is set. + */ + @java.lang.Override + public boolean hasPayload() { + return payload_ != null; + } + /** + * + * + *
+   * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+   * 
+ * + * .google.protobuf.Struct payload = 4; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.Struct getPayload() { + return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; + } + /** + * + * + *
+   * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+   * 
+ * + * .google.protobuf.Struct payload = 4; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { + return getPayload(); + } + + public static final int TARGET_PAGE_FIELD_NUMBER = 5; + /** + * + * + *
+   * The target page to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string target_page = 5 [(.google.api.resource_reference) = { ... } + * + * @return The targetPage. + */ + public java.lang.String getTargetPage() { + java.lang.Object ref = ""; + if (transitionCase_ == 5) { + ref = transition_; + } + 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 (transitionCase_ == 5) { + transition_ = s; + } + return s; + } + } + /** + * + * + *
+   * The target page to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string target_page = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetPage. + */ + public com.google.protobuf.ByteString getTargetPageBytes() { + java.lang.Object ref = ""; + if (transitionCase_ == 5) { + ref = transition_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (transitionCase_ == 5) { + transition_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_FLOW_FIELD_NUMBER = 6; + /** + * + * + *
+   * The target flow to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string target_flow = 6 [(.google.api.resource_reference) = { ... } + * + * @return The targetFlow. + */ + public java.lang.String getTargetFlow() { + java.lang.Object ref = ""; + if (transitionCase_ == 6) { + ref = transition_; + } + 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 (transitionCase_ == 6) { + transition_ = s; + } + return s; + } + } + /** + * + * + *
+   * The target flow to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string target_flow = 6 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetFlow. + */ + public com.google.protobuf.ByteString getTargetFlowBytes() { + java.lang.Object ref = ""; + if (transitionCase_ == 6) { + ref = transition_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (transitionCase_ == 6) { + transition_ = 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 (fulfillmentResponse_ != null) { + output.writeMessage(1, getFulfillmentResponse()); + } + if (pageInfo_ != null) { + output.writeMessage(2, getPageInfo()); + } + if (sessionInfo_ != null) { + output.writeMessage(3, getSessionInfo()); + } + if (payload_ != null) { + output.writeMessage(4, getPayload()); + } + if (transitionCase_ == 5) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, transition_); + } + if (transitionCase_ == 6) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, transition_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (fulfillmentResponse_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFulfillmentResponse()); + } + if (pageInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPageInfo()); + } + if (sessionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSessionInfo()); + } + if (payload_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getPayload()); + } + if (transitionCase_ == 5) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, transition_); + } + if (transitionCase_ == 6) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, transition_); + } + 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.dialogflow.cx.v3beta1.WebhookResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse other = + (com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse) obj; + + if (hasFulfillmentResponse() != other.hasFulfillmentResponse()) return false; + if (hasFulfillmentResponse()) { + if (!getFulfillmentResponse().equals(other.getFulfillmentResponse())) return false; + } + if (hasPageInfo() != other.hasPageInfo()) return false; + if (hasPageInfo()) { + if (!getPageInfo().equals(other.getPageInfo())) return false; + } + if (hasSessionInfo() != other.hasSessionInfo()) return false; + if (hasSessionInfo()) { + if (!getSessionInfo().equals(other.getSessionInfo())) return false; + } + if (hasPayload() != other.hasPayload()) return false; + if (hasPayload()) { + if (!getPayload().equals(other.getPayload())) return false; + } + if (!getTransitionCase().equals(other.getTransitionCase())) return false; + switch (transitionCase_) { + case 5: + if (!getTargetPage().equals(other.getTargetPage())) return false; + break; + case 6: + if (!getTargetFlow().equals(other.getTargetFlow())) 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 (hasFulfillmentResponse()) { + hash = (37 * hash) + FULFILLMENT_RESPONSE_FIELD_NUMBER; + hash = (53 * hash) + getFulfillmentResponse().hashCode(); + } + if (hasPageInfo()) { + hash = (37 * hash) + PAGE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getPageInfo().hashCode(); + } + if (hasSessionInfo()) { + hash = (37 * hash) + SESSION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getSessionInfo().hashCode(); + } + if (hasPayload()) { + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + } + switch (transitionCase_) { + case 5: + hash = (37 * hash) + TARGET_PAGE_FIELD_NUMBER; + hash = (53 * hash) + getTargetPage().hashCode(); + break; + case 6: + hash = (37 * hash) + TARGET_FLOW_FIELD_NUMBER; + hash = (53 * hash) + getTargetFlow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse 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.dialogflow.cx.v3beta1.WebhookResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse 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.dialogflow.cx.v3beta1.WebhookResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse 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.dialogflow.cx.v3beta1.WebhookResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse 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.dialogflow.cx.v3beta1.WebhookResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse 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.dialogflow.cx.v3beta1.WebhookResponse 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 response message for a webhook call.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.WebhookResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.WebhookResponse) + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.class, + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (fulfillmentResponseBuilder_ == null) { + fulfillmentResponse_ = null; + } else { + fulfillmentResponse_ = null; + fulfillmentResponseBuilder_ = null; + } + if (pageInfoBuilder_ == null) { + pageInfo_ = null; + } else { + pageInfo_ = null; + pageInfoBuilder_ = null; + } + if (sessionInfoBuilder_ == null) { + sessionInfo_ = null; + } else { + sessionInfo_ = null; + sessionInfoBuilder_ = null; + } + if (payloadBuilder_ == null) { + payload_ = null; + } else { + payload_ = null; + payloadBuilder_ = null; + } + transitionCase_ = 0; + transition_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse build() { + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse result = + new com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse(this); + if (fulfillmentResponseBuilder_ == null) { + result.fulfillmentResponse_ = fulfillmentResponse_; + } else { + result.fulfillmentResponse_ = fulfillmentResponseBuilder_.build(); + } + if (pageInfoBuilder_ == null) { + result.pageInfo_ = pageInfo_; + } else { + result.pageInfo_ = pageInfoBuilder_.build(); + } + if (sessionInfoBuilder_ == null) { + result.sessionInfo_ = sessionInfo_; + } else { + result.sessionInfo_ = sessionInfoBuilder_.build(); + } + if (payloadBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = payloadBuilder_.build(); + } + if (transitionCase_ == 5) { + result.transition_ = transition_; + } + if (transitionCase_ == 6) { + result.transition_ = transition_; + } + result.transitionCase_ = transitionCase_; + 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.dialogflow.cx.v3beta1.WebhookResponse) { + return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse other) { + if (other == com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.getDefaultInstance()) + return this; + if (other.hasFulfillmentResponse()) { + mergeFulfillmentResponse(other.getFulfillmentResponse()); + } + if (other.hasPageInfo()) { + mergePageInfo(other.getPageInfo()); + } + if (other.hasSessionInfo()) { + mergeSessionInfo(other.getSessionInfo()); + } + if (other.hasPayload()) { + mergePayload(other.getPayload()); + } + switch (other.getTransitionCase()) { + case TARGET_PAGE: + { + transitionCase_ = 5; + transition_ = other.transition_; + onChanged(); + break; + } + case TARGET_FLOW: + { + transitionCase_ = 6; + transition_ = other.transition_; + onChanged(); + break; + } + case TRANSITION_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.dialogflow.cx.v3beta1.WebhookResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int transitionCase_ = 0; + private java.lang.Object transition_; + + public TransitionCase getTransitionCase() { + return TransitionCase.forNumber(transitionCase_); + } + + public Builder clearTransition() { + transitionCase_ = 0; + transition_ = null; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + fulfillmentResponse_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse, + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponseOrBuilder> + fulfillmentResponseBuilder_; + /** + * + * + *
+     * The fulfillment response to send to the user. This field can be omitted by
+     * the webhook if it does not intend to send any response to the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + * + * @return Whether the fulfillmentResponse field is set. + */ + public boolean hasFulfillmentResponse() { + return fulfillmentResponseBuilder_ != null || fulfillmentResponse_ != null; + } + /** + * + * + *
+     * The fulfillment response to send to the user. This field can be omitted by
+     * the webhook if it does not intend to send any response to the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + * + * @return The fulfillmentResponse. + */ + public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + getFulfillmentResponse() { + if (fulfillmentResponseBuilder_ == null) { + return fulfillmentResponse_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + .getDefaultInstance() + : fulfillmentResponse_; + } else { + return fulfillmentResponseBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fulfillment response to send to the user. This field can be omitted by
+     * the webhook if it does not intend to send any response to the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + */ + public Builder setFulfillmentResponse( + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse value) { + if (fulfillmentResponseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fulfillmentResponse_ = value; + onChanged(); + } else { + fulfillmentResponseBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fulfillment response to send to the user. This field can be omitted by
+     * the webhook if it does not intend to send any response to the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + */ + public Builder setFulfillmentResponse( + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.Builder + builderForValue) { + if (fulfillmentResponseBuilder_ == null) { + fulfillmentResponse_ = builderForValue.build(); + onChanged(); + } else { + fulfillmentResponseBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fulfillment response to send to the user. This field can be omitted by
+     * the webhook if it does not intend to send any response to the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + */ + public Builder mergeFulfillmentResponse( + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse value) { + if (fulfillmentResponseBuilder_ == null) { + if (fulfillmentResponse_ != null) { + fulfillmentResponse_ = + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.newBuilder( + fulfillmentResponse_) + .mergeFrom(value) + .buildPartial(); + } else { + fulfillmentResponse_ = value; + } + onChanged(); + } else { + fulfillmentResponseBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fulfillment response to send to the user. This field can be omitted by
+     * the webhook if it does not intend to send any response to the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + */ + public Builder clearFulfillmentResponse() { + if (fulfillmentResponseBuilder_ == null) { + fulfillmentResponse_ = null; + onChanged(); + } else { + fulfillmentResponse_ = null; + fulfillmentResponseBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fulfillment response to send to the user. This field can be omitted by
+     * the webhook if it does not intend to send any response to the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.Builder + getFulfillmentResponseBuilder() { + + onChanged(); + return getFulfillmentResponseFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fulfillment response to send to the user. This field can be omitted by
+     * the webhook if it does not intend to send any response to the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponseOrBuilder + getFulfillmentResponseOrBuilder() { + if (fulfillmentResponseBuilder_ != null) { + return fulfillmentResponseBuilder_.getMessageOrBuilder(); + } else { + return fulfillmentResponse_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + .getDefaultInstance() + : fulfillmentResponse_; + } + } + /** + * + * + *
+     * The fulfillment response to send to the user. This field can be omitted by
+     * the webhook if it does not intend to send any response to the user.
+     * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse, + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponseOrBuilder> + getFulfillmentResponseFieldBuilder() { + if (fulfillmentResponseBuilder_ == null) { + fulfillmentResponseBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse, + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.Builder, + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse + .FulfillmentResponseOrBuilder>( + getFulfillmentResponse(), getParentForChildren(), isClean()); + fulfillmentResponse_ = null; + } + return fulfillmentResponseBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.PageInfo pageInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder> + pageInfoBuilder_; + /** + * + * + *
+     * Information about page status. This field can be omitted by the webhook if
+     * it does not intend to modify page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + * + * @return Whether the pageInfo field is set. + */ + public boolean hasPageInfo() { + return pageInfoBuilder_ != null || pageInfo_ != null; + } + /** + * + * + *
+     * Information about page status. This field can be omitted by the webhook if
+     * it does not intend to modify page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + * + * @return The pageInfo. + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo getPageInfo() { + if (pageInfoBuilder_ == null) { + return pageInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.getDefaultInstance() + : pageInfo_; + } else { + return pageInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Information about page status. This field can be omitted by the webhook if
+     * it does not intend to modify page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + */ + public Builder setPageInfo(com.google.cloud.dialogflow.cx.v3beta1.PageInfo value) { + if (pageInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pageInfo_ = value; + onChanged(); + } else { + pageInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Information about page status. This field can be omitted by the webhook if
+     * it does not intend to modify page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + */ + public Builder setPageInfo( + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder builderForValue) { + if (pageInfoBuilder_ == null) { + pageInfo_ = builderForValue.build(); + onChanged(); + } else { + pageInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Information about page status. This field can be omitted by the webhook if
+     * it does not intend to modify page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + */ + public Builder mergePageInfo(com.google.cloud.dialogflow.cx.v3beta1.PageInfo value) { + if (pageInfoBuilder_ == null) { + if (pageInfo_ != null) { + pageInfo_ = + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.newBuilder(pageInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + pageInfo_ = value; + } + onChanged(); + } else { + pageInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Information about page status. This field can be omitted by the webhook if
+     * it does not intend to modify page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + */ + public Builder clearPageInfo() { + if (pageInfoBuilder_ == null) { + pageInfo_ = null; + onChanged(); + } else { + pageInfo_ = null; + pageInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Information about page status. This field can be omitted by the webhook if
+     * it does not intend to modify page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder getPageInfoBuilder() { + + onChanged(); + return getPageInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Information about page status. This field can be omitted by the webhook if
+     * it does not intend to modify page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + */ + public com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder getPageInfoOrBuilder() { + if (pageInfoBuilder_ != null) { + return pageInfoBuilder_.getMessageOrBuilder(); + } else { + return pageInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.getDefaultInstance() + : pageInfo_; + } + } + /** + * + * + *
+     * Information about page status. This field can be omitted by the webhook if
+     * it does not intend to modify page status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder> + getPageInfoFieldBuilder() { + if (pageInfoBuilder_ == null) { + pageInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.PageInfo, + com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder>( + getPageInfo(), getParentForChildren(), isClean()); + pageInfo_ = null; + } + return pageInfoBuilder_; + } + + private com.google.cloud.dialogflow.cx.v3beta1.SessionInfo sessionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo, + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder> + sessionInfoBuilder_; + /** + * + * + *
+     * Information about session status. This field can be omitted by the webhook
+     * if it does not intend to modify session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + * + * @return Whether the sessionInfo field is set. + */ + public boolean hasSessionInfo() { + return sessionInfoBuilder_ != null || sessionInfo_ != null; + } + /** + * + * + *
+     * Information about session status. This field can be omitted by the webhook
+     * if it does not intend to modify session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + * + * @return The sessionInfo. + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionInfo getSessionInfo() { + if (sessionInfoBuilder_ == null) { + return sessionInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.getDefaultInstance() + : sessionInfo_; + } else { + return sessionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Information about session status. This field can be omitted by the webhook
+     * if it does not intend to modify session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + */ + public Builder setSessionInfo(com.google.cloud.dialogflow.cx.v3beta1.SessionInfo value) { + if (sessionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sessionInfo_ = value; + onChanged(); + } else { + sessionInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Information about session status. This field can be omitted by the webhook
+     * if it does not intend to modify session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + */ + public Builder setSessionInfo( + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder builderForValue) { + if (sessionInfoBuilder_ == null) { + sessionInfo_ = builderForValue.build(); + onChanged(); + } else { + sessionInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Information about session status. This field can be omitted by the webhook
+     * if it does not intend to modify session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + */ + public Builder mergeSessionInfo(com.google.cloud.dialogflow.cx.v3beta1.SessionInfo value) { + if (sessionInfoBuilder_ == null) { + if (sessionInfo_ != null) { + sessionInfo_ = + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.newBuilder(sessionInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + sessionInfo_ = value; + } + onChanged(); + } else { + sessionInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Information about session status. This field can be omitted by the webhook
+     * if it does not intend to modify session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + */ + public Builder clearSessionInfo() { + if (sessionInfoBuilder_ == null) { + sessionInfo_ = null; + onChanged(); + } else { + sessionInfo_ = null; + sessionInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Information about session status. This field can be omitted by the webhook
+     * if it does not intend to modify session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder getSessionInfoBuilder() { + + onChanged(); + return getSessionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Information about session status. This field can be omitted by the webhook
+     * if it does not intend to modify session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + */ + public com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder getSessionInfoOrBuilder() { + if (sessionInfoBuilder_ != null) { + return sessionInfoBuilder_.getMessageOrBuilder(); + } else { + return sessionInfo_ == null + ? com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.getDefaultInstance() + : sessionInfo_; + } + } + /** + * + * + *
+     * Information about session status. This field can be omitted by the webhook
+     * if it does not intend to modify session status.
+     * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo, + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder> + getSessionInfoFieldBuilder() { + if (sessionInfoBuilder_ == null) { + sessionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo, + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder, + com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder>( + getSessionInfo(), getParentForChildren(), isClean()); + sessionInfo_ = null; + } + return sessionInfoBuilder_; + } + + private com.google.protobuf.Struct payload_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + payloadBuilder_; + /** + * + * + *
+     * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+     * 
+ * + * .google.protobuf.Struct payload = 4; + * + * @return Whether the payload field is set. + */ + public boolean hasPayload() { + return payloadBuilder_ != null || payload_ != null; + } + /** + * + * + *
+     * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+     * 
+ * + * .google.protobuf.Struct payload = 4; + * + * @return The payload. + */ + public com.google.protobuf.Struct getPayload() { + if (payloadBuilder_ == null) { + return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; + } else { + return payloadBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+     * 
+ * + * .google.protobuf.Struct payload = 4; + */ + public Builder setPayload(com.google.protobuf.Struct value) { + if (payloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + payloadBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+     * 
+ * + * .google.protobuf.Struct payload = 4; + */ + public Builder setPayload(com.google.protobuf.Struct.Builder builderForValue) { + if (payloadBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + payloadBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+     * 
+ * + * .google.protobuf.Struct payload = 4; + */ + public Builder mergePayload(com.google.protobuf.Struct value) { + if (payloadBuilder_ == null) { + if (payload_ != null) { + payload_ = + com.google.protobuf.Struct.newBuilder(payload_).mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + payloadBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+     * 
+ * + * .google.protobuf.Struct payload = 4; + */ + public Builder clearPayload() { + if (payloadBuilder_ == null) { + payload_ = null; + onChanged(); + } else { + payload_ = null; + payloadBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+     * 
+ * + * .google.protobuf.Struct payload = 4; + */ + public com.google.protobuf.Struct.Builder getPayloadBuilder() { + + onChanged(); + return getPayloadFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+     * 
+ * + * .google.protobuf.Struct payload = 4; + */ + public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { + if (payloadBuilder_ != null) { + return payloadBuilder_.getMessageOrBuilder(); + } else { + return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; + } + } + /** + * + * + *
+     * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+     * 
+ * + * .google.protobuf.Struct payload = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getPayloadFieldBuilder() { + if (payloadBuilder_ == null) { + payloadBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getPayload(), getParentForChildren(), isClean()); + payload_ = null; + } + return payloadBuilder_; + } + + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 5 [(.google.api.resource_reference) = { ... } + * + * @return The targetPage. + */ + @java.lang.Override + public java.lang.String getTargetPage() { + java.lang.Object ref = ""; + if (transitionCase_ == 5) { + ref = transition_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (transitionCase_ == 5) { + transition_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetPage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetPageBytes() { + java.lang.Object ref = ""; + if (transitionCase_ == 5) { + ref = transition_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (transitionCase_ == 5) { + transition_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 5 [(.google.api.resource_reference) = { ... } + * + * @param value The targetPage to set. + * @return This builder for chaining. + */ + public Builder setTargetPage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + transitionCase_ = 5; + transition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 5 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearTargetPage() { + if (transitionCase_ == 5) { + transitionCase_ = 0; + transition_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The target page to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>/pages/<Page ID>`.
+     * 
+ * + * string target_page = 5 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for targetPage to set. + * @return This builder for chaining. + */ + public Builder setTargetPageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + transitionCase_ = 5; + transition_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 6 [(.google.api.resource_reference) = { ... } + * + * @return The targetFlow. + */ + @java.lang.Override + public java.lang.String getTargetFlow() { + java.lang.Object ref = ""; + if (transitionCase_ == 6) { + ref = transition_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (transitionCase_ == 6) { + transition_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 6 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetFlow. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetFlowBytes() { + java.lang.Object ref = ""; + if (transitionCase_ == 6) { + ref = transition_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (transitionCase_ == 6) { + transition_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 6 [(.google.api.resource_reference) = { ... } + * + * @param value The targetFlow to set. + * @return This builder for chaining. + */ + public Builder setTargetFlow(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + transitionCase_ = 6; + transition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 6 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearTargetFlow() { + if (transitionCase_ == 6) { + transitionCase_ = 0; + transition_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The target flow to transition to.
+     * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+     * ID>/flows/<Flow ID>`.
+     * 
+ * + * string target_flow = 6 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for targetFlow to set. + * @return This builder for chaining. + */ + public Builder setTargetFlowBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + transitionCase_ = 6; + transition_ = 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.dialogflow.cx.v3beta1.WebhookResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.WebhookResponse) + private static final com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WebhookResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WebhookResponse(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.dialogflow.cx.v3beta1.WebhookResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookResponseOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookResponseOrBuilder.java new file mode 100644 index 000000000..95adb567c --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookResponseOrBuilder.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/dialogflow/cx/v3beta1/webhook.proto + +package com.google.cloud.dialogflow.cx.v3beta1; + +public interface WebhookResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.WebhookResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The fulfillment response to send to the user. This field can be omitted by
+   * the webhook if it does not intend to send any response to the user.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + * + * @return Whether the fulfillmentResponse field is set. + */ + boolean hasFulfillmentResponse(); + /** + * + * + *
+   * The fulfillment response to send to the user. This field can be omitted by
+   * the webhook if it does not intend to send any response to the user.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + * + * @return The fulfillmentResponse. + */ + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse + getFulfillmentResponse(); + /** + * + * + *
+   * The fulfillment response to send to the user. This field can be omitted by
+   * the webhook if it does not intend to send any response to the user.
+   * 
+ * + * + * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponseOrBuilder + getFulfillmentResponseOrBuilder(); + + /** + * + * + *
+   * Information about page status. This field can be omitted by the webhook if
+   * it does not intend to modify page status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + * + * @return Whether the pageInfo field is set. + */ + boolean hasPageInfo(); + /** + * + * + *
+   * Information about page status. This field can be omitted by the webhook if
+   * it does not intend to modify page status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + * + * @return The pageInfo. + */ + com.google.cloud.dialogflow.cx.v3beta1.PageInfo getPageInfo(); + /** + * + * + *
+   * Information about page status. This field can be omitted by the webhook if
+   * it does not intend to modify page status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2; + */ + com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder getPageInfoOrBuilder(); + + /** + * + * + *
+   * Information about session status. This field can be omitted by the webhook
+   * if it does not intend to modify session status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + * + * @return Whether the sessionInfo field is set. + */ + boolean hasSessionInfo(); + /** + * + * + *
+   * Information about session status. This field can be omitted by the webhook
+   * if it does not intend to modify session status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + * + * @return The sessionInfo. + */ + com.google.cloud.dialogflow.cx.v3beta1.SessionInfo getSessionInfo(); + /** + * + * + *
+   * Information about session status. This field can be omitted by the webhook
+   * if it does not intend to modify session status.
+   * 
+ * + * .google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3; + */ + com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder getSessionInfoOrBuilder(); + + /** + * + * + *
+   * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+   * 
+ * + * .google.protobuf.Struct payload = 4; + * + * @return Whether the payload field is set. + */ + boolean hasPayload(); + /** + * + * + *
+   * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+   * 
+ * + * .google.protobuf.Struct payload = 4; + * + * @return The payload. + */ + com.google.protobuf.Struct getPayload(); + /** + * + * + *
+   * Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
+   * 
+ * + * .google.protobuf.Struct payload = 4; + */ + com.google.protobuf.StructOrBuilder getPayloadOrBuilder(); + + /** + * + * + *
+   * The target page to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string target_page = 5 [(.google.api.resource_reference) = { ... } + * + * @return The targetPage. + */ + java.lang.String getTargetPage(); + /** + * + * + *
+   * The target page to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>/pages/<Page ID>`.
+   * 
+ * + * string target_page = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetPage. + */ + com.google.protobuf.ByteString getTargetPageBytes(); + + /** + * + * + *
+   * The target flow to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string target_flow = 6 [(.google.api.resource_reference) = { ... } + * + * @return The targetFlow. + */ + java.lang.String getTargetFlow(); + /** + * + * + *
+   * The target flow to transition to.
+   * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
+   * ID>/flows/<Flow ID>`.
+   * 
+ * + * string target_flow = 6 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for targetFlow. + */ + com.google.protobuf.ByteString getTargetFlowBytes(); + + public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.TransitionCase getTransitionCase(); +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/agent.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/agent.proto new file mode 100644 index 000000000..e2510668e --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/agent.proto @@ -0,0 +1,318 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/flow.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "AgentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent]. +service Agents { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all agents in the specified location. + rpc ListAgents(ListAgentsRequest) returns (ListAgentsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*}/agents" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified agent. + rpc GetAgent(GetAgentRequest) returns (Agent) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an agent in the specified location. + rpc CreateAgent(CreateAgentRequest) returns (Agent) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*}/agents" + body: "agent" + }; + option (google.api.method_signature) = "parent,agent"; + } + + // Updates the specified agent. + rpc UpdateAgent(UpdateAgentRequest) returns (Agent) { + option (google.api.http) = { + patch: "/v3beta1/{agent.name=projects/*/locations/*/agents/*}" + body: "agent" + }; + option (google.api.method_signature) = "agent,update_mask"; + } + + // Deletes the specified agent. + rpc DeleteAgent(DeleteAgentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Exports the specified agent to a ZIP file. + rpc ExportAgent(ExportAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*}:export" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportAgentResponse" + metadata_type: "google.protobuf.Struct" + }; + } + + // Restores the specified agent from a ZIP file. + // + // Note that all existing intents, intent routes, entity types, pages and + // webhooks in the agent will be deleted. + rpc RestoreAgent(RestoreAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*}:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Struct" + }; + } +} + +// Settings related to speech recognition. +message SpeechToTextSettings { + // Whether to use speech adaptation for speech recognition. + bool enable_speech_adaptation = 1; +} + +// Agents are best described as Natural Language Understanding (NLU) modules +// that transform user requests into actionable data. You can include agents +// in your app, product, or service to determine user intent and respond to the +// user in a natural way. +// +// After you create an agent, you can add [Intents][google.cloud.dialogflow.cx.v3beta1.Intent], +// [Entity Types][google.cloud.dialogflow.cx.v3beta1.EntityType], [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment], +// [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], and so on to manage the conversation flows.. +message Agent { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Agent" + pattern: "projects/{project}/locations/{location}/agents/{agent}" + }; + + // The unique identifier of the agent. + // Required for the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method. [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent] + // populates the name automatically. + // Format: `projects//locations//agents/`. + string name = 1; + + // Required. The human-readable name of the agent, unique within the location. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Immutable. The default language of the agent as a language tag. + // See [Language + // Support](https://cloud.google.com/dialogflow/docs/reference/language) + // for a list of the currently supported language codes. + // This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method. + string default_language_code = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. The time zone of the agent from the [time zone + // database](https://www.iana.org/time-zones), e.g., America/New_York, + // Europe/Paris. + string time_zone = 5 [(google.api.field_behavior) = REQUIRED]; + + // The description of the agent. The maximum length is 500 characters. If + // exceeded, the request is rejected. + string description = 6; + + // The URI of the agent's avatar. Avatars are used throughout the Dialogflow + // console and in the self-hosted [Web + // Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) + // integration. + string avatar_uri = 7; + + // Speech recognition related settings. + SpeechToTextSettings speech_to_text_settings = 13; + + // Immutable. Name of the start flow in this agent. A start flow will be automatically + // created when the agent is created, and can only be deleted by deleting the + // agent. + // Format: `projects//locations//agents//flows/`. + string start_flow = 16 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + } + ]; + + // Indicates if stackdriver logging is enabled for the agent. + bool enable_stackdriver_logging = 18; + + // Indicates if automatic spell correction is enabled in detect intent + // requests. + bool enable_spell_correction = 20; +} + +// The request message for [Agents.ListAgents][google.cloud.dialogflow.cx.v3beta1.Agents.ListAgents]. +message ListAgentsRequest { + // Required. The location to list all agents for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Agent" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Agents.ListAgents][google.cloud.dialogflow.cx.v3beta1.Agents.ListAgents]. +message ListAgentsResponse { + // The list of agents. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Agent agents = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for [Agents.GetAgent][google.cloud.dialogflow.cx.v3beta1.Agents.GetAgent]. +message GetAgentRequest { + // Required. The name of the agent. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; +} + +// The request message for [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent]. +message CreateAgentRequest { + // Required. The location to create a agent for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Agent" + } + ]; + + // Required. The agent to create. + Agent agent = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent]. +message UpdateAgentRequest { + // Required. The agent to update. + Agent agent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for [Agents.DeleteAgent][google.cloud.dialogflow.cx.v3beta1.Agents.DeleteAgent]. +message DeleteAgentRequest { + // Required. The name of the agent to delete. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; +} + +// The request message for [Agents.ExportAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgent]. +message ExportAgentRequest { + // Required. The name of the agent to export. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; + + // Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to + // export the agent to. The format of this URI must be + // `gs:///`. + // If left unspecified, the serialized agent is returned inline. + string agent_uri = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for [Agents.ExportAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgent]. +message ExportAgentResponse { + // The exported agent. + oneof agent { + // The URI to a file containing the exported agent. This field is populated + // only if `agent_uri` is specified in [ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest]. + string agent_uri = 1; + + // Uncompressed raw byte content for agent. + bytes agent_content = 2; + } +} + +// The request message for [Agents.RestoreAgent][google.cloud.dialogflow.cx.v3beta1.Agents.RestoreAgent]. +message RestoreAgentRequest { + // Required. The name of the agent to restore into. + // Format: `projects//locations//agents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; + + // Required. The agent to restore. + oneof agent { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to restore agent from. The format of this URI must be + // `gs:///`. + string agent_uri = 2; + + // Uncompressed raw byte content for agent. + bytes agent_content = 3; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/audio_config.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/audio_config.proto new file mode 100644 index 000000000..c0043a529 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/audio_config.proto @@ -0,0 +1,305 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.dialogflow.cx.v3beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "AudioConfigProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Audio encoding of the audio content sent in the conversational query request. +// Refer to the +// [Cloud Speech API +// documentation](https://cloud.google.com/speech-to-text/docs/basics) for more +// details. +enum AudioEncoding { + // Not specified. + AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + AUDIO_ENCODING_LINEAR_16 = 1; + + // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio + // Codec) is the recommended encoding because it is lossless (therefore + // recognition is not compromised) and requires only about half the + // bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and + // 24-bit samples, however, not all fields in `STREAMINFO` are supported. + AUDIO_ENCODING_FLAC = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + AUDIO_ENCODING_MULAW = 3; + + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AUDIO_ENCODING_AMR = 4; + + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_AMR_WB = 5; + + // Opus encoded audio frames in Ogg container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). + // `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_OGG_OPUS = 6; + + // Although the use of lossy encodings is not recommended, if a very low + // bitrate encoding is required, `OGG_OPUS` is highly preferred over + // Speex encoding. The [Speex](https://speex.org/) encoding supported by + // Dialogflow API has a header byte in each block, as in MIME type + // `audio/x-speex-with-header-byte`. + // It is a variant of the RTP Speex encoding defined in + // [RFC 5574](https://tools.ietf.org/html/rfc5574). + // The stream is a sequence of blocks, one block per RTP packet. Each block + // starts with a byte containing the length of the block, in bytes, followed + // by one or more frames of Speex data, padded to an integral number of + // bytes (octets) as specified in RFC 5574. In other words, each RTP header + // is replaced with a single byte containing the block length. Only Speex + // wideband is supported. `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; +} + +// Information for a word recognized by the speech recognizer. +message SpeechWordInfo { + // The word this info is for. + string word = 3; + + // Time offset relative to the beginning of the audio that corresponds to the + // start of the spoken word. This is an experimental feature and the accuracy + // of the time offset can vary. + google.protobuf.Duration start_offset = 1; + + // Time offset relative to the beginning of the audio that corresponds to the + // end of the spoken word. This is an experimental feature and the accuracy of + // the time offset can vary. + google.protobuf.Duration end_offset = 2; + + // The Speech confidence between 0.0 and 1.0 for this word. A higher number + // indicates an estimated greater likelihood that the recognized word is + // correct. The default of 0.0 is a sentinel value indicating that confidence + // was not set. + // + // This field is not guaranteed to be fully stable over time for the same + // audio input. Users should also not rely on it to always be provided. + float confidence = 4; +} + +// Instructs the speech recognizer on how to process the audio content. +message InputAudioConfig { + // Required. Audio encoding of the audio content to process. + AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Sample rate (in Hertz) of the audio content sent in the query. + // Refer to + // [Cloud Speech API + // documentation](https://cloud.google.com/speech-to-text/docs/basics) for + // more details. + int32 sample_rate_hertz = 2; + + // Optional. If `true`, Dialogflow returns [SpeechWordInfo][google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo] in + // [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult] with information about the recognized speech + // words, e.g. start and end time offsets. If false or unspecified, Speech + // doesn't return any word-level information. + bool enable_word_info = 13; + + // Optional. A list of strings containing words and phrases that the speech + // recognizer should recognize with higher likelihood. + // + // See [the Cloud Speech + // documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + // for more details. + repeated string phrase_hints = 4; + + // Optional. Which Speech model to select for the given request. Select the + // model best suited to your domain to get best results. If a model is not + // explicitly specified, then we auto-select a model based on the parameters + // in the InputAudioConfig. + // If enhanced speech model is enabled for the agent and an enhanced + // version of the specified model for the language does not exist, then the + // speech is recognized using the standard version of the specified model. + // Refer to + // [Cloud Speech API + // documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + // for more details. + string model = 7; + + // Optional. Which variant of the [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use. + SpeechModelVariant model_variant = 10; + + // Optional. If `false` (default), recognition does not cease until the + // client closes the stream. + // If `true`, the recognizer will detect a single spoken utterance in input + // audio. Recognition ceases when it detects the audio's voice has + // stopped or paused. In this case, once a detected intent is received, the + // client should close the stream and start a new request with a new stream as + // needed. + // Note: This setting is relevant only for streaming methods. + bool single_utterance = 8; +} + +// Variant of the specified [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use. +// +// See the [Cloud Speech +// documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) +// for which models have different variants. For example, the "phone_call" model +// has both a standard and an enhanced variant. When you use an enhanced model, +// you will generally receive higher quality results than for a standard model. +enum SpeechModelVariant { + // No model variant specified. In this case Dialogflow defaults to + // USE_BEST_AVAILABLE. + SPEECH_MODEL_VARIANT_UNSPECIFIED = 0; + + // Use the best available variant of the [Speech + // model][InputAudioConfig.model] that the caller is eligible for. + // + // Please see the [Dialogflow + // docs](https://cloud.google.com/dialogflow/docs/data-logging) for + // how to make your project eligible for enhanced models. + USE_BEST_AVAILABLE = 1; + + // Use standard model variant even if an enhanced model is available. See the + // [Cloud Speech + // documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + // for details about enhanced models. + USE_STANDARD = 2; + + // Use an enhanced model variant: + // + // * If an enhanced variant does not exist for the given + // [model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] and request language, Dialogflow falls + // back to the standard variant. + // + // The [Cloud Speech + // documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + // describes which models have enhanced variants. + // + // * If the API caller isn't eligible for enhanced models, Dialogflow returns + // an error. Please see the [Dialogflow + // docs](https://cloud.google.com/dialogflow/docs/data-logging) + // for how to make your project eligible. + USE_ENHANCED = 3; +} + +// Description of which voice to use for speech synthesis. +message VoiceSelectionParams { + // Optional. The name of the voice. If not set, the service will choose a + // voice based on the other parameters such as language_code and + // [ssml_gender][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.ssml_gender]. + string name = 1; + + // Optional. The preferred gender of the voice. If not set, the service will + // choose a voice based on the other parameters such as language_code and + // [name][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a + // voice of the appropriate gender is not available, the synthesizer should + // substitute a voice with a different gender rather than failing the request. + SsmlVoiceGender ssml_gender = 2; +} + +// Configuration of how speech should be synthesized. +message SynthesizeSpeechConfig { + // Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + // native speed supported by the specific voice. 2.0 is twice as fast, and + // 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any + // other values < 0.25 or > 4.0 will return an error. + double speaking_rate = 1; + + // Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + // semitones from the original pitch. -20 means decrease 20 semitones from the + // original pitch. + double pitch = 2; + + // Optional. Volume gain (in dB) of the normal native volume supported by the + // specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + // 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + // will play at approximately half the amplitude of the normal native signal + // amplitude. A value of +6.0 (dB) will play at approximately twice the + // amplitude of the normal native signal amplitude. We strongly recommend not + // to exceed +10 (dB) as there's usually no effective increase in loudness for + // any value greater than that. + double volume_gain_db = 3; + + // Optional. An identifier which selects 'audio effects' profiles that are + // applied on (post synthesized) text to speech. Effects are applied on top of + // each other in the order they are given. + repeated string effects_profile_id = 5; + + // Optional. The desired voice of the synthesized audio. + VoiceSelectionParams voice = 4; +} + +// Gender of the voice as described in +// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). +enum SsmlVoiceGender { + // An unspecified gender, which means that the client doesn't care which + // gender the selected voice will have. + SSML_VOICE_GENDER_UNSPECIFIED = 0; + + // A male voice. + SSML_VOICE_GENDER_MALE = 1; + + // A female voice. + SSML_VOICE_GENDER_FEMALE = 2; + + // A gender-neutral voice. + SSML_VOICE_GENDER_NEUTRAL = 3; +} + +// Instructs the speech synthesizer how to generate the output audio content. +message OutputAudioConfig { + // Required. Audio encoding of the synthesized audio content. + OutputAudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The synthesis sample rate (in hertz) for this audio. If not + // provided, then the synthesizer will use the default sample rate based on + // the audio encoding. If this is different from the voice's natural sample + // rate, then the synthesizer will honor this request by converting to the + // desired sample rate (which might result in worse audio quality). + int32 sample_rate_hertz = 2; + + // Optional. Configuration of how speech should be synthesized. + SynthesizeSpeechConfig synthesize_speech_config = 3; +} + +// Audio encoding of the output audio format in Text-To-Speech. +enum OutputAudioEncoding { + // Not specified. + OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + // Audio content returned as LINEAR16 also contains a WAV header. + OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1; + + // MP3 audio at 32kbps. + OUTPUT_AUDIO_ENCODING_MP3 = 2; + + // MP3 audio at 64kbps. + OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4; + + // Opus encoded audio wrapped in an ogg container. The result will be a + // file which can be played natively on Android, and in browsers (at least + // Chrome and Firefox). The quality of the encoding is considerably higher + // than MP3 while using approximately the same bitrate. + OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + OUTPUT_AUDIO_ENCODING_MULAW = 5; +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/entity_type.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/entity_type.proto new file mode 100644 index 000000000..f12cd70f8 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/entity_type.proto @@ -0,0 +1,342 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "EntityTypeProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType]. +service EntityTypes { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all entity types in the specified agent. + rpc ListEntityTypes(ListEntityTypesRequest) returns (ListEntityTypesResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified entity type. + rpc GetEntityType(GetEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an entity type in the specified agent. + rpc CreateEntityType(CreateEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes" + body: "entity_type" + }; + option (google.api.method_signature) = "parent,entity_type"; + } + + // Updates the specified entity type. + rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + patch: "/v3beta1/{entity_type.name=projects/*/locations/*/agents/*/entityTypes/*}" + body: "entity_type" + }; + option (google.api.method_signature) = "entity_type,update_mask"; + } + + // Deletes the specified entity type. + rpc DeleteEntityType(DeleteEntityTypeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Entities are extracted from user input and represent parameters that are +// meaningful to your application. For example, a date range, a proper name +// such as a geographic location or landmark, and so on. Entities represent +// actionable data for your application. +// +// When you define an entity, you can also include synonyms that all map to +// that entity. For example, "soft drink", "soda", "pop", and so on. +// +// There are three types of entities: +// +// * **System** - entities that are defined by the Dialogflow API for common +// data types such as date, time, currency, and so on. A system entity is +// represented by the `EntityType` type. +// +// * **Custom** - entities that are defined by you that represent +// actionable data that is meaningful to your application. For example, +// you could define a `pizza.sauce` entity for red or white pizza sauce, +// a `pizza.cheese` entity for the different types of cheese on a pizza, +// a `pizza.topping` entity for different toppings, and so on. A custom +// entity is represented by the `EntityType` type. +// +// * **User** - entities that are built for an individual user such as +// favorites, preferences, playlists, and so on. A user entity is +// represented by the [SessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityType] type. +// +// For more information about entity types, see the [Dialogflow +// documentation](https://cloud.google.com/dialogflow/docs/entities-overview). +message EntityType { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/EntityType" + pattern: "projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}" + }; + + // An **entity entry** for an associated entity type. + // Next Id = 8 + message Entity { + // Required. The primary value associated with this entity entry. + // For example, if the entity type is *vegetable*, the value could be + // *scallions*. + // + // For `KIND_MAP` entity types: + // + // * A canonical value to be used in place of synonyms. + // + // For `KIND_LIST` entity types: + // + // * A string that can contain references to other entity types (with or + // without aliases). + string value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A collection of value synonyms. For example, if the entity type + // is *vegetable*, and `value` is *scallions*, a synonym could be *green + // onions*. + // + // For `KIND_LIST` entity types: + // + // * This collection must contain exactly one synonym equal to `value`. + repeated string synonyms = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // An excluded entity phrase that should not be matched. + message ExcludedPhrase { + // Required. The word or phrase to be excluded. + string value = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Represents kinds of entities. + enum Kind { + // Not specified. This value should be never used. + KIND_UNSPECIFIED = 0; + + // Map entity types allow mapping of a group of synonyms to a canonical + // value. + KIND_MAP = 1; + + // List entity types contain a set of entries that do not map to canonical + // values. However, list entity types can contain references to other entity + // types (with or without aliases). + KIND_LIST = 2; + + // Regexp entity types allow to specify regular expressions in entries + // values. + KIND_REGEXP = 3; + } + + // Represents different entity type expansion modes. Automated expansion + // allows an agent to recognize values that have not been explicitly listed in + // the entity (for example, new kinds of shopping list items). + enum AutoExpansionMode { + // Auto expansion disabled for the entity. + AUTO_EXPANSION_MODE_UNSPECIFIED = 0; + + // Allows an agent to recognize values that have not been explicitly + // listed in the entity. + AUTO_EXPANSION_MODE_DEFAULT = 1; + } + + // The unique identifier of the entity type. + // Required for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType]. + // Format: `projects//locations//agents//entityTypes/`. + string name = 1; + + // Required. The human-readable name of the entity type, unique within the agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates the kind of entity type. + Kind kind = 3 [(google.api.field_behavior) = REQUIRED]; + + // Indicates whether the entity type can be automatically expanded. + AutoExpansionMode auto_expansion_mode = 4; + + // The collection of entity entries associated with the entity type. + repeated Entity entities = 5; + + // Collection of exceptional words and phrases that shouldn't be matched. + // For example, if you have a size entity type with entry `giant`(an + // adjective), you might consider adding `giants`(a noun) as an exclusion. + // If the kind of entity type is `KIND_MAP`, then the phrases specified by + // entities and excluded phrases should be mutually exclusive. + repeated ExcludedPhrase excluded_phrases = 6; + + // Enables fuzzy entity extraction during classification. + bool enable_fuzzy_extraction = 7; +} + +// The request message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes]. +message ListEntityTypesRequest { + // Required. The agent to list all entity types for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // The language to list entity types for. The following fields are language + // dependent: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 3; + + // The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes]. +message ListEntityTypesResponse { + // The list of entity types. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated EntityType entity_types = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityType]. +message GetEntityTypeRequest { + // Required. The name of the entity type. + // Format: `projects//locations//agents//entityTypes/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // The language to retrieve the entity type for. The following fields are + // language dependent: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for [EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.CreateEntityType]. +message CreateEntityTypeRequest { + // Required. The agent to create a entity type for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Required. The entity type to create. + EntityType entity_type = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `entity_type`: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType]. +message UpdateEntityTypeRequest { + // Required. The entity type to update. + EntityType entity_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `entity_type`: + // + // * `EntityType.entities.value` + // * `EntityType.entities.synonyms` + // * `EntityType.excluded_phrases.value` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 3; +} + +// The request message for [EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.DeleteEntityType]. +message DeleteEntityTypeRequest { + // Required. The name of the entity type to delete. + // Format: `projects//locations//agents//entityTypes/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/environment.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/environment.proto new file mode 100644 index 000000000..a5c444c3d --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/environment.proto @@ -0,0 +1,262 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "EnvironmentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment]. +service Environments { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/environments" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. + rpc CreateEnvironment(CreateEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/environments" + body: "environment" + }; + option (google.api.method_signature) = "parent,environment"; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "google.protobuf.Struct" + }; + } + + // Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + rpc UpdateEnvironment(UpdateEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3beta1/{environment.name=projects/*/locations/*/agents/*/environments/*}" + body: "environment" + }; + option (google.api.method_signature) = "environment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "google.protobuf.Struct" + }; + } + + // Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + rpc LookupEnvironmentHistory(LookupEnvironmentHistoryRequest) returns (LookupEnvironmentHistoryResponse) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*}:lookupEnvironmentHistory" + }; + option (google.api.method_signature) = "name"; + } +} + +// Represents an environment for an agent. You can create multiple versions +// of your agent and publish them to separate environments. When you edit an +// agent, you are editing the draft agent. At any point, you can save the draft +// agent as an agent version, which is an immutable snapshot of your agent. When +// you save the draft agent, it is published to the default environment. When +// you create agent versions, you can publish them to custom environments. You +// can create a variety of custom environments for testing, development, +// production, etc. +message Environment { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Environment" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}" + }; + + // Configuration for the version. + message VersionConfig { + // Required. Format: projects//locations//agents//flows//versions/. + string version = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; + } + + // The name of the environment. + // Format: `projects//locations//agents//environments/`. + string name = 1; + + // Required. The human-readable name of the environment (unique in an agent). Limit of + // 64 characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The human-readable description of the environment. The maximum length is + // 500 characters. If exceeded, the request is rejected. + string description = 3; + + // Required. A list of configurations for flow versions. You should include version + // configs for all flows that are reachable from [`Start + // Flow`][Agent.start_flow] in the agent. Otherwise, an error will be + // returned. + repeated VersionConfig version_configs = 6 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Update time of this environment. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironments]. +message ListEnvironmentsRequest { + // Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all environments for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Environment" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironments]. +message ListEnvironmentsResponse { + // The list of environments. There will be a maximum number of items + // returned based on the page_size field in the request. The list may in some + // cases be empty or contain fewer entries than page_size even if this isn't + // the last page. + repeated Environment environments = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for [Environments.GetEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.GetEnvironment]. +message GetEnvironmentRequest { + // Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. + // Format: `projects//locations//agents//environments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; +} + +// The request message for [Environments.CreateEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.CreateEnvironment]. +message CreateEnvironmentRequest { + // Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Environment" + } + ]; + + // Required. The environment to create. + Environment environment = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Environments.UpdateEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.UpdateEnvironment]. +message UpdateEnvironmentRequest { + // Required. The environment to update. + Environment environment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Environments.DeleteEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.DeleteEnvironment]. +message DeleteEnvironmentRequest { + // Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete. + // Format: `projects//locations//agents//environments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; +} + +// The request message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistory]. +message LookupEnvironmentHistoryRequest { + // Required. Resource name of the environment to look up the history for. + // Format: `projects//locations//agents//environments/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistory]. +message LookupEnvironmentHistoryResponse { + // Represents a list of snapshots for an environment. Time of the snapshots is + // stored in [`update_time`][google.cloud.dialogflow.cx.v3beta1.Environment.update_time]. + repeated Environment environments = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/flow.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/flow.proto new file mode 100644 index 000000000..6541a9d94 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/flow.proto @@ -0,0 +1,367 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/page.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "FlowProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow]. +service Flows { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Creates a flow in the specified agent. + rpc CreateFlow(CreateFlowRequest) returns (Flow) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/flows" + body: "flow" + }; + option (google.api.method_signature) = "parent,flow"; + } + + // Deletes a specified flow. + rpc DeleteFlow(DeleteFlowRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns the list of all flows in the specified agent. + rpc ListFlows(ListFlowsRequest) returns (ListFlowsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/flows" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified flow. + rpc GetFlow(GetFlowRequest) returns (Flow) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the specified flow. + rpc UpdateFlow(UpdateFlowRequest) returns (Flow) { + option (google.api.http) = { + patch: "/v3beta1/{flow.name=projects/*/locations/*/agents/*/flows/*}" + body: "flow" + }; + option (google.api.method_signature) = "flow,update_mask"; + } + + // Trains the specified flow. Note that only the flow in 'draft' environment + // is trained. + rpc TrainFlow(TrainFlowRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}:train" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Struct" + }; + } +} + +// Settings related to NLU. +message NluSettings { + // NLU model type. + enum ModelType { + // Not specified. `MODEL_TYPE_STANDARD` will be used. + MODEL_TYPE_UNSPECIFIED = 0; + + // Use standard NLU model. + MODEL_TYPE_STANDARD = 1; + + // Use custom NLU model. + MODEL_TYPE_CUSTOM = 2; + + // Use advanced NLU model. + MODEL_TYPE_ADVANCED = 3; + } + + // NLU model training mode. + enum ModelTrainingMode { + // Not specified. `MODEL_TRAINING_MODE_AUTOMATIC` will be used. + MODEL_TRAINING_MODE_UNSPECIFIED = 0; + + // NLU model training is automatically triggered when a flow gets modified. + // User can also manually trigger model training in this mode. + MODEL_TRAINING_MODE_AUTOMATIC = 1; + + // User needs to manually trigger NLU model training. Best for large flows + // whose models take long time to train. + MODEL_TRAINING_MODE_MANUAL = 2; + } + + // Indicates the type of NLU model. + ModelType model_type = 1; + + // To filter out false positive results and still get variety in matched + // natural language inputs for your agent, you can tune the machine learning + // classification threshold. If the returned score value is less than the + // threshold value, then a no-match event will be triggered. The score values + // range from 0.0 (completely uncertain) to 1.0 (completely certain). If set + // to 0.0, the default of 0.3 is used. + float classification_threshold = 3; + + // Indicates NLU model training mode. + ModelTrainingMode model_training_mode = 4; + + // Indicates if automatic spell correction is enabled in detect intent + // requests. + bool enable_spell_correction = 5 [deprecated = true]; +} + +// Flows represents the conversation flows when you build your chatbot agent. +// +// A flow consists of many pages connected by the transition routes. +// Conversations always start with the built-in Start Flow (with an all-0 ID). +// Transition routes can direct the conversation session from the current flow +// (parent flow) to another flow (sub flow). When the sub flow is finished, +// Dialogflow will bring the session back to the parent flow, where the sub flow +// is started. +// +// Usually, when a transition route is followed by a matched intent, the intent +// will be "consumed". This means the intent won't activate more transition +// routes. However, when the followed transition route moves the conversation +// session into a different flow, the matched intent can be carried over and to +// be consumed in the target flow. +message Flow { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Flow" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}" + }; + + // The unique identifier of the flow. + // Format: `projects//locations//agents//flows/`. + string name = 1; + + // Required. The human-readable name of the flow. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the flow. The maximum length is 500 characters. If + // exceeded, the request is rejected. + string description = 3; + + // A flow's transition routes serve two purposes: + // + // * They are responsible for matching the user's first utterances in the + // flow. + // * They are inherited by every page's [transition + // routes][Page.transition_routes] and can support use cases such as the user + // saying "help" or "can I talk to a human?", which can be handled in a common + // way regardless of the current page. Transition routes defined in the page + // have higher priority than those defined in the flow. + // + // TransitionRoutes are evalauted in the following order: + // + // * TransitionRoutes with intent specified.. + // * TransitionRoutes with only condition specified. + // + // TransitionRoutes with intent specified are inherited by pages in the flow. + repeated TransitionRoute transition_routes = 4; + + // A flow's event handlers serve two purposes: + // + // * They are responsible for handling events (e.g. no match, + // webhook errors) in the flow. + // * They are inherited by every page's [event + // handlers][Page.event_handlers], which can be used to handle common events + // regardless of the current page. Event handlers defined in the page + // have higher priority than those defined in the flow. + // + // Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are + // evaluated on a first-match basis. The first one that matches the event + // get executed, with the rest being ignored. + repeated EventHandler event_handlers = 10; + + // NLU related settings of the flow. + NluSettings nlu_settings = 11; +} + +// The request message for [Flows.CreateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.CreateFlow]. +message CreateFlowRequest { + // Required. The agent to create a flow for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Flow" + } + ]; + + // Required. The flow to create. + Flow flow = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `flow`: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for [Flows.DeleteFlow][google.cloud.dialogflow.cx.v3beta1.Flows.DeleteFlow]. +message DeleteFlowRequest { + // Required. The name of the flow to delete. + // Format: `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + } + ]; + + // This field has no effect for flows with no incoming transitions. + // For flows with incoming transitions: + // + // * If `force` is set to false, an error will be returned with message + // indicating the incoming transitions. + // * If `force` is set to true, Dialogflow will remove the flow, as well as + // any transitions to the flow. + bool force = 2; +} + +// The request message for [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows]. +message ListFlowsRequest { + // Required. The agent containing the flows. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Flow" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; + + // The language to list flows for. The following fields are language + // dependent: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 4; +} + +// The response message for [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows]. +message ListFlowsResponse { + // The list of flows. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Flow flows = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The response message for [Flows.GetFlow][google.cloud.dialogflow.cx.v3beta1.Flows.GetFlow]. +message GetFlowRequest { + // Required. The name of the flow to get. + // Format: `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + } + ]; + + // The language to retrieve the flow for. The following fields are language + // dependent: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for [Flows.UpdateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.UpdateFlow]. +message UpdateFlowRequest { + // Required. The flow to update. + Flow flow = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. If `update_mask` is not + // specified, an error will be returned. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `flow`: + // + // * `Flow.event_handlers.trigger_fulfillment.messages` + // * `Flow.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for [Flows.TrainFlow][google.cloud.dialogflow.cx.v3beta1.Flows.TrainFlow]. +message TrainFlowRequest { + // Required. The flow to train. + // Format: `projects//locations//agents//flows/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } + ]; +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto new file mode 100644 index 000000000..7a8e5af3c --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/fulfillment.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.dialogflow.cx.v3beta1; + +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/response_message.proto"; +import "google/protobuf/struct.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "FulfillmentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// A fulfillment can do one or more of the following actions at the same time: +// +// * Generate rich message responses. +// * Set parameter values. +// * Call the webhook. +// +// Fulfillments can be called at various stages in the [Page][google.cloud.dialogflow.cx.v3beta1.Page] or +// [Form][google.cloud.dialogflow.cx.v3beta1.Form] lifecycle. For example, when a [DetectIntentRequest][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest] drives a +// session to enter a new page, the page's entry fulfillment can add a static +// response to the [QueryResult][google.cloud.dialogflow.cx.v3beta1.QueryResult] in the returning [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse], +// call the webhook (for example, to load user data from a database), or both. +message Fulfillment { + // Setting a parameter value. + message SetParameterAction { + // Display name of the parameter. + string parameter = 1; + + // The new value of the parameter. A null value clears the parameter. + google.protobuf.Value value = 2; + } + + // A list of cascading if-else conditions. Cases are mutually exclusive. + // The first one with a matching condition is selected, all the rest ignored. + message ConditionalCases { + // Each case has a Boolean condition. When it is evaluated to be True, the + // corresponding messages will be selected and evaluated recursively. + message Case { + // The list of messages or conditional cases to activate for this case. + message CaseContent { + // Either a message is returned or additional cases to be evaluated. + oneof cases_or_message { + // Returned message. + ResponseMessage message = 1; + + // Additional cases to be evaluated. + ConditionalCases additional_cases = 2; + } + } + + // The condition to activate and select this case. Empty means the + // condition is always true. The condition is evaluated against [form + // parameters][Form.parameters] or [session + // parameters][SessionInfo.parameters]. + // + // See the [conditions + // reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + string condition = 1; + + // A list of case content. + repeated CaseContent case_content = 2; + } + + // A list of cascading if-else conditions. + repeated Case cases = 1; + } + + // The list of rich message responses to present to the user. + repeated ResponseMessage messages = 1; + + // The webhook to call. + // Format: `projects//locations//agents//webhooks/`. + string webhook = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Webhook" + }]; + + // The tag used by the webhook to identify which fulfillment is being called. + // This field is required if `webhook` is specified. + string tag = 3; + + // Set parameter values before executing the webhook. + repeated SetParameterAction set_parameter_actions = 4; + + // Conditional cases for this fulfillment. + repeated ConditionalCases conditional_cases = 5; +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/gcs.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/gcs.proto new file mode 100644 index 000000000..c2bb45178 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/gcs.proto @@ -0,0 +1,28 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.dialogflow.cx.v3beta1; + +import "google/api/field_behavior.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "GcsProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/intent.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/intent.proto new file mode 100644 index 000000000..d93e94489 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/intent.proto @@ -0,0 +1,337 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "IntentProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent]. +service Intents { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all intents in the specified agent. + rpc ListIntents(ListIntentsRequest) returns (ListIntentsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified intent. + rpc GetIntent(GetIntentRequest) returns (Intent) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/intents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an intent in the specified agent. + rpc CreateIntent(CreateIntentRequest) returns (Intent) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/intents" + body: "intent" + }; + option (google.api.method_signature) = "parent,intent"; + } + + // Updates the specified intent. + rpc UpdateIntent(UpdateIntentRequest) returns (Intent) { + option (google.api.http) = { + patch: "/v3beta1/{intent.name=projects/*/locations/*/agents/*/intents/*}" + body: "intent" + }; + option (google.api.method_signature) = "intent,update_mask"; + } + + // Deletes the specified intent. + rpc DeleteIntent(DeleteIntentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/intents/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// An intent represents a user's intent to interact with a conversational agent. +// +// You can provide information for the Dialogflow API to use to match user input +// to an intent by adding training phrases (i.e., examples of user input) to +// your intent. +message Intent { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Intent" + pattern: "projects/{project}/locations/{location}/agents/{agent}/intents/{intent}" + }; + + // Represents an example that the agent is trained on to identify the intent. + message TrainingPhrase { + // Represents a part of a training phrase. + message Part { + // Required. The text for this part. + string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // The [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] used to annotate this part of the + // training phrase. This field is required for annotated parts of the + // training phrase. + string parameter_id = 2; + } + + // Output only. The unique identifier of the training phrase. + string id = 1; + + // Required. The ordered list of training phrase parts. + // The parts are concatenated in order to form the training phrase. + // + // Note: The API does not automatically annotate training phrases like the + // Dialogflow Console does. + // + // Note: Do not forget to include whitespace at part boundaries, so the + // training phrase is well formatted when the parts are concatenated. + // + // If the training phrase does not need to be annotated with parameters, + // you just need a single part with only the [Part.text][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part.text] field set. + // + // If you want to annotate the training phrase, you must create multiple + // parts, where the fields of each part are populated in one of two ways: + // + // - `Part.text` is set to a part of the phrase that has no parameters. + // - `Part.text` is set to a part of the phrase that you want to annotate, + // and the `parameter_id` field is set. + repeated Part parts = 2 [(google.api.field_behavior) = REQUIRED]; + + // Indicates how many times this example was added to the intent. + int32 repeat_count = 3; + } + + // Represents an intent parameter. + message Parameter { + // Required. The unique identifier of the parameter. This field + // is used by [training phrases][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase] to annotate their + // [parts][google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part]. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The entity type of the parameter. + // Format: `projects/-/locations/-/agents/-/entityTypes/` for system entity types (for example, + // `projects/-/locations/-/agents/-/entityTypes/sys.date`), or + // `projects//locations//agents//entityTypes/` for developer entity types. + string entity_type = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Indicates whether the parameter represents a list of values. + bool is_list = 3; + } + + // The unique identifier of the intent. + // Required for the [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent] method. [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent] + // populates the name automatically. + // Format: `projects//locations//agents//intents/`. + string name = 1; + + // Required. The human-readable name of the intent, unique within the agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The collection of training phrases the agent is trained on to identify the + // intent. + repeated TrainingPhrase training_phrases = 3; + + // The collection of parameters associated with the intent. + repeated Parameter parameters = 4; + + // The priority of this intent. Higher numbers represent higher + // priorities. + // + // - If the supplied value is unspecified or 0, the service + // translates the value to 500,000, which corresponds to the + // `Normal` priority in the console. + // - If the supplied value is negative, the intent is ignored + // in runtime detect intent requests. + int32 priority = 5; + + // Indicates whether this is a fallback intent. Currently only default + // fallback intent is allowed in the agent, which is added upon agent + // creation. + // Adding training phrases to fallback intent is useful in the case of + // requests that are mistakenly matched, since training phrases assigned to + // fallback intents act as negative examples that triggers no-match event. + bool is_fallback = 6; +} + +// The request message for [Intents.ListIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ListIntents]. +message ListIntentsRequest { + // Required. The agent to list all intents for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Intent" + } + ]; + + // The language to list intents for. The following fields are language + // dependent: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The resource view to apply to the returned intent. + IntentView intent_view = 5; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 3; + + // The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for [Intents.ListIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ListIntents]. +message ListIntentsResponse { + // The list of intents. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Intent intents = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for [Intents.GetIntent][google.cloud.dialogflow.cx.v3beta1.Intents.GetIntent]. +message GetIntentRequest { + // Required. The name of the intent. + // Format: `projects//locations//agents//intents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + } + ]; + + // The language to retrieve the intent for. The following fields are language + // dependent: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent]. +message CreateIntentRequest { + // Required. The agent to create an intent for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Intent" + } + ]; + + // Required. The intent to create. + Intent intent = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `intent`: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent]. +message UpdateIntentRequest { + // Required. The intent to update. + Intent intent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `intent`: + // + // * `Intent.training_phrases.parts.text` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 3; +} + +// The request message for [Intents.DeleteIntent][google.cloud.dialogflow.cx.v3beta1.Intents.DeleteIntent]. +message DeleteIntentRequest { + // Required. The name of the intent to delete. + // Format: `projects//locations//agents//intents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + } + ]; +} + +// Represents the options for views of an intent. +// An intent can be a sizable object. Therefore, we provide a resource view that +// does not return training phrases in the response. +enum IntentView { + // Not specified. Treated as INTENT_VIEW_FULL. + INTENT_VIEW_UNSPECIFIED = 0; + + // Training phrases field is not populated in the response. + INTENT_VIEW_PARTIAL = 1; + + // All fields are populated. + INTENT_VIEW_FULL = 2; +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/ivr.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/ivr.proto new file mode 100644 index 000000000..86a97737b --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/ivr.proto @@ -0,0 +1,28 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.dialogflow.cx.v3beta1; + +import "google/protobuf/duration.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "InteractiveVoiceResponseProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/page.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/page.proto new file mode 100644 index 000000000..c63b16178 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/page.proto @@ -0,0 +1,506 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/fulfillment.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "PageProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page]. +service Pages { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all pages in the specified flow. + rpc ListPages(ListPagesRequest) returns (ListPagesResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/pages" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified page. + rpc GetPage(GetPageRequest) returns (Page) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/pages/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a page in the specified flow. + rpc CreatePage(CreatePageRequest) returns (Page) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/pages" + body: "page" + }; + option (google.api.method_signature) = "parent,page"; + } + + // Updates the specified page. + rpc UpdatePage(UpdatePageRequest) returns (Page) { + option (google.api.http) = { + patch: "/v3beta1/{page.name=projects/*/locations/*/agents/*/flows/*/pages/*}" + body: "page" + }; + option (google.api.method_signature) = "page,update_mask"; + } + + // Deletes the specified page. + rpc DeletePage(DeletePageRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/pages/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// A Dialogflow CX conversation (session) can be described and visualized as a +// state machine. The states of a CX session are represented by pages. +// +// For each flow, you define many pages, where your combined pages can handle a +// complete conversation on the topics the flow is designed for. At any given +// moment, exactly one page is the current page, the current page is considered +// active, and the flow associated with that page is considered active. Every +// flow has a special start page. When a flow initially becomes active, the +// start page page becomes the current page. For each conversational turn, the +// current page will either stay the same or transition to another page. +// +// You configure each page to collect information from the end-user that is +// relevant for the conversational state represented by the page. +// +// For more information, see the +// [Page guide](https://cloud.google.com/dialogflow/cx/docs/concept/page). +message Page { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Page" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}" + }; + + // The unique identifier of the page. + // Required for the [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage] method. [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage] + // populates the name automatically. + // Format: `projects//locations//agents//flows//pages/`. + string name = 1; + + // Required. The human-readable name of the page, unique within the agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The fulfillment to call when the session is entering the page. + Fulfillment entry_fulfillment = 7; + + // The form associated with the page, used for collecting parameters + // relevant to the page. + Form form = 4; + + // Ordered list of [`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated + // with the page. Transition route groups must be unique within a page. + // + // * If multiple transition routes within a page scope refer to the same + // intent, then the precedence order is: page's transition route -> page's + // transition route group -> flow's transition routes. + // + // * If multiple transition route groups within a page contain the same + // intent, then the first group in the ordered list takes precedence. + // + // Format:`projects//locations//agents//flows//transitionRouteGroups/`. + repeated string transition_route_groups = 11 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + }]; + + // A list of transitions for the transition rules of this page. + // They route the conversation to another page in the same flow, or another + // flow. + // + // When we are in a certain page, the TransitionRoutes are evalauted in the + // following order: + // + // * TransitionRoutes defined in the page with intent specified. + // * TransitionRoutes defined in the + // [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups]. + // * TransitionRoutes defined in flow with intent specified. + // * TransitionRoutes defined in the page with only condition specified. + repeated TransitionRoute transition_routes = 9; + + // Handlers associated with the page to handle events such as webhook errors, + // no match or no input. + repeated EventHandler event_handlers = 10; +} + +// A form is a data model that groups related parameters that can be collected +// from the user. The process in which the agent prompts the user and collects +// parameter values from the user is called form filling. A form can be added to +// a [page][google.cloud.dialogflow.cx.v3beta1.Page]. When form filling is done, the filled parameters will be +// written to the [session][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters]. +message Form { + // Represents a form parameter. + message Parameter { + // Configuration for how the filling of a parameter should be handled. + message FillBehavior { + // Required. The fulfillment to provide the initial prompt that the agent + // can present to the user in order to fill the parameter. + Fulfillment initial_prompt_fulfillment = 3 [(google.api.field_behavior) = REQUIRED]; + + // The handlers for parameter-level events, used to provide reprompt for + // the parameter or transition to a different page/flow. The supported + // events are: + // * `sys.no-match-`, where N can be from 1 to 6 + // * `sys.no-match-default` + // * `sys.no-input-`, where N can be from 1 to 6 + // * `sys.no-input-default` + // * `sys.invalid-parameter` + // + // `initial_prompt_fulfillment` provides the first prompt for the + // parameter. + // + // If the user's response does not fill the parameter, a + // no-match/no-input event will be triggered, and the fulfillment + // associated with the `sys.no-match-1`/`sys.no-input-1` handler (if + // defined) will be called to provide a prompt. The + // `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to + // the next no-match/no-input event, and so on. + // + // A `sys.no-match-default` or `sys.no-input-default` handler will be used + // to handle all following no-match/no-input events after all numbered + // no-match/no-input handlers for the parameter are consumed. + // + // A `sys.invalid-parameter` handler can be defined to handle the case + // where the parameter values have been `invalidated` by webhook. For + // example, if the user's response fill the parameter, however the + // parameter was invalidated by webhook, the fulfillment associated with + // the `sys.invalid-parameter` handler (if defined) will be called to + // provide a prompt. + // + // If the event handler for the corresponding event can't be found on the + // parameter, `initial_prompt_fulfillment` will be re-prompted. + repeated EventHandler reprompt_event_handlers = 5; + } + + // Required. The human-readable name of the parameter, unique within the + // form. + string display_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates whether the parameter is required. Optional parameters will not + // trigger prompts; however, they are filled if the user specifies them. + // Required parameters must be filled before form filling concludes. + bool required = 2; + + // Required. The entity type of the parameter. + // Format: `projects/-/locations/-/agents/-/entityTypes/` for system entity types (for example, + // `projects/-/locations/-/agents/-/entityTypes/sys.date`), or + // `projects//locations//agents//entityTypes/` for developer entity types. + string entity_type = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/EntityType" + } + ]; + + // Indicates whether the parameter represents a list of values. + bool is_list = 4; + + // Required. Defines fill behavior for the parameter. + FillBehavior fill_behavior = 7 [(google.api.field_behavior) = REQUIRED]; + + // The default value of an optional parameter. If the parameter is required, + // the default value will be ignored. + google.protobuf.Value default_value = 9; + } + + // Parameters to collect from the user. + repeated Parameter parameters = 1; +} + +// An event handler specifies an [event][google.cloud.dialogflow.cx.v3beta1.EventHandler.event] that can be handled +// during a session. When the specified event happens, the following actions are +// taken in order: +// +// * If there is a +// [`trigger_fulfillment`][google.cloud.dialogflow.cx.v3beta1.EventHandler.trigger_fulfillment] associated with +// the event, it will be called. +// * If there is a [`target_page`][google.cloud.dialogflow.cx.v3beta1.EventHandler.target_page] associated +// with the event, the session will transition into the specified page. +// * If there is a [`target_flow`][google.cloud.dialogflow.cx.v3beta1.EventHandler.target_flow] associated +// with the event, the session will transition into the specified flow. +message EventHandler { + // Output only. The unique identifier of this event handler. + string name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The name of the event to handle. + string event = 4 [(google.api.field_behavior) = REQUIRED]; + + // The fulfillment to call when the event occurs. + // Handling webhook errors with a fulfillment enabled with webhook could + // cause infinite loop. It is invalid to specify such fulfillment for a + // handler handling webhooks. + Fulfillment trigger_fulfillment = 5; + + // The target to transition to, either a page in the same host flow (the flow + // that owns this [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute]), or another flow in the same agent. + oneof target { + // The target page to transition to. + // Format: `projects//locations//agents//flows//pages/`. + string target_page = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // The target flow to transition to. + // Format: `projects//locations//agents//flows/`. + string target_flow = 3 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + } +} + +// A transition route specifies a [intent][google.cloud.dialogflow.cx.v3beta1.Intent] that can be matched and/or a +// data condition that can be evaluated during a session. When a specified +// transition is matched, the following actions are taken in order: +// +// * If there is a +// [`trigger_fulfillment`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.trigger_fulfillment] associated with +// the transition, it will be called. +// * If there is a [`target_page`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.target_page] associated +// with the transition, the session will transition into the specified page. +// * If there is a [`target_flow`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.target_flow] associated +// with the transition, the session will transition into the specified flow. +message TransitionRoute { + // Output only. The unique identifier of this transition route. + string name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The unique identifier of an [Intent][google.cloud.dialogflow.cx.v3beta1.Intent]. + // Format: `projects//locations//agents//intents/`. + // Indicates that the transition can only happen when the given intent is + // matched. + // At least one of `intent` or `condition` must be specified. When both + // `intent` and `condition` are specified, the transition can only happen + // when both are fulfilled. + string intent = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // The condition to evaluate against [form parameters][google.cloud.dialogflow.cx.v3beta1.Form.parameters] or + // [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters]. + // + // See the [conditions + // reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). + // At least one of `intent` or `condition` must be specified. When both + // `intent` and `condition` are specified, the transition can only happen + // when both are fulfilled. + string condition = 2; + + // The fulfillment to call when the condition is satisfied. At least one of + // `trigger_fulfillment` and `target` must be specified. When both are + // defined, `trigger_fulfillment` is executed first. + Fulfillment trigger_fulfillment = 3; + + // The target to transition to, either a page in the same host flow (the flow + // that owns this [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute]), or another flow in the same agent. + oneof target { + // The target page to transition to. + // Format: `projects//locations//agents//flows//pages/`. + string target_page = 4 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // The target flow to transition to. + // Format: `projects//locations//agents//flows/`. + string target_flow = 5 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + } +} + +// The request message for [Pages.ListPages][google.cloud.dialogflow.cx.v3beta1.Pages.ListPages]. +message ListPagesRequest { + // Required. The flow to list all pages for. + // Format: `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Page" + } + ]; + + // The language to list pages for. The following fields are language + // dependent: + // + // * `Page.entry_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * `Page.transition_route.trigger_fulfillment.messages` + // * + // `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 3; + + // The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for [Pages.ListPages][google.cloud.dialogflow.cx.v3beta1.Pages.ListPages]. +message ListPagesResponse { + // The list of pages. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Page pages = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for [Pages.GetPage][google.cloud.dialogflow.cx.v3beta1.Pages.GetPage]. +message GetPageRequest { + // Required. The name of the page. + // Format: `projects//locations//agents//flows//pages/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + } + ]; + + // The language to retrieve the page for. The following fields are language + // dependent: + // + // * `Page.entry_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * `Page.transition_route.trigger_fulfillment.messages` + // * + // `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage]. +message CreatePageRequest { + // Required. The flow to create a page for. + // Format: `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Page" + } + ]; + + // Required. The page to create. + Page page = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `page`: + // + // * `Page.entry_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * `Page.transition_route.trigger_fulfillment.messages` + // * + // `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage]. +message UpdatePageRequest { + // Required. The page to update. + Page page = 1 [(google.api.field_behavior) = REQUIRED]; + + // The language of the following fields in `page`: + // + // * `Page.entry_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` + // * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` + // * `Page.transition_route.trigger_fulfillment.messages` + // * + // `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages` + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 3; +} + +// The request message for [Pages.DeletePage][google.cloud.dialogflow.cx.v3beta1.Pages.DeletePage]. +message DeletePageRequest { + // Required. The name of the page to delete. + // Format: `projects//locations//agents//Flows//pages/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + } + ]; + + // This field has no effect for pages with no incoming transitions. + // For pages with incoming transitions: + // + // * If `force` is set to false, an error will be returned with message + // indicating the incoming transitions. + // * If `force` is set to true, Dialogflow will remove the page, as well as + // any transitions to the page. + bool force = 2; +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/response_message.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/response_message.proto new file mode 100644 index 000000000..2822d612e --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/response_message.proto @@ -0,0 +1,223 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.dialogflow.cx.v3beta1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "ResponseMessageProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Represents a response message that can be returned by a conversational agent. +// +// Response messages are also used for output audio synthesis. The approach is +// as follows: +// +// * If at least one OutputAudioText response is present, then all +// OutputAudioText responses are linearly concatenated, and the result is used +// for output audio synthesis. +// * If the OutputAudioText responses are a mixture of text and SSML, then the +// concatenated result is treated as SSML; otherwise, the result is treated as +// either text or SSML as appropriate. The agent designer should ideally use +// either text or SSML consistently throughout the bot design. +// * Otherwise, all Text responses are linearly concatenated, and the result is +// used for output audio synthesis. +// +// This approach allows for more sophisticated user experience scenarios, where +// the text displayed to the user may differ from what is heard. +message ResponseMessage { + // The text response message. + message Text { + // Required. A collection of text responses. + repeated string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether the playback of this message can be interrupted by the end + // user's speech and the client can then starts the next Dialogflow + // request. + bool allow_playback_interruption = 2; + } + + // Indicates that the conversation should be handed off to a human agent. + // + // Dialogflow only uses this to determine which conversations were handed off + // to a human agent for measurement purposes. What else to do with this signal + // is up to you and your handoff procedures. + // + // You may set this, for example: + // * In the [entry_fulfillment][google.cloud.dialogflow.cx.v3beta1.Page.entry_fulfillment] of a [Page][google.cloud.dialogflow.cx.v3beta1.Page] if + // entering the page indicates something went extremely wrong in the + // conversation. + // * In a webhook response when you determine that the customer issue can only + // be handled by a human. + message HumanAgentHandoff { + option deprecated = true; + + // Custom metadata for your handoff procedure. Dialogflow doesn't impose + // any structure on this. + google.protobuf.Struct metadata = 1; + } + + // Indicates that the conversation should be handed off to a live agent. + // + // Dialogflow only uses this to determine which conversations were handed off + // to a human agent for measurement purposes. What else to do with this signal + // is up to you and your handoff procedures. + // + // You may set this, for example: + // * In the [entry_fulfillment][google.cloud.dialogflow.cx.v3beta1.Page.entry_fulfillment] of a [Page][google.cloud.dialogflow.cx.v3beta1.Page] if + // entering the page indicates something went extremely wrong in the + // conversation. + // * In a webhook response when you determine that the customer issue can only + // be handled by a human. + message LiveAgentHandoff { + // Custom metadata for your handoff procedure. Dialogflow doesn't impose + // any structure on this. + google.protobuf.Struct metadata = 1; + } + + // Indicates that the conversation succeeded, i.e., the bot handled the issue + // that the customer talked to it about. + // + // Dialogflow only uses this to determine which conversations should be + // counted as successful and doesn't process the metadata in this message in + // any way. Note that Dialogflow also considers conversations that get to the + // conversation end page as successful even if they don't return + // [ConversationSuccess][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ConversationSuccess]. + // + // You may set this, for example: + // * In the [entry_fulfillment][google.cloud.dialogflow.cx.v3beta1.Page.entry_fulfillment] of a [Page][google.cloud.dialogflow.cx.v3beta1.Page] if + // entering the page indicates that the conversation succeeded. + // * In a webhook response when you determine that you handled the customer + // issue. + message ConversationSuccess { + // Custom metadata. Dialogflow doesn't impose any structure on this. + google.protobuf.Struct metadata = 1; + } + + // Specifies an audio clip to be played by the client as part of the response. + message PlayAudio { + // Required. URI of the audio clip. Dialogflow does not impose any validation on this + // value. It is specific to the client that reads it. + string audio_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether the playback of this message can be interrupted by the end + // user's speech and the client can then starts the next Dialogflow + // request. + bool allow_playback_interruption = 2; + } + + // A text or ssml response that is preferentially used for TTS output audio + // synthesis, as described in the comment on the ResponseMessage message. + message OutputAudioText { + // The source, which is either plain text or SSML. + oneof source { + // The raw text to be synthesized. + string text = 1; + + // The SSML text to be synthesized. For more information, see + // [SSML](/speech/text-to-speech/docs/ssml). + string ssml = 2; + } + } + + // Indicates that interaction with the Dialogflow agent has ended. + // This message is generated by Dialogflow only and not supposed to be + // defined by the user. + message EndInteraction { + + } + + // Represents an audio message that is composed of both segments + // synthesized from the Dialogflow agent prompts and ones hosted externally + // at the specified URIs. + // The external URIs are specified via + // [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio]. + // This message is generated by Dialogflow only and not supposed to be + // defined by the user. + message MixedAudio { + // Represents one segment of audio. + message Segment { + // Content of the segment. + oneof content { + // Raw audio synthesized from the Dialogflow agent's response using + // the output config specified in the request. + bytes audio = 1; + + // Client-specific URI that points to an audio clip accessible to the + // client. Dialogflow does not impose any validation on it. + string uri = 2; + } + + // Whether the playback of this segment can be interrupted by the end + // user's speech and the client should then start the next Dialogflow + // request. + bool allow_playback_interruption = 3; + } + + // Segments this audio response is composed of. + repeated Segment segments = 1; + } + + // Required. The rich response message. + oneof message { + // Returns a text response. + Text text = 1; + + // Returns a response containing a custom, platform-specific payload. + google.protobuf.Struct payload = 2; + + // Hands off conversation to a human agent. + HumanAgentHandoff human_agent_handoff = 6 [deprecated = true]; + + // Indicates that the conversation succeeded. + ConversationSuccess conversation_success = 9; + + // A text or ssml response that is preferentially used for TTS output audio + // synthesis, as described in the comment on the ResponseMessage message. + OutputAudioText output_audio_text = 8; + + // Hands off conversation to a human agent. + LiveAgentHandoff live_agent_handoff = 10; + + // Output only. A signal that indicates the interaction with the Dialogflow agent has + // ended. + // This message is generated by Dialogflow only when the conversation + // reaches `END_SESSION` or `END_PAGE` page. It is not supposed to be + // defined by the user. + // It's guaranteed that there is at most one such message in each response. + EndInteraction end_interaction = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Signal that the client should play an audio clip hosted at a + // client-specific URI. Dialogflow uses this to construct + // [mixed_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.mixed_audio]. However, Dialogflow itself + // does not try to read or process the URI in any way. + PlayAudio play_audio = 12; + + // Output only. An audio response message composed of both the synthesized Dialogflow + // agent responses and responses defined via + // [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio]. + // This message is generated by Dialogflow only and not supposed to be + // defined by the user. + MixedAudio mixed_audio = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto new file mode 100644 index 000000000..5853a8cc3 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto @@ -0,0 +1,645 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/audio_config.proto"; +import "google/cloud/dialogflow/cx/v3beta1/intent.proto"; +import "google/cloud/dialogflow/cx/v3beta1/page.proto"; +import "google/cloud/dialogflow/cx/v3beta1/response_message.proto"; +import "google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/rpc/status.proto"; +import "google/type/latlng.proto"; +import "google/api/client.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "SessionProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; +option (google.api.resource_definition) = { + type: "dialogflow.googleapis.com/Session" + pattern: "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}" +}; + +// A session represents an interaction with a user. You retrieve user input +// and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine +// user intent and respond. +service Sessions { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Processes a natural language query and returns structured, actionable data + // as a result. This method is not idempotent, because it may cause session + // entity types to be updated, which in turn might affect results of future + // queries. + rpc DetectIntent(DetectIntentRequest) returns (DetectIntentResponse) { + option (google.api.http) = { + post: "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:detectIntent" + body: "*" + }; + } + + // Processes a natural language query in audio format in a streaming fashion + // and returns structured, actionable data as a result. This method is only + // available via the gRPC API (not REST). + rpc StreamingDetectIntent(stream StreamingDetectIntentRequest) returns (stream StreamingDetectIntentResponse) { + } + + // Returns preliminary intent match results, doesn't change the session + // status. + rpc MatchIntent(MatchIntentRequest) returns (MatchIntentResponse) { + option (google.api.http) = { + post: "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:matchIntent" + body: "*" + }; + } + + // Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent]. + // Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from + // [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the behavior is undefined. + rpc FulfillIntent(FulfillIntentRequest) returns (FulfillIntentResponse) { + option (google.api.http) = { + post: "/v3beta1/{match_intent_request.session=projects/*/locations/*/agents/*/sessions/*}:fulfillIntent" + body: "*" + }; + } +} + +// The request to detect user's intent. +message DetectIntentRequest { + // Required. The name of the session this query is sent to. + // Format: `projects//locations//agents//sessions/`. + // It's up to the API caller to choose an appropriate `Session ID`. It can be + // a random number or some type of session identifiers (preferably hashed). + // The length of the `Session ID` must not exceed 36 characters. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + } + ]; + + // The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. + QueryInput query_input = 3 [(google.api.field_behavior) = REQUIRED]; + + // Instructs the speech synthesizer how to generate the output audio. + OutputAudioConfig output_audio_config = 4; +} + +// The message returned from the DetectIntent method. +message DetectIntentResponse { + // Output only. The unique identifier of the response. It can be used to + // locate a response in the training example set or for reporting issues. + string response_id = 1; + + // The result of the conversational query. + QueryResult query_result = 2; + + // The audio data bytes encoded as specified in the request. + // Note: The output audio is generated based on the values of default platform + // text responses found in the + // [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] field. If + // multiple default text responses exist, they will be concatenated when + // generating audio. If no default platform text responses exist, the + // generated audio content will be empty. + // + // In some scenarios, multiple output audio fields may be present in the + // response structure. In these cases, only the top-most-level audio output + // has content. + bytes output_audio = 4; + + // The config used by the speech synthesizer to generate the output audio. + OutputAudioConfig output_audio_config = 5; +} + +// The top-level message sent by the client to the +// [Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.StreamingDetectIntent] method. +// +// Multiple request messages should be sent in order: +// +// 1. The first message must contain +// [session][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.session], +// [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] plus optionally +// [query_params][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_params]. If the client +// wants to receive an audio response, it should also contain +// [output_audio_config][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.output_audio_config]. +// +// 2. If [query_input][google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest.query_input] was set to +// [query_input.audio.config][google.cloud.dialogflow.cx.v3beta1.AudioInput.config], all subsequent messages +// must contain [query_input.audio.audio][google.cloud.dialogflow.cx.v3beta1.AudioInput.audio] to continue with +// Speech recognition. +// If you decide to rather detect an intent from text +// input after you already started Speech recognition, please send a message +// with [query_input.text][google.cloud.dialogflow.cx.v3beta1.QueryInput.text]. +// +// However, note that: +// +// * Dialogflow will bill you for the audio duration so far. +// * Dialogflow discards all Speech recognition results in favor of the +// input text. +// * Dialogflow will use the language code from the first message. +// +// After you sent all input, you must half-close or abort the request stream. +message StreamingDetectIntentRequest { + // The name of the session this query is sent to. + // Format: `projects//locations//agents//sessions/`. + // It's up to the API caller to choose an appropriate `Session ID`. It can be + // a random number or some type of session identifiers (preferably hashed). + // The length of the `Session ID` must not exceed 36 characters. + // Note: session must be set in the first request. + string session = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + }]; + + // The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. + QueryInput query_input = 3 [(google.api.field_behavior) = REQUIRED]; + + // Instructs the speech synthesizer how to generate the output audio. + OutputAudioConfig output_audio_config = 4; +} + +// The top-level message returned from the `StreamingDetectIntent` method. +// +// Multiple response messages can be returned in order: +// +// 1. If the input was set to streaming audio, the first one or more messages +// contain `recognition_result`. Each `recognition_result` represents a more +// complete transcript of what the user said. The last `recognition_result` +// has `is_final` set to `true`. +// +// 2. The last message contains `detect_intent_response`. +message StreamingDetectIntentResponse { + // The output response. + oneof response { + // The result of speech recognition. + StreamingRecognitionResult recognition_result = 1; + + // The response from detect intent. + DetectIntentResponse detect_intent_response = 2; + } +} + +// Contains a speech recognition result corresponding to a portion of the audio +// that is currently being processed or an indication that this is the end +// of the single requested utterance. +// +// Example: +// +// 1. transcript: "tube" +// +// 2. transcript: "to be a" +// +// 3. transcript: "to be" +// +// 4. transcript: "to be or not to be" +// is_final: true +// +// 5. transcript: " that's" +// +// 6. transcript: " that is" +// +// 7. message_type: `END_OF_SINGLE_UTTERANCE` +// +// 8. transcript: " that is the question" +// is_final: true +// +// Only two of the responses contain final results (#4 and #8 indicated by +// `is_final: true`). Concatenating these generates the full transcript: "to be +// or not to be that is the question". +// +// In each response we populate: +// +// * for `TRANSCRIPT`: `transcript` and possibly `is_final`. +// +// * for `END_OF_SINGLE_UTTERANCE`: only `message_type`. +message StreamingRecognitionResult { + // Type of the response message. + enum MessageType { + // Not specified. Should never be used. + MESSAGE_TYPE_UNSPECIFIED = 0; + + // Message contains a (possibly partial) transcript. + TRANSCRIPT = 1; + + // Event indicates that the server has detected the end of the user's speech + // utterance and expects no additional speech. Therefore, the server will + // not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. This message is only sent if + // [`single_utterance`][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.single_utterance] was set to + // `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 2; + } + + // Type of the result message. + MessageType message_type = 1; + + // Transcript text representing the words that the user spoke. + // Populated if and only if `message_type` = `TRANSCRIPT`. + string transcript = 2; + + // If `false`, the `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, the recognizer will not return + // any further hypotheses about this piece of the audio. May only be populated + // for `message_type` = `TRANSCRIPT`. + bool is_final = 3; + + // The Speech confidence between 0.0 and 1.0 for the current portion of audio. + // A higher number indicates an estimated greater likelihood that the + // recognized words are correct. The default of 0.0 is a sentinel value + // indicating that confidence was not set. + // + // This field is typically only provided if `is_final` is true and you should + // not rely on it being accurate or even set. + float confidence = 4; + + // An estimate of the likelihood that the speech recognizer will + // not change its guess about this interim recognition result: + // * If the value is unspecified or 0.0, Dialogflow didn't compute the + // stability. In particular, Dialogflow will only provide stability for + // `TRANSCRIPT` results with `is_final = false`. + // * Otherwise, the value is in (0.0, 1.0] where 0.0 means completely + // unstable and 1.0 means completely stable. + float stability = 6; + + // Word-specific information for the words recognized by Speech in + // [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and + // [InputAudioConfig.enable_word_info] is set. + repeated SpeechWordInfo speech_word_info = 7; + + // Time offset of the end of this Speech recognition result relative to the + // beginning of the audio. Only populated for `message_type` = + // `TRANSCRIPT`. + google.protobuf.Duration speech_end_offset = 8; +} + +// Represents the parameters of a conversational query. +message QueryParameters { + // The time zone of this conversational query from the [time zone + // database](https://www.iana.org/time-zones), e.g., America/New_York, + // Europe/Paris. If not provided, the time zone specified in the agent is + // used. + string time_zone = 1; + + // The geo location of this conversational query. + google.type.LatLng geo_location = 2; + + // Additional session entity types to replace or extend developer entity types + // with. The entity synonyms apply to all languages and persist for the + // session of this query. + repeated SessionEntityType session_entity_types = 3; + + // This field can be used to pass custom data into the webhook associated with + // the agent. Arbitrary JSON objects are supported. + google.protobuf.Struct payload = 4; + + // Additional parameters to be put into [session + // parameters][SessionInfo.parameters]. To remove a + // parameter from the session, clients should explicitly set the parameter + // value to null. + // + // Depending on your protocol or client library language, this is a + // map, associative array, symbol table, dictionary, or JSON object + // composed of a collection of (MapKey, MapValue) pairs: + // + // - MapKey type: string + // - MapKey value: parameter name + // - MapValue type: + // - If parameter's entity type is a composite entity: map + // - Else: string or number, depending on parameter value type + // - MapValue value: + // - If parameter's entity type is a composite entity: + // map from composite entity property names to property values + // - Else: parameter value + google.protobuf.Struct parameters = 5; +} + +// Represents the query input. It can contain either: +// +// 1. A conversational query in the form of text. +// +// 2. An intent query that specifies which intent to trigger. +message QueryInput { + // Required. The input specification. + oneof input { + // The natural language text to be processed. + TextInput text = 2; + + // The intent to be triggered. + IntentInput intent = 3; + + // The natural language speech audio to be processed. + AudioInput audio = 5; + } + + // Required. The language of the input. See [Language + // Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + // list of the currently supported language codes. Note that queries in the + // same session do not necessarily need to specify the same language. + string language_code = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the result of a conversational query. +message QueryResult { + // The original conversational query. + oneof query { + // If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field + // will contain a copy of the text. + string text = 1; + + // If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will + // contain a copy of the intent identifier. + string trigger_intent = 11; + + // If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input, + // this field will contain the trascript for the audio. + string transcript = 12; + + // If an [event][google.cloud.dialogflow.cx.v3beta1.EventInput] was provided as input, this field will contain + // the name of the event. + string trigger_event = 14; + } + + // The language that was triggered during intent detection. + // See [Language + // Support](https://cloud.google.com/dialogflow/docs/reference/language) + // for a list of the currently supported language codes. + string language_code = 2; + + // The collected [session parameters][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters]. + // + // Depending on your protocol or client library language, this is a + // map, associative array, symbol table, dictionary, or JSON object + // composed of a collection of (MapKey, MapValue) pairs: + // + // - MapKey type: string + // - MapKey value: parameter name + // - MapValue type: + // - If parameter's entity type is a composite entity: map + // - Else: string or number, depending on parameter value type + // - MapValue value: + // - If parameter's entity type is a composite entity: + // map from composite entity property names to property values + // - Else: parameter value + google.protobuf.Struct parameters = 3; + + // The list of rich messages returned to the client. Responses vary from + // simple text messages to more sophisticated, structured payloads used + // to drive complex logic. + repeated ResponseMessage response_messages = 4; + + // The list of webhook call status in the order of call sequence. + repeated google.rpc.Status webhook_statuses = 13; + + // The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in + // the order of call sequence. If some webhook call fails or doesn't return + // any payload, an empty `Struct` would be used instead. + repeated google.protobuf.Struct webhook_payloads = 6; + + // The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message, + // including but not limited to `name` and `display_name`. + Page current_page = 7; + + // The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the conversational query. Some, not all fields + // are filled in this message, including but not limited to: `name` and + // `display_name`. + // This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead. + Intent intent = 8 [deprecated = true]; + + // The intent detection confidence. Values range from 0.0 (completely + // uncertain) to 1.0 (completely certain). + // This value is for informational purpose only and is only used to + // help match the best intent within the classification threshold. + // This value may change for the same end-user expression at any time due to a + // model retraining or change in implementation. + // This field is deprecated, please use [QueryResult.match][google.cloud.dialogflow.cx.v3beta1.QueryResult.match] instead. + float intent_detection_confidence = 9 [deprecated = true]; + + // Intent match result, could be an intent or an event. + Match match = 15; + + // The free-form diagnostic info. For example, this field could contain + // webhook call latency. The string keys of the Struct's fields map can change + // without notice. + google.protobuf.Struct diagnostic_info = 10; +} + +// Represents the natural language text to be processed. +message TextInput { + // Required. The UTF-8 encoded natural language text to be processed. Text length must + // not exceed 256 characters. + string text = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the intent to trigger programmatically rather than as a result of +// natural language processing. +message IntentInput { + // Required. The unique identifier of the intent. + // Format: `projects//locations//agents//intents/`. + string intent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + } + ]; +} + +// Represents the natural speech audio to be processed. +message AudioInput { + // Required. Instructs the speech recognizer how to process the speech audio. + InputAudioConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // The natural language speech audio to be processed. + // A single request can contain up to 1 minute of speech audio data. + // The [transcribed text][google.cloud.dialogflow.cx.v3beta1.QueryResult.transcript] cannot contain more than 256 + // bytes. + // + // For non-streaming audio detect intent, both `config` and `audio` must be + // provided. + // For streaming audio detect intent, `config` must be provided in + // the first request and `audio` must be provided in all following requests. + bytes audio = 2; +} + +// Represents one match result of [MatchIntent][]. +message Match { + // Type of a Match. + enum MatchType { + // Not specified. Should never be used. + MATCH_TYPE_UNSPECIFIED = 0; + + // The query was matched to an intent. + INTENT = 1; + + // The query directly triggered an intent. + DIRECT_INTENT = 2; + + // The query was used for parameter filling. + PARAMETER_FILLING = 3; + + // No match was found for the query. + NO_MATCH = 4; + + // Indicates an empty query. + NO_INPUT = 5; + } + + // The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in + // this message, including but not limited to: `name` and `display_name`. Only + // filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type. + Intent intent = 1; + + // The collection of parameters extracted from the query. + // + // Depending on your protocol or client library language, this is a + // map, associative array, symbol table, dictionary, or JSON object + // composed of a collection of (MapKey, MapValue) pairs: + // + // - MapKey type: string + // - MapKey value: parameter name + // - MapValue type: + // - If parameter's entity type is a composite entity: map + // - Else: string or number, depending on parameter value type + // - MapValue value: + // - If parameter's entity type is a composite entity: + // map from composite entity property names to property values + // - Else: parameter value + google.protobuf.Struct parameters = 2; + + // Final text input which was matched during MatchIntent. This value can be + // different from original input sent in request because of spelling + // correction or other processing. + string resolved_input = 3; + + // Type of this [Match][google.cloud.dialogflow.cx.v3beta1.Match]. + MatchType match_type = 4; + + // The confidence of this match. Values range from 0.0 (completely uncertain) + // to 1.0 (completely certain). + // This value is for informational purpose only and is only used to help match + // the best intent within the classification threshold. This value may change + // for the same end-user expression at any time due to a model retraining or + // change in implementation. + float confidence = 5; +} + +// Request of [MatchIntent][]. +message MatchIntentRequest { + // Required. The name of the session this query is sent to. + // Format: `projects//locations//agents//sessions/`. + // It's up to the API caller to choose an appropriate `Session ID`. It can be + // a random number or some type of session identifiers (preferably hashed). + // The length of the `Session ID` must not exceed 36 characters. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + } + ]; + + // The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. + QueryInput query_input = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response of [MatchIntent][]. +message MatchIntentResponse { + // The original conversational query. + oneof query { + // If [natural language text][google.cloud.dialogflow.cx.v3beta1.TextInput] was provided as input, this field + // will contain a copy of the text. + string text = 1; + + // If an [intent][google.cloud.dialogflow.cx.v3beta1.IntentInput] was provided as input, this field will + // contain a copy of the intent identifier. + string trigger_intent = 2; + + // If [natural language speech audio][google.cloud.dialogflow.cx.v3beta1.AudioInput] was provided as input, + // this field will contain the trascript for the audio. + string transcript = 3; + } + + // Match results, if more than one, ordered descendingly by the confidence + // we have that the particular intent matches the query. + repeated Match matches = 4; + + // The current [Page][google.cloud.dialogflow.cx.v3beta1.Page]. Some, not all fields are filled in this message, + // including but not limited to `name` and `display_name`. + Page current_page = 5; +} + +// Request of [FulfillIntent][] +message FulfillIntentRequest { + // Must be same as the corresponding MatchIntent request, otherwise the + // behavior is undefined. + MatchIntentRequest match_intent_request = 1; + + // The matched intent/event to fulfill. + Match match = 2; + + // Instructs the speech synthesizer how to generate output audio. + OutputAudioConfig output_audio_config = 3; +} + +// Response of [FulfillIntent][] +message FulfillIntentResponse { + // Output only. The unique identifier of the response. It can be used to + // locate a response in the training example set or for reporting issues. + string response_id = 1; + + // The result of the conversational query. + QueryResult query_result = 2; + + // The audio data bytes encoded as specified in the request. + // Note: The output audio is generated based on the values of default platform + // text responses found in the + // [`query_result.response_messages`][google.cloud.dialogflow.cx.v3beta1.QueryResult.response_messages] field. If + // multiple default text responses exist, they will be concatenated when + // generating audio. If no default platform text responses exist, the + // generated audio content will be empty. + // + // In some scenarios, multiple output audio fields may be present in the + // response structure. In these cases, only the top-most-level audio output + // has content. + bytes output_audio = 3; + + // The config used by the speech synthesizer to generate the output audio. + OutputAudioConfig output_audio_config = 4; +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto new file mode 100644 index 000000000..2e4fb4b19 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto @@ -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 +// +// 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/entity_type.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "SessionEntityTypeProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType]. +service SessionEntityTypes { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all session entity types in the specified session. + rpc ListSessionEntityTypes(ListSessionEntityTypesRequest) returns (ListSessionEntityTypesResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified session entity type. + rpc GetSessionEntityType(GetSessionEntityTypeRequest) returns (SessionEntityType) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a session entity type. + // + // If the specified session entity type already exists, overrides the + // session entity type. + rpc CreateSessionEntityType(CreateSessionEntityTypeRequest) returns (SessionEntityType) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes" + body: "session_entity_type" + }; + option (google.api.method_signature) = "parent,session_entity_type"; + } + + // Updates the specified session entity type. + rpc UpdateSessionEntityType(UpdateSessionEntityTypeRequest) returns (SessionEntityType) { + option (google.api.http) = { + patch: "/v3beta1/{session_entity_type.name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}" + body: "session_entity_type" + }; + option (google.api.method_signature) = "session_entity_type,update_mask"; + } + + // Deletes the specified session entity type. + rpc DeleteSessionEntityType(DeleteSessionEntityTypeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/sessions/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Session entity types are referred to as **User** entity types and are +// entities that are built for an individual user such as favorites, +// preferences, playlists, and so on. +// +// You can redefine a session entity type at the session level to extend or +// replace a [custom entity type][google.cloud.dialogflow.cx.v3beta1.EntityType] at the user session level (we +// refer to the entity types defined at the agent level as "custom entity +// types"). +// +// Note: session entity types apply to all queries, regardless of the language. +// +// For more information about entity types, see the [Dialogflow +// documentation](https://cloud.google.com/dialogflow/docs/entities-overview). +message SessionEntityType { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/SessionEntityType" + pattern: "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}" + }; + + // The types of modifications for the session entity type. + enum EntityOverrideMode { + // Not specified. This value should be never used. + ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0; + + // The collection of session entities overrides the collection of entities + // in the corresponding custom entity type. + ENTITY_OVERRIDE_MODE_OVERRIDE = 1; + + // The collection of session entities extends the collection of entities in + // the corresponding custom entity type. + // + // Note: Even in this override mode calls to `ListSessionEntityTypes`, + // `GetSessionEntityType`, `CreateSessionEntityType` and + // `UpdateSessionEntityType` only return the additional entities added in + // this session entity type. If you want to get the supplemented list, + // please call [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityType] on the custom entity type + // and merge. + ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2; + } + + // Required. The unique identifier of the session entity type. + // Format: `projects//locations//agents//sessions//entityTypes/`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates whether the additional data should override or supplement the + // custom entity type definition. + EntityOverrideMode entity_override_mode = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The collection of entities to override or supplement the custom entity + // type. + repeated EntityType.Entity entities = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypes]. +message ListSessionEntityTypesRequest { + // Required. The session to list all session entity types from. + // Format: `projects//locations//agents//sessions/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypes]. +message ListSessionEntityTypesResponse { + // The list of session entity types. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated SessionEntityType session_entity_types = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.GetSessionEntityType]. +message GetSessionEntityTypeRequest { + // Required. The name of the session entity type. + // Format: `projects//locations//agents//sessions//entityTypes/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; +} + +// The request message for [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.CreateSessionEntityType]. +message CreateSessionEntityTypeRequest { + // Required. The session to create a session entity type for. + // Format: `projects//locations//agents//sessions/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; + + // Required. The session entity type to create. + SessionEntityType session_entity_type = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.UpdateSessionEntityType]. +message UpdateSessionEntityTypeRequest { + // Required. The session entity type to update. + // Format: `projects//locations//agents//sessions//entityTypes/`. + SessionEntityType session_entity_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.DeleteSessionEntityType]. +message DeleteSessionEntityTypeRequest { + // Required. The name of the session entity type to delete. + // Format: `projects//locations//agents//sessions//entityTypes/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SessionEntityType" + } + ]; +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto new file mode 100644 index 000000000..a2eed7b4a --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto @@ -0,0 +1,248 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/page.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "TransitionRouteGroupProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. +service TransitionRouteGroups { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all transition route groups in the specified flow. + rpc ListTransitionRouteGroups(ListTransitionRouteGroupsRequest) returns (ListTransitionRouteGroupsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + rpc GetTransitionRouteGroup(GetTransitionRouteGroupRequest) returns (TransitionRouteGroup) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in the specified flow. + rpc CreateTransitionRouteGroup(CreateTransitionRouteGroupRequest) returns (TransitionRouteGroup) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups" + body: "transition_route_group" + }; + option (google.api.method_signature) = "parent,transition_route_group"; + } + + // Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + rpc UpdateTransitionRouteGroup(UpdateTransitionRouteGroupRequest) returns (TransitionRouteGroup) { + option (google.api.http) = { + patch: "/v3beta1/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}" + body: "transition_route_group" + }; + option (google.api.method_signature) = "transition_route_group,update_mask"; + } + + // Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + rpc DeleteTransitionRouteGroup(DeleteTransitionRouteGroupRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// An TransitionRouteGroup represents a group of +// [`TransitionRoutes`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page]. +message TransitionRouteGroup { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}" + }; + + // The unique identifier of the transition route group. + // [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup] populates the name + // automatically. + // Format: `projects//locations//agents//flows//transitionRouteGroups/`. + string name = 1; + + // Required. The human-readable name of the transition route group, unique within + // the [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. The display name can be no longer than 30 characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + // Duplicate transition routes (i.e. using the same + // [`intent`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.intent]) are not allowed. + // + // Note that the [`name`][google.cloud.dialogflow.cx.v3beta1.TransitionRoute.name] field is not used in the + // transition route group scope. + repeated TransitionRoute transition_routes = 5; +} + +// The request message for [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroups]. +message ListTransitionRouteGroupsRequest { + // Required. The flow to list all transition route groups for. + // Format: `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; + + // The language to list transition route groups for. The field + // [`messages`][TransitionRoute.trigger_fulfillment.messages] in + // [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent. + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 4; +} + +// The response message for [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroups]. +message ListTransitionRouteGroupsResponse { + // The list of transition route groups. There will be a maximum number of + // items returned based on the page_size field in the request. The list may in + // some cases be empty or contain fewer entries than page_size even if this + // isn't the last page. + repeated TransitionRouteGroup transition_route_groups = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for [TransitionRouteGroups.GetTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.GetTransitionRouteGroup]. +message GetTransitionRouteGroupRequest { + // Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. + // Format: `projects//locations//agents//flows//transitionRouteGroups/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // The language to list transition route groups for. The field + // [`messages`][TransitionRoute.trigger_fulfillment.messages] in + // [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent. + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; +} + +// The request message for [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup]. +message CreateTransitionRouteGroupRequest { + // Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for. + // Format: `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // Required. The transition route group to create. + TransitionRouteGroup transition_route_group = 2 [(google.api.field_behavior) = REQUIRED]; + + // The language to list transition route groups for. The field + // [`messages`][TransitionRoute.trigger_fulfillment.messages] in + // [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent. + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for [TransitionRouteGroups.UpdateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.UpdateTransitionRouteGroup]. +message UpdateTransitionRouteGroupRequest { + // Required. The transition route group to update. + TransitionRouteGroup transition_route_group = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2; + + // The language to list transition route groups for. The field + // [`messages`][TransitionRoute.trigger_fulfillment.messages] in + // [TransitionRoute][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] is language dependent. + // + // If not specified, the agent's default language is used. + // [Many + // languages](https://cloud.google.com/dialogflow/docs/reference/language) + // are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 3; +} + +// The request message for [TransitionRouteGroups.DeleteTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.DeleteTransitionRouteGroup]. +message DeleteTransitionRouteGroupRequest { + // Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete. + // Format: `projects//locations//agents//flows//transitionRouteGroups/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TransitionRouteGroup" + } + ]; + + // This field has no effect for transition route group that no page is using. + // If the transition route group is referenced by any page: + // + // * If `force` is set to false, an error will be returned with message + // indicating pages that reference the transition route group. + // * If `force` is set to true, Dialogflow will remove the transition route + // group, as well as any reference to it. + bool force = 2; +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/version.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/version.proto new file mode 100644 index 000000000..819a6d3cd --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/version.proto @@ -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 +// +// 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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/flow.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "VersionProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version]. +service Versions { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + rpc GetVersion(GetVersionRequest) returns (Version) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. + rpc CreateVersion(CreateVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/versions" + body: "version" + }; + option (google.api.method_signature) = "parent,version"; + option (google.longrunning.operation_info) = { + response_type: "Version" + metadata_type: "CreateVersionOperationMetadata" + }; + } + + // Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + rpc UpdateVersion(UpdateVersionRequest) returns (Version) { + option (google.api.http) = { + patch: "/v3beta1/{version.name=projects/*/locations/*/agents/*/flows/*/versions/*}" + body: "version" + }; + option (google.api.method_signature) = "version,update_mask"; + } + + // Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + rpc DeleteVersion(DeleteVersionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Loads a specified version to draft version. + rpc LoadVersion(LoadVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/versions/*}:load" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Struct" + }; + } +} + +// Metadata associated with the long running operation for +// [Versions.CreateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersion]. +message CreateVersionOperationMetadata { + // Name of the created version. + // Format: `projects//locations//agents//flows//versions/`. + string version = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + }]; +} + +// Represents a version of a flow. +message Version { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Version" + pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}" + }; + + // The state of the version. + enum State { + // Not specified. This value is not used. + STATE_UNSPECIFIED = 0; + + // Version is not ready to serve (e.g. training is running). + RUNNING = 1; + + // Training has succeeded and this version is ready to serve. + SUCCEEDED = 2; + + // Version training failed. + FAILED = 3; + } + + // Format: projects//locations//agents//flows//versions/. Version ID is a self-increasing + // number generated by Dialogflow upon version creation. + string name = 1; + + // Required. The human-readable name of the version. Limit of 64 characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the version. The maximum length is 500 characters. If + // exceeded, the request is rejected. + string description = 3; + + // Output only. The NLU settings of the flow at version creation. + NluSettings nlu_settings = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time of the version. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of this version. This field is read-only and cannot be set by + // create and update methods. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions]. +message ListVersionsRequest { + // Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all versions for. + // Format: `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Version" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions]. +message ListVersionsResponse { + // A list of versions. There will be a maximum number of items returned based + // on the page_size field in the request. The list may in some cases be empty + // or contain fewer entries than page_size even if this isn't the last page. + repeated Version versions = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for [Versions.GetVersion][google.cloud.dialogflow.cx.v3beta1.Versions.GetVersion]. +message GetVersionRequest { + // Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version]. + // Format: `projects//locations//agents//flows//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; +} + +// The request message for [Versions.CreateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersion]. +message CreateVersionRequest { + // Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an [Version][google.cloud.dialogflow.cx.v3beta1.Version] for. + // Format: `projects//locations//agents//flows/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Version" + } + ]; + + // Required. The version to create. + Version version = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Versions.UpdateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.UpdateVersion]. +message UpdateVersionRequest { + // Required. The version to update. + Version version = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. Currently only `description` + // and `display_name` can be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Versions.DeleteVersion][google.cloud.dialogflow.cx.v3beta1.Versions.DeleteVersion]. +message DeleteVersionRequest { + // Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to delete. + // Format: `projects//locations//agents//flows//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; +} + +// The request message for [Versions.LoadVersion][google.cloud.dialogflow.cx.v3beta1.Versions.LoadVersion]. +message LoadVersionRequest { + // Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to draft version. + // Format: `projects//locations//agents//flows//versions/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Version" + } + ]; + + // This field is used to prevent accidental overwrite of other agent resources + // in the draft version, which can potentially impact other flow's behavior. + // If `allow_override_agent_resources` is false, conflicted agent-level + // resources will not be overridden (i.e. intents, entities, webhooks). + bool allow_override_agent_resources = 2; +} diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/webhook.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/webhook.proto new file mode 100644 index 000000000..ff5654742 --- /dev/null +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/webhook.proto @@ -0,0 +1,430 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/cx/v3beta1/response_message.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "WebhookProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook]. +service Webhooks { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all webhooks in the specified agent. + rpc ListWebhooks(ListWebhooksRequest) returns (ListWebhooksResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/webhooks" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified webhook. + rpc GetWebhook(GetWebhookRequest) returns (Webhook) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/agents/*/webhooks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a webhook in the specified agent. + rpc CreateWebhook(CreateWebhookRequest) returns (Webhook) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/webhooks" + body: "webhook" + }; + option (google.api.method_signature) = "parent,webhook"; + } + + // Updates the specified webhook. + rpc UpdateWebhook(UpdateWebhookRequest) returns (Webhook) { + option (google.api.http) = { + patch: "/v3beta1/{webhook.name=projects/*/locations/*/agents/*/webhooks/*}" + body: "webhook" + }; + option (google.api.method_signature) = "webhook,update_mask"; + } + + // Deletes the specified webhook. + rpc DeleteWebhook(DeleteWebhookRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/agents/*/webhooks/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Webhooks host the developer's business logic. During a session, webhooks +// allow the developer to use the data extracted by Dialogflow's natural +// language processing to generate dynamic responses, validate collected data, +// or trigger actions on the backend. +message Webhook { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Webhook" + pattern: "projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}" + }; + + // Represents configuration for a generic web service. + message GenericWebService { + // Required. The webhook URI for receiving POST requests. It must use https protocol. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // The user name for HTTP Basic authentication. + string username = 2 [deprecated = true]; + + // The password for HTTP Basic authentication. + string password = 3 [deprecated = true]; + + // The HTTP request headers to send together with webhook + // requests. + map request_headers = 4; + } + + // The unique identifier of the webhook. + // Required for the [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook] method. + // [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook] populates the name automatically. + // Format: `projects//locations//agents//webhooks/`. + string name = 1; + + // Required. The human-readable name of the webhook, unique within the agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The webhook configuration. + oneof webhook { + // Configuration for a generic web service. + GenericWebService generic_web_service = 4; + } + + // Webhook execution timeout. Execution is considered failed if Dialogflow + // doesn't receive a response from webhook at the end of the timeout period. + // Defaults to 5 seconds, maximum allowed timeout is 30 seconds. + google.protobuf.Duration timeout = 6; + + // Indicates whether the webhook is disabled. + bool disabled = 5; +} + +// The request message for [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks]. +message ListWebhooksRequest { + // Required. The agent to list all webhooks for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Webhook" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks]. +message ListWebhooksResponse { + // The list of webhooks. There will be a maximum number of items returned + // based on the page_size field in the request. + repeated Webhook webhooks = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for [Webhooks.GetWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.GetWebhook]. +message GetWebhookRequest { + // Required. The name of the webhook. + // Format: `projects//locations//agents//webhooks/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Webhook" + } + ]; +} + +// The request message for [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook]. +message CreateWebhookRequest { + // Required. The agent to create a webhook for. + // Format: `projects//locations//agents/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Webhook" + } + ]; + + // Required. The webhook to create. + Webhook webhook = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook]. +message UpdateWebhookRequest { + // Required. The webhook to update. + Webhook webhook = 1 [(google.api.field_behavior) = REQUIRED]; + + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for [Webhooks.DeleteWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.DeleteWebhook]. +message DeleteWebhookRequest { + // Required. The name of the webhook to delete. + // Format: `projects//locations//agents//webhooks/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Webhook" + } + ]; +} + +// The request message for a webhook call. +message WebhookRequest { + // Represents fulfillment information communicated to the webhook. + message FulfillmentInfo { + // Always present. The tag used to identify which fulfillment is being + // called. + string tag = 1; + } + + // Represents intent information communicated to the webhook. + message IntentInfo { + // Represents a value for an intent parameter. + message IntentParameterValue { + // Always present. Original text value extracted from user utterance. + string original_value = 1; + + // Always present. Structured value for the parameter extracted from user + // utterance. + google.protobuf.Value resolved_value = 2; + } + + // Always present. The unique identifier of the last matched + // [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. Format: `projects//locations//agents//intents/`. + string last_matched_intent = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // Parameters identified as a result of intent matching. This is a map of + // the name of the identified parameter to the value of the parameter + // identified from the user's utterance. All parameters defined in the + // matched intent that are identified will be surfaced here. + map parameters = 2; + } + + // Always present. The unique identifier of the [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse] that + // will be returned to the API caller. + string detect_intent_response_id = 1; + + // Always present. Information about the fulfillment that triggered this + // webhook call. + FulfillmentInfo fulfillment_info = 6; + + // Information about the last matched intent. + IntentInfo intent_info = 3; + + // Information about page status. + PageInfo page_info = 4; + + // Information about session status. + SessionInfo session_info = 5; + + // The list of rich message responses to present to the user. Webhook can + // choose to append or replace this list in + // [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response]; + repeated ResponseMessage messages = 7; + + // Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3beta1.QueryParameters.payload]. + google.protobuf.Struct payload = 8; +} + +// The response message for a webhook call. +message WebhookResponse { + // Represents a fulfillment response to the user. + message FulfillmentResponse { + // Defines merge behavior for `messages`. + enum MergeBehavior { + // Not specified. `APPEND` will be used. + MERGE_BEHAVIOR_UNSPECIFIED = 0; + + // `messages` will be appended to the list of messages waiting to be sent + // to the user. + APPEND = 1; + + // `messages` will replace the list of messages waiting to be sent to the + // user. + REPLACE = 2; + } + + // The list of rich message responses to present to the user. + repeated ResponseMessage messages = 1; + + // Merge behavior for `messages`. + MergeBehavior merge_behavior = 2; + } + + // The fulfillment response to send to the user. This field can be omitted by + // the webhook if it does not intend to send any response to the user. + FulfillmentResponse fulfillment_response = 1; + + // Information about page status. This field can be omitted by the webhook if + // it does not intend to modify page status. + PageInfo page_info = 2; + + // Information about session status. This field can be omitted by the webhook + // if it does not intend to modify session status. + SessionInfo session_info = 3; + + // Value to append directly to [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads]. + google.protobuf.Struct payload = 4; + + // The target to transition to. This can be set optionally to indicate an + // immediate transition to a different page in the same host flow, or a + // different flow in the same agent. + oneof transition { + // The target page to transition to. + // Format: `projects//locations//agents//flows//pages/`. + string target_page = 5 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // The target flow to transition to. + // Format: `projects//locations//agents//flows/`. + string target_flow = 6 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + } +} + +// Represents page information communicated to and from the webhook. +message PageInfo { + // Represents form information. + message FormInfo { + // Represents parameter information. + message ParameterInfo { + // Represents the state of a parameter. + enum ParameterState { + // Not specified. This value should be never used. + PARAMETER_STATE_UNSPECIFIED = 0; + + // Indicates that the parameter does not have a value. + EMPTY = 1; + + // Indicates that the parameter value is invalid. This field can be used + // by the webhook to invalidate the parameter and ask the server to + // collect it from the user again. + INVALID = 2; + + // Indicates that the parameter has a value. + FILLED = 3; + } + + // Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // The human-readable name of the parameter, unique within the form. This + // field cannot be modified by the webhook. + string display_name = 1; + + // Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // Indicates whether the parameter is required. Optional parameters will + // not trigger prompts; however, they are filled if the user specifies + // them. Required parameters must be filled before form filling concludes. + bool required = 2; + + // Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Required for + // [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The state of the parameter. This field can be set + // to [INVALID][google.cloud.dialogflow.cx.v3beta1.PageInfo.FormInfo.ParameterInfo.ParameterState.INVALID] by + // the webhook to invalidate the parameter; other values set by the + // webhook will be ignored. + ParameterState state = 3; + + // Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // The value of the parameter. This field can be set by the webhook to + // change the parameter value. + google.protobuf.Value value = 4; + + // Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // Indicates if the parameter value was just collected on the last + // conversation turn. + bool just_collected = 5; + } + + // Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // The parameters contained in the form. Note that the webhook cannot add + // or remove any form parameter. + repeated ParameterInfo parameter_info = 2; + } + + // Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // The unique identifier of the current page. + // Format: `projects//locations//agents//flows//pages/`. + string current_page = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Page" + }]; + + // Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // Information about the form. + FormInfo form_info = 3; +} + +// Represents session information communicated to and from the webhook. +message SessionInfo { + // Always present for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Ignored for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // The unique identifier of the [session][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest.session]. This + // field can be used by the webhook to identify a user. + // Format: `projects//locations//agents//sessions/`. + string session = 1 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Session" + }]; + + // Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. + // All parameters collected from forms and intents during the session. + // Parameters can be created, updated, or removed by the webhook. To remove a + // parameter from the session, the webhook should explicitly set the parameter + // value to null in [WebhookResponse][google.cloud.dialogflow.cx.v3beta1.WebhookResponse]. The map is keyed by parameters' + // display names. + map parameters = 2; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000..22246dae7 --- /dev/null +++ b/renovate.json @@ -0,0 +1,81 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "^com.google.api:gax", + "^com.google.auth:", + "^com.google.cloud:google-cloud-core", + "^io.grpc:", + "^com.google.guava:" + ], + "groupName": "core dependencies" + }, + { + "packagePatterns": [ + "^com.google.http-client:", + "^com.google.oauth-client:", + "^com.google.api-client:" + ], + "groupName": "core transport dependencies" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-dialogflow-cx", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true, + "masterIssue": true +} \ No newline at end of file diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml new file mode 100644 index 000000000..2d990040d --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + dialogflow-cx-install-without-bom + jar + Google Dialogflow CX Install Without Bom + https://github.com/googleapis/java-dialogflow-cx + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-dialogflow-cx + 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 000000000..e03a650f9 --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-dialogflow-cx-samples + 0.0.1-SNAPSHOT + pom + Google Dialogflow CX Samples Parent + https://github.com/googleapis/java-dialogflow-cx + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + + true + + + + + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml new file mode 100644 index 000000000..f795a2411 --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + dialogflow-cx-snapshot + jar + Google Dialogflow CX Snapshot Samples + https://github.com/googleapis/java-dialogflow-cx + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-dialogflow-cx + 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 000000000..56750e55f --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + dialogflow-cx-snippets + jar + Google Dialogflow CX Snippets + https://github.com/googleapis/java-dialogflow-cx + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-dialogflow-cx + 0.0.0 + + + + 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 000000000..b95d5c360 --- /dev/null +++ b/synth.metadata @@ -0,0 +1,37 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "sso://devrel/cloud/libraries/java/repo-splitter", + "sha": "3c04e9efa0aad6db63fd02cf402018bc9ecedba9" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "457ae33da792c0a799f72c5f494443ebe26186f0", + "internalRef": "327031420" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "d3049e66447b44dc10579e461d5e08e0e3838edd" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "dialogflow-cx", + "apiVersion": "v3beta1", + "language": "java", + "generator": "bazel" + } + } + ] +} \ No newline at end of file diff --git a/synth.py b/synth.py new file mode 100644 index 000000000..eccc51336 --- /dev/null +++ b/synth.py @@ -0,0 +1,32 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.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 = 'dialogflow-cx' +versions = ['v3beta1'] + +for version in versions: + java.bazel_library( + service=service, + version=version, + proto_path=f'google/cloud/dialogflow/cx/{version}', + bazel_target=f'//google/cloud/dialogflow/cx/{version}:google-cloud-{service}-{version}-java', + ) + +java.common_templates() \ No newline at end of file diff --git a/versions.txt b/versions.txt new file mode 100644 index 000000000..c35a70f83 --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-dialogflow-cx:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-dialogflow-cx-v3beta1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-dialogflow-cx-v3beta1:0.0.0:0.0.1-SNAPSHOT \ No newline at end of file