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

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 (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Connection connection = Connection.newBuilder().build();
+ *   String connectionId = "";
+ *   Connection response = connectionServiceClient.createConnection(parent, connection, connectionId);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

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

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   String connectionId = "";
+   *   Connection response = connectionServiceClient.createConnection(parent, connection, connectionId);
+   * }
+   * 
+ * + * @param parent Required. Parent resource name. Must be in the format + * `projects/{project_id}/locations/{location_id}` + * @param connection Required. Connection to create. + * @param connectionId Optional. Connection id that should be assigned to the created connection. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection createConnection( + LocationName parent, Connection connection, String connectionId) { + CreateConnectionRequest request = + CreateConnectionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setConnection(connection) + .setConnectionId(connectionId) + .build(); + return createConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   String connectionId = "";
+   *   Connection response = connectionServiceClient.createConnection(parent.toString(), connection, connectionId);
+   * }
+   * 
+ * + * @param parent Required. Parent resource name. Must be in the format + * `projects/{project_id}/locations/{location_id}` + * @param connection Required. Connection to create. + * @param connectionId Optional. Connection id that should be assigned to the created connection. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection createConnection( + String parent, Connection connection, String connectionId) { + CreateConnectionRequest request = + CreateConnectionRequest.newBuilder() + .setParent(parent) + .setConnection(connection) + .setConnectionId(connectionId) + .build(); + return createConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   CreateConnectionRequest request = CreateConnectionRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setConnection(connection)
+   *     .build();
+   *   Connection response = connectionServiceClient.createConnection(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 Connection createConnection(CreateConnectionRequest request) { + return createConnectionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   CreateConnectionRequest request = CreateConnectionRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setConnection(connection)
+   *     .build();
+   *   ApiFuture<Connection> future = connectionServiceClient.createConnectionCallable().futureCall(request);
+   *   // Do something
+   *   Connection response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createConnectionCallable() { + return stub.createConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection response = connectionServiceClient.getConnection(name);
+   * }
+   * 
+ * + * @param name Required. Name of the requested connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection getConnection(ConnectionName name) { + GetConnectionRequest request = + GetConnectionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection response = connectionServiceClient.getConnection(name.toString());
+   * }
+   * 
+ * + * @param name Required. Name of the requested connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection getConnection(String name) { + GetConnectionRequest request = GetConnectionRequest.newBuilder().setName(name).build(); + return getConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetConnectionRequest request = GetConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Connection response = connectionServiceClient.getConnection(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 Connection getConnection(GetConnectionRequest request) { + return getConnectionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetConnectionRequest request = GetConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Connection> future = connectionServiceClient.getConnectionCallable().futureCall(request);
+   *   // Do something
+   *   Connection response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getConnectionCallable() { + return stub.getConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a list of connections in the given project. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   UInt32Value maxResults = UInt32Value.newBuilder().build();
+   *   ListConnectionsResponse response = connectionServiceClient.listConnections(parent, maxResults);
+   * }
+   * 
+ * + * @param parent Required. Parent resource name. Must be in the form: + * `projects/{project_id}/locations/{location_id}` + * @param maxResults Required. Maximum number of results per page. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListConnectionsResponse listConnections( + LocationName parent, UInt32Value maxResults) { + ListConnectionsRequest request = + ListConnectionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setMaxResults(maxResults) + .build(); + return listConnections(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a list of connections in the given project. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   UInt32Value maxResults = UInt32Value.newBuilder().build();
+   *   ListConnectionsResponse response = connectionServiceClient.listConnections(parent.toString(), maxResults);
+   * }
+   * 
+ * + * @param parent Required. Parent resource name. Must be in the form: + * `projects/{project_id}/locations/{location_id}` + * @param maxResults Required. Maximum number of results per page. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListConnectionsResponse listConnections(String parent, UInt32Value maxResults) { + ListConnectionsRequest request = + ListConnectionsRequest.newBuilder().setParent(parent).setMaxResults(maxResults).build(); + return listConnections(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a list of connections in the given project. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   UInt32Value maxResults = UInt32Value.newBuilder().build();
+   *   ListConnectionsRequest request = ListConnectionsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setMaxResults(maxResults)
+   *     .build();
+   *   ListConnectionsResponse response = connectionServiceClient.listConnections(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 ListConnectionsResponse listConnections(ListConnectionsRequest request) { + return listConnectionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a list of connections in the given project. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   UInt32Value maxResults = UInt32Value.newBuilder().build();
+   *   ListConnectionsRequest request = ListConnectionsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setMaxResults(maxResults)
+   *     .build();
+   *   ApiFuture<ListConnectionsResponse> future = connectionServiceClient.listConnectionsCallable().futureCall(request);
+   *   // Do something
+   *   ListConnectionsResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + listConnectionsCallable() { + return stub.listConnectionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified connection. For security reasons, also resets credential if connection + * properties are in the update field mask. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Connection response = connectionServiceClient.updateConnection(name, connection, updateMask);
+   * }
+   * 
+ * + * @param name Required. Name of the connection to update, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @param connection Required. Connection containing the updated fields. + * @param updateMask Required. Update mask for the connection fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection updateConnection( + ConnectionName name, Connection connection, FieldMask updateMask) { + UpdateConnectionRequest request = + UpdateConnectionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setConnection(connection) + .setUpdateMask(updateMask) + .build(); + return updateConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified connection. For security reasons, also resets credential if connection + * properties are in the update field mask. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Connection response = connectionServiceClient.updateConnection(name.toString(), connection, updateMask);
+   * }
+   * 
+ * + * @param name Required. Name of the connection to update, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @param connection Required. Connection containing the updated fields. + * @param updateMask Required. Update mask for the connection fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection updateConnection( + String name, Connection connection, FieldMask updateMask) { + UpdateConnectionRequest request = + UpdateConnectionRequest.newBuilder() + .setName(name) + .setConnection(connection) + .setUpdateMask(updateMask) + .build(); + return updateConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified connection. For security reasons, also resets credential if connection + * properties are in the update field mask. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateConnectionRequest request = UpdateConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setConnection(connection)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Connection response = connectionServiceClient.updateConnection(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 Connection updateConnection(UpdateConnectionRequest request) { + return updateConnectionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified connection. For security reasons, also resets credential if connection + * properties are in the update field mask. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateConnectionRequest request = UpdateConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setConnection(connection)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Connection> future = connectionServiceClient.updateConnectionCallable().futureCall(request);
+   *   // Do something
+   *   Connection response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateConnectionCallable() { + return stub.updateConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the credential for the specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   String name = "";
+   *   ConnectionCredential credential = ConnectionCredential.newBuilder().build();
+   *   connectionServiceClient.updateConnectionCredential(name, credential);
+   * }
+   * 
+ * + * @param name Required. Name of the connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential` + * @param credential Required. Credential to use with the connection. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void updateConnectionCredential(String name, ConnectionCredential credential) { + UpdateConnectionCredentialRequest request = + UpdateConnectionCredentialRequest.newBuilder() + .setName(name) + .setCredential(credential) + .build(); + updateConnectionCredential(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the credential for the specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   String name = "";
+   *   ConnectionCredential credential = ConnectionCredential.newBuilder().build();
+   *   UpdateConnectionCredentialRequest request = UpdateConnectionCredentialRequest.newBuilder()
+   *     .setName(name)
+   *     .setCredential(credential)
+   *     .build();
+   *   connectionServiceClient.updateConnectionCredential(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 updateConnectionCredential(UpdateConnectionCredentialRequest request) { + updateConnectionCredentialCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the credential for the specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   String name = "";
+   *   ConnectionCredential credential = ConnectionCredential.newBuilder().build();
+   *   UpdateConnectionCredentialRequest request = UpdateConnectionCredentialRequest.newBuilder()
+   *     .setName(name)
+   *     .setCredential(credential)
+   *     .build();
+   *   ApiFuture<Void> future = connectionServiceClient.updateConnectionCredentialCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + updateConnectionCredentialCallable() { + return stub.updateConnectionCredentialCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes connection and associated credential. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   connectionServiceClient.deleteConnection(name);
+   * }
+   * 
+ * + * @param name Required. Name of the deleted connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteConnection(ConnectionName name) { + DeleteConnectionRequest request = + DeleteConnectionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes connection and associated credential. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   connectionServiceClient.deleteConnection(name.toString());
+   * }
+   * 
+ * + * @param name Required. Name of the deleted connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteConnection(String name) { + DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder().setName(name).build(); + deleteConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes connection and associated credential. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   connectionServiceClient.deleteConnection(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 deleteConnection(DeleteConnectionRequest request) { + deleteConnectionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes connection and associated credential. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = connectionServiceClient.deleteConnectionCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteConnectionCallable() { + return stub.deleteConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetPolicyOptions options = GetPolicyOptions.newBuilder().build();
+   *   Policy response = connectionServiceClient.getIamPolicy(resource, options);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @param options OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`. + * This field is only used by Cloud IAM. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(ResourceName resource, GetPolicyOptions options) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setOptions(options) + .build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetPolicyOptions options = GetPolicyOptions.newBuilder().build();
+   *   Policy response = connectionServiceClient.getIamPolicy(resource.toString(), options);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @param options OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`. + * This field is only used by Cloud IAM. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource, GetPolicyOptions options) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder().setResource(resource).setOptions(options).build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = connectionServiceClient.getIamPolicy(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 Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = connectionServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = connectionServiceClient.setIamPolicy(resource, policy);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(ResourceName resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setPolicy(policy) + .build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = connectionServiceClient.setIamPolicy(resource.toString(), policy);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   Policy response = connectionServiceClient.setIamPolicy(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 Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   ApiFuture<Policy> future = connectionServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = connectionServiceClient.testIamPermissions(resource, permissions);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + ResourceName resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = connectionServiceClient.testIamPermissions(resource.toString(), permissions);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   TestIamPermissionsResponse response = connectionServiceClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   ApiFuture<TestIamPermissionsResponse> future = connectionServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceSettings.java b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceSettings.java new file mode 100644 index 00000000..4a983a81 --- /dev/null +++ b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceSettings.java @@ -0,0 +1,282 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR 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.bigquery.connection.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionCredentialRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.stub.ConnectionServiceStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +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 ConnectionServiceClient}. + * + *

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

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

+ * 
+ * ConnectionServiceSettings.Builder connectionServiceSettingsBuilder =
+ *     ConnectionServiceSettings.newBuilder();
+ * connectionServiceSettingsBuilder
+ *     .createConnectionSettings()
+ *     .setRetrySettings(
+ *         connectionServiceSettingsBuilder.createConnectionSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ConnectionServiceSettings connectionServiceSettings = connectionServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ConnectionServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createConnection. */ + public UnaryCallSettings createConnectionSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).createConnectionSettings(); + } + + /** Returns the object with the settings used for calls to getConnection. */ + public UnaryCallSettings getConnectionSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).getConnectionSettings(); + } + + /** Returns the object with the settings used for calls to listConnections. */ + public UnaryCallSettings + listConnectionsSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).listConnectionsSettings(); + } + + /** Returns the object with the settings used for calls to updateConnection. */ + public UnaryCallSettings updateConnectionSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).updateConnectionSettings(); + } + + /** Returns the object with the settings used for calls to updateConnectionCredential. */ + public UnaryCallSettings + updateConnectionCredentialSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).updateConnectionCredentialSettings(); + } + + /** Returns the object with the settings used for calls to deleteConnection. */ + public UnaryCallSettings deleteConnectionSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).deleteConnectionSettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final ConnectionServiceSettings create(ConnectionServiceStubSettings stub) + throws IOException { + return new ConnectionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ConnectionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ConnectionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ConnectionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ConnectionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ConnectionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ConnectionServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ConnectionServiceStubSettings.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 ConnectionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ConnectionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ConnectionServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ConnectionServiceStubSettings.newBuilder()); + } + + protected Builder(ConnectionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ConnectionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public ConnectionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ConnectionServiceStubSettings.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 createConnection. */ + public UnaryCallSettings.Builder + createConnectionSettings() { + return getStubSettingsBuilder().createConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to getConnection. */ + public UnaryCallSettings.Builder getConnectionSettings() { + return getStubSettingsBuilder().getConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to listConnections. */ + public UnaryCallSettings.Builder + listConnectionsSettings() { + return getStubSettingsBuilder().listConnectionsSettings(); + } + + /** Returns the builder for the settings used for calls to updateConnection. */ + public UnaryCallSettings.Builder + updateConnectionSettings() { + return getStubSettingsBuilder().updateConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to updateConnectionCredential. */ + public UnaryCallSettings.Builder + updateConnectionCredentialSettings() { + return getStubSettingsBuilder().updateConnectionCredentialSettings(); + } + + /** Returns the builder for the settings used for calls to deleteConnection. */ + public UnaryCallSettings.Builder deleteConnectionSettings() { + return getStubSettingsBuilder().deleteConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public ConnectionServiceSettings build() throws IOException { + return new ConnectionServiceSettings(this); + } + } +} diff --git a/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/package-info.java b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/package-info.java new file mode 100644 index 00000000..dfc46794 --- /dev/null +++ b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/package-info.java @@ -0,0 +1,42 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 BigQuery Connection API. + * + *

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

======================= ConnectionServiceClient ======================= + * + *

Service Description: Manages external data source connections and credentials. + * + *

Sample for ConnectionServiceClient: + * + *

+ * 
+ * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Connection connection = Connection.newBuilder().build();
+ *   String connectionId = "";
+ *   Connection response = connectionServiceClient.createConnection(parent, connection, connectionId);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.bigquery.connection.v1beta1; + +import javax.annotation.Generated; diff --git a/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStub.java b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStub.java new file mode 100644 index 00000000..3e46e264 --- /dev/null +++ b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStub.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.bigquery.connection.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionCredentialRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for BigQuery Connection 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 ConnectionServiceStub implements BackgroundResource { + + public UnaryCallable createConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: createConnectionCallable()"); + } + + public UnaryCallable getConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: getConnectionCallable()"); + } + + public UnaryCallable listConnectionsCallable() { + throw new UnsupportedOperationException("Not implemented: listConnectionsCallable()"); + } + + public UnaryCallable updateConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: updateConnectionCallable()"); + } + + public UnaryCallable + updateConnectionCredentialCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateConnectionCredentialCallable()"); + } + + public UnaryCallable deleteConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteConnectionCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStubSettings.java b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStubSettings.java new file mode 100644 index 00000000..f7bb470d --- /dev/null +++ b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStubSettings.java @@ -0,0 +1,490 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR 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.bigquery.connection.v1beta1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionCredentialRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +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 ConnectionServiceStub}. + * + *

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

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

+ * 
+ * ConnectionServiceStubSettings.Builder connectionServiceSettingsBuilder =
+ *     ConnectionServiceStubSettings.newBuilder();
+ * connectionServiceSettingsBuilder
+ *     .createConnectionSettings()
+ *     .setRetrySettings(
+ *         connectionServiceSettingsBuilder.createConnectionSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ConnectionServiceStubSettings connectionServiceSettings = connectionServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ConnectionServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/bigquery") + .add("https://www.googleapis.com/auth/cloud-platform") + .build(); + + private final UnaryCallSettings createConnectionSettings; + private final UnaryCallSettings getConnectionSettings; + private final UnaryCallSettings + listConnectionsSettings; + private final UnaryCallSettings updateConnectionSettings; + private final UnaryCallSettings + updateConnectionCredentialSettings; + private final UnaryCallSettings deleteConnectionSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + /** Returns the object with the settings used for calls to createConnection. */ + public UnaryCallSettings createConnectionSettings() { + return createConnectionSettings; + } + + /** Returns the object with the settings used for calls to getConnection. */ + public UnaryCallSettings getConnectionSettings() { + return getConnectionSettings; + } + + /** Returns the object with the settings used for calls to listConnections. */ + public UnaryCallSettings + listConnectionsSettings() { + return listConnectionsSettings; + } + + /** Returns the object with the settings used for calls to updateConnection. */ + public UnaryCallSettings updateConnectionSettings() { + return updateConnectionSettings; + } + + /** Returns the object with the settings used for calls to updateConnectionCredential. */ + public UnaryCallSettings + updateConnectionCredentialSettings() { + return updateConnectionCredentialSettings; + } + + /** Returns the object with the settings used for calls to deleteConnection. */ + public UnaryCallSettings deleteConnectionSettings() { + return deleteConnectionSettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ConnectionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcConnectionServiceStub.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 "bigqueryconnection.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(ConnectionServiceStubSettings.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 ConnectionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createConnectionSettings = settingsBuilder.createConnectionSettings().build(); + getConnectionSettings = settingsBuilder.getConnectionSettings().build(); + listConnectionsSettings = settingsBuilder.listConnectionsSettings().build(); + updateConnectionSettings = settingsBuilder.updateConnectionSettings().build(); + updateConnectionCredentialSettings = + settingsBuilder.updateConnectionCredentialSettings().build(); + deleteConnectionSettings = settingsBuilder.deleteConnectionSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for ConnectionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + createConnectionSettings; + private final UnaryCallSettings.Builder getConnectionSettings; + private final UnaryCallSettings.Builder + listConnectionsSettings; + private final UnaryCallSettings.Builder + updateConnectionSettings; + private final UnaryCallSettings.Builder + updateConnectionCredentialSettings; + private final UnaryCallSettings.Builder + deleteConnectionSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listConnectionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateConnectionCredentialSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createConnectionSettings, + getConnectionSettings, + listConnectionsSettings, + updateConnectionSettings, + updateConnectionCredentialSettings, + deleteConnectionSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + + 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 + .createConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listConnectionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateConnectionCredentialSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(ConnectionServiceStubSettings settings) { + super(settings); + + createConnectionSettings = settings.createConnectionSettings.toBuilder(); + getConnectionSettings = settings.getConnectionSettings.toBuilder(); + listConnectionsSettings = settings.listConnectionsSettings.toBuilder(); + updateConnectionSettings = settings.updateConnectionSettings.toBuilder(); + updateConnectionCredentialSettings = settings.updateConnectionCredentialSettings.toBuilder(); + deleteConnectionSettings = settings.deleteConnectionSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createConnectionSettings, + getConnectionSettings, + listConnectionsSettings, + updateConnectionSettings, + updateConnectionCredentialSettings, + deleteConnectionSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + } + + // 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 createConnection. */ + public UnaryCallSettings.Builder + createConnectionSettings() { + return createConnectionSettings; + } + + /** Returns the builder for the settings used for calls to getConnection. */ + public UnaryCallSettings.Builder getConnectionSettings() { + return getConnectionSettings; + } + + /** Returns the builder for the settings used for calls to listConnections. */ + public UnaryCallSettings.Builder + listConnectionsSettings() { + return listConnectionsSettings; + } + + /** Returns the builder for the settings used for calls to updateConnection. */ + public UnaryCallSettings.Builder + updateConnectionSettings() { + return updateConnectionSettings; + } + + /** Returns the builder for the settings used for calls to updateConnectionCredential. */ + public UnaryCallSettings.Builder + updateConnectionCredentialSettings() { + return updateConnectionCredentialSettings; + } + + /** Returns the builder for the settings used for calls to deleteConnection. */ + public UnaryCallSettings.Builder deleteConnectionSettings() { + return deleteConnectionSettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public ConnectionServiceStubSettings build() throws IOException { + return new ConnectionServiceStubSettings(this); + } + } +} diff --git a/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/GrpcConnectionServiceCallableFactory.java b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/GrpcConnectionServiceCallableFactory.java new file mode 100644 index 00000000..83d3a15f --- /dev/null +++ b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/GrpcConnectionServiceCallableFactory.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.bigquery.connection.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for BigQuery Connection 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 GrpcConnectionServiceCallableFactory 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-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/GrpcConnectionServiceStub.java b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/GrpcConnectionServiceStub.java new file mode 100644 index 00000000..5f40e7c6 --- /dev/null +++ b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/GrpcConnectionServiceStub.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. + */ +package com.google.cloud.bigquery.connection.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionCredentialRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +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 BigQuery Connection 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 GrpcConnectionServiceStub extends ConnectionServiceStub { + + private static final MethodDescriptor + createConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1beta1.ConnectionService/CreateConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Connection.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1beta1.ConnectionService/GetConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(GetConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Connection.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listConnectionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1beta1.ConnectionService/ListConnections") + .setRequestMarshaller( + ProtoUtils.marshaller(ListConnectionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListConnectionsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1beta1.ConnectionService/UpdateConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Connection.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateConnectionCredentialMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1beta1.ConnectionService/UpdateConnectionCredential") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateConnectionCredentialRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1beta1.ConnectionService/DeleteConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1beta1.ConnectionService/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1beta1.ConnectionService/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1beta1.ConnectionService/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable createConnectionCallable; + private final UnaryCallable getConnectionCallable; + private final UnaryCallable + listConnectionsCallable; + private final UnaryCallable updateConnectionCallable; + private final UnaryCallable + updateConnectionCredentialCallable; + private final UnaryCallable deleteConnectionCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcConnectionServiceStub create(ConnectionServiceStubSettings settings) + throws IOException { + return new GrpcConnectionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcConnectionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcConnectionServiceStub( + ConnectionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcConnectionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcConnectionServiceStub( + ConnectionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcConnectionServiceStub, 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 GrpcConnectionServiceStub( + ConnectionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcConnectionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcConnectionServiceStub, 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 GrpcConnectionServiceStub( + ConnectionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings createConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createConnectionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateConnectionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getConnectionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetConnectionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listConnectionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listConnectionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListConnectionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateConnectionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateConnectionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + updateConnectionCredentialTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateConnectionCredentialMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + UpdateConnectionCredentialRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteConnectionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteConnectionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TestIamPermissionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + + this.createConnectionCallable = + callableFactory.createUnaryCallable( + createConnectionTransportSettings, settings.createConnectionSettings(), clientContext); + this.getConnectionCallable = + callableFactory.createUnaryCallable( + getConnectionTransportSettings, settings.getConnectionSettings(), clientContext); + this.listConnectionsCallable = + callableFactory.createUnaryCallable( + listConnectionsTransportSettings, settings.listConnectionsSettings(), clientContext); + this.updateConnectionCallable = + callableFactory.createUnaryCallable( + updateConnectionTransportSettings, settings.updateConnectionSettings(), clientContext); + this.updateConnectionCredentialCallable = + callableFactory.createUnaryCallable( + updateConnectionCredentialTransportSettings, + settings.updateConnectionCredentialSettings(), + clientContext); + this.deleteConnectionCallable = + callableFactory.createUnaryCallable( + deleteConnectionTransportSettings, settings.deleteConnectionSettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable createConnectionCallable() { + return createConnectionCallable; + } + + public UnaryCallable getConnectionCallable() { + return getConnectionCallable; + } + + public UnaryCallable listConnectionsCallable() { + return listConnectionsCallable; + } + + public UnaryCallable updateConnectionCallable() { + return updateConnectionCallable; + } + + public UnaryCallable + updateConnectionCredentialCallable() { + return updateConnectionCredentialCallable; + } + + public UnaryCallable deleteConnectionCallable() { + return deleteConnectionCallable; + } + + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-bigquery-connection/src/test/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClientTest.java b/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClientTest.java new file mode 100644 index 00000000..6aa6a630 --- /dev/null +++ b/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClientTest.java @@ -0,0 +1,514 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR 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.bigquery.connection.v1beta1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionCredentialRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.UInt32Value; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +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 ConnectionServiceClientTest { + private static MockConnectionService mockConnectionService; + private static MockServiceHelper serviceHelper; + private ConnectionServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockConnectionService = new MockConnectionService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockConnectionService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + ConnectionServiceSettings settings = + ConnectionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ConnectionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createConnectionTest() { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + String friendlyName = "friendlyName1451097503"; + String description = "description-1724546052"; + long creationTime = 1932333101L; + long lastModifiedTime = 671513446L; + boolean hasCredential = true; + Connection expectedResponse = + Connection.newBuilder() + .setName(name.toString()) + .setFriendlyName(friendlyName) + .setDescription(description) + .setCreationTime(creationTime) + .setLastModifiedTime(lastModifiedTime) + .setHasCredential(hasCredential) + .build(); + mockConnectionService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId-513204708"; + + Connection actualResponse = client.createConnection(parent, connection, connectionId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateConnectionRequest actualRequest = (CreateConnectionRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(connection, actualRequest.getConnection()); + Assert.assertEquals(connectionId, actualRequest.getConnectionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId-513204708"; + + client.createConnection(parent, connection, connectionId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getConnectionTest() { + ConnectionName name2 = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + String friendlyName = "friendlyName1451097503"; + String description = "description-1724546052"; + long creationTime = 1932333101L; + long lastModifiedTime = 671513446L; + boolean hasCredential = true; + Connection expectedResponse = + Connection.newBuilder() + .setName(name2.toString()) + .setFriendlyName(friendlyName) + .setDescription(description) + .setCreationTime(creationTime) + .setLastModifiedTime(lastModifiedTime) + .setHasCredential(hasCredential) + .build(); + mockConnectionService.addResponse(expectedResponse); + + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + Connection actualResponse = client.getConnection(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConnectionRequest actualRequest = (GetConnectionRequest) actualRequests.get(0); + + Assert.assertEquals(name, ConnectionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + client.getConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listConnectionsTest() { + String nextPageToken = "nextPageToken-1530815211"; + ListConnectionsResponse expectedResponse = + ListConnectionsResponse.newBuilder().setNextPageToken(nextPageToken).build(); + mockConnectionService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + UInt32Value maxResults = UInt32Value.newBuilder().build(); + + ListConnectionsResponse actualResponse = client.listConnections(parent, maxResults); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListConnectionsRequest actualRequest = (ListConnectionsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(maxResults, actualRequest.getMaxResults()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listConnectionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + UInt32Value maxResults = UInt32Value.newBuilder().build(); + + client.listConnections(parent, maxResults); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateConnectionTest() { + ConnectionName name2 = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + String friendlyName = "friendlyName1451097503"; + String description = "description-1724546052"; + long creationTime = 1932333101L; + long lastModifiedTime = 671513446L; + boolean hasCredential = true; + Connection expectedResponse = + Connection.newBuilder() + .setName(name2.toString()) + .setFriendlyName(friendlyName) + .setDescription(description) + .setCreationTime(creationTime) + .setLastModifiedTime(lastModifiedTime) + .setHasCredential(hasCredential) + .build(); + mockConnectionService.addResponse(expectedResponse); + + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Connection connection = Connection.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Connection actualResponse = client.updateConnection(name, connection, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateConnectionRequest actualRequest = (UpdateConnectionRequest) actualRequests.get(0); + + Assert.assertEquals(name, ConnectionName.parse(actualRequest.getName())); + Assert.assertEquals(connection, actualRequest.getConnection()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Connection connection = Connection.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateConnection(name, connection, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateConnectionCredentialTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockConnectionService.addResponse(expectedResponse); + + String name = "name3373707"; + ConnectionCredential credential = ConnectionCredential.newBuilder().build(); + + client.updateConnectionCredential(name, credential); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateConnectionCredentialRequest actualRequest = + (UpdateConnectionCredentialRequest) actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(credential, actualRequest.getCredential()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateConnectionCredentialExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + String name = "name3373707"; + ConnectionCredential credential = ConnectionCredential.newBuilder().build(); + + client.updateConnectionCredential(name, credential); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteConnectionTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockConnectionService.addResponse(expectedResponse); + + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + client.deleteConnection(name); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteConnectionRequest actualRequest = (DeleteConnectionRequest) actualRequests.get(0); + + Assert.assertEquals(name, ConnectionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + client.deleteConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockConnectionService.addResponse(expectedResponse); + + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + GetPolicyOptions options = GetPolicyOptions.newBuilder().build(); + + Policy actualResponse = client.getIamPolicy(resource, options); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = (GetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(options, actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + GetPolicyOptions options = GetPolicyOptions.newBuilder().build(); + + client.getIamPolicy(resource, options); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockConnectionService.addResponse(expectedResponse); + + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = (SetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Policy policy = Policy.newBuilder().build(); + + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsTest() { + TestIamPermissionsResponse expectedResponse = TestIamPermissionsResponse.newBuilder().build(); + mockConnectionService.addResponse(expectedResponse); + + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = (TestIamPermissionsRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + List permissions = new ArrayList<>(); + + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigquery/connection/v1beta1/MockConnectionService.java b/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigquery/connection/v1beta1/MockConnectionService.java new file mode 100644 index 00000000..3761e27b --- /dev/null +++ b/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigquery/connection/v1beta1/MockConnectionService.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.bigquery.connection.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockConnectionService implements MockGrpcService { + private final MockConnectionServiceImpl serviceImpl; + + public MockConnectionService() { + serviceImpl = new MockConnectionServiceImpl(); + } + + @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-bigquery-connection/src/test/java/com/google/cloud/bigquery/connection/v1beta1/MockConnectionServiceImpl.java b/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigquery/connection/v1beta1/MockConnectionServiceImpl.java new file mode 100644 index 00000000..939a46a0 --- /dev/null +++ b/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigquery/connection/v1beta1/MockConnectionServiceImpl.java @@ -0,0 +1,206 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR 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.bigquery.connection.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionCredentialRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest; +import com.google.cloud.bigquery.connection.v1beta1.ConnectionServiceGrpc.ConnectionServiceImplBase; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +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 MockConnectionServiceImpl extends ConnectionServiceImplBase { + private List requests; + private Queue responses; + + public MockConnectionServiceImpl() { + 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 createConnection( + CreateConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Connection) { + requests.add(request); + responseObserver.onNext((Connection) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getConnection( + GetConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Connection) { + requests.add(request); + responseObserver.onNext((Connection) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listConnections( + ListConnectionsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListConnectionsResponse) { + requests.add(request); + responseObserver.onNext((ListConnectionsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateConnection( + UpdateConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Connection) { + requests.add(request); + responseObserver.onNext((Connection) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateConnectionCredential( + UpdateConnectionCredentialRequest 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 deleteConnection( + DeleteConnectionRequest 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 getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext((TestIamPermissionsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/grpc-google-cloud-bigquery-connection-v1beta1/pom.xml b/grpc-google-cloud-bigquery-connection-v1beta1/pom.xml new file mode 100644 index 00000000..10311da1 --- /dev/null +++ b/grpc-google-cloud-bigquery-connection-v1beta1/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-bigquery-connection-v1beta1 + 0.0.1-SNAPSHOT + grpc-google-cloud-bigquery-connection-v1beta1 + GRPC library for grpc-google-cloud-bigquery-connection-v1beta1 + + com.google.cloud + google-cloud-bigquery-connection-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-bigquery-connection-v1beta1 + + + 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-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceGrpc.java b/grpc-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceGrpc.java new file mode 100644 index 00000000..16d093ef --- /dev/null +++ b/grpc-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceGrpc.java @@ -0,0 +1,1408 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR 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.bigquery.connection.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Manages external data source connections and credentials.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/bigquery/connection/v1beta1/connection.proto") +public final class ConnectionServiceGrpc { + + private ConnectionServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.bigquery.connection.v1beta1.ConnectionService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + getCreateConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateConnection", + requestType = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + .class, + responseType = com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + getCreateConnectionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + getCreateConnectionMethod; + if ((getCreateConnectionMethod = ConnectionServiceGrpc.getCreateConnectionMethod) == null) { + synchronized (ConnectionServiceGrpc.class) { + if ((getCreateConnectionMethod = ConnectionServiceGrpc.getCreateConnectionMethod) == null) { + ConnectionServiceGrpc.getCreateConnectionMethod = + getCreateConnectionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .Connection.getDefaultInstance())) + .setSchemaDescriptor( + new ConnectionServiceMethodDescriptorSupplier("CreateConnection")) + .build(); + } + } + } + return getCreateConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + getGetConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConnection", + requestType = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest.class, + responseType = com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + getGetConnectionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + getGetConnectionMethod; + if ((getGetConnectionMethod = ConnectionServiceGrpc.getGetConnectionMethod) == null) { + synchronized (ConnectionServiceGrpc.class) { + if ((getGetConnectionMethod = ConnectionServiceGrpc.getGetConnectionMethod) == null) { + ConnectionServiceGrpc.getGetConnectionMethod = + getGetConnectionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .GetConnectionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .Connection.getDefaultInstance())) + .setSchemaDescriptor( + new ConnectionServiceMethodDescriptorSupplier("GetConnection")) + .build(); + } + } + } + return getGetConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse> + getListConnectionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListConnections", + requestType = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest.class, + responseType = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + .class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse> + getListConnectionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse> + getListConnectionsMethod; + if ((getListConnectionsMethod = ConnectionServiceGrpc.getListConnectionsMethod) == null) { + synchronized (ConnectionServiceGrpc.class) { + if ((getListConnectionsMethod = ConnectionServiceGrpc.getListConnectionsMethod) == null) { + ConnectionServiceGrpc.getListConnectionsMethod = + getListConnectionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListConnections")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ConnectionServiceMethodDescriptorSupplier("ListConnections")) + .build(); + } + } + } + return getListConnectionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + getUpdateConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateConnection", + requestType = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + .class, + responseType = com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + getUpdateConnectionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + getUpdateConnectionMethod; + if ((getUpdateConnectionMethod = ConnectionServiceGrpc.getUpdateConnectionMethod) == null) { + synchronized (ConnectionServiceGrpc.class) { + if ((getUpdateConnectionMethod = ConnectionServiceGrpc.getUpdateConnectionMethod) == null) { + ConnectionServiceGrpc.getUpdateConnectionMethod = + getUpdateConnectionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .Connection.getDefaultInstance())) + .setSchemaDescriptor( + new ConnectionServiceMethodDescriptorSupplier("UpdateConnection")) + .build(); + } + } + } + return getUpdateConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest, + com.google.protobuf.Empty> + getUpdateConnectionCredentialMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateConnectionCredential", + requestType = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest, + com.google.protobuf.Empty> + getUpdateConnectionCredentialMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest, + com.google.protobuf.Empty> + getUpdateConnectionCredentialMethod; + if ((getUpdateConnectionCredentialMethod = + ConnectionServiceGrpc.getUpdateConnectionCredentialMethod) + == null) { + synchronized (ConnectionServiceGrpc.class) { + if ((getUpdateConnectionCredentialMethod = + ConnectionServiceGrpc.getUpdateConnectionCredentialMethod) + == null) { + ConnectionServiceGrpc.getUpdateConnectionCredentialMethod = + getUpdateConnectionCredentialMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateConnectionCredential")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ConnectionServiceMethodDescriptorSupplier( + "UpdateConnectionCredential")) + .build(); + } + } + } + return getUpdateConnectionCredentialMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest, + com.google.protobuf.Empty> + getDeleteConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteConnection", + requestType = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + .class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest, + com.google.protobuf.Empty> + getDeleteConnectionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest, + com.google.protobuf.Empty> + getDeleteConnectionMethod; + if ((getDeleteConnectionMethod = ConnectionServiceGrpc.getDeleteConnectionMethod) == null) { + synchronized (ConnectionServiceGrpc.class) { + if ((getDeleteConnectionMethod = ConnectionServiceGrpc.getDeleteConnectionMethod) == null) { + ConnectionServiceGrpc.getDeleteConnectionMethod = + getDeleteConnectionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ConnectionServiceMethodDescriptorSupplier("DeleteConnection")) + .build(); + } + } + } + return getDeleteConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetIamPolicy", + requestType = com.google.iam.v1.GetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = ConnectionServiceGrpc.getGetIamPolicyMethod) == null) { + synchronized (ConnectionServiceGrpc.class) { + if ((getGetIamPolicyMethod = ConnectionServiceGrpc.getGetIamPolicyMethod) == null) { + ConnectionServiceGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new ConnectionServiceMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetIamPolicy", + requestType = com.google.iam.v1.SetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = ConnectionServiceGrpc.getSetIamPolicyMethod) == null) { + synchronized (ConnectionServiceGrpc.class) { + if ((getSetIamPolicyMethod = ConnectionServiceGrpc.getSetIamPolicyMethod) == null) { + ConnectionServiceGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new ConnectionServiceMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TestIamPermissions", + requestType = com.google.iam.v1.TestIamPermissionsRequest.class, + responseType = com.google.iam.v1.TestIamPermissionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = ConnectionServiceGrpc.getTestIamPermissionsMethod) == null) { + synchronized (ConnectionServiceGrpc.class) { + if ((getTestIamPermissionsMethod = ConnectionServiceGrpc.getTestIamPermissionsMethod) + == null) { + ConnectionServiceGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ConnectionServiceMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ConnectionServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConnectionServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConnectionServiceStub(channel, callOptions); + } + }; + return ConnectionServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ConnectionServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConnectionServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConnectionServiceBlockingStub(channel, callOptions); + } + }; + return ConnectionServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ConnectionServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConnectionServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConnectionServiceFutureStub(channel, callOptions); + } + }; + return ConnectionServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Manages external data source connections and credentials.
+   * 
+ */ + public abstract static class ConnectionServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a new connection.
+     * 
+ */ + public void createConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + responseObserver) { + asyncUnimplementedUnaryCall(getCreateConnectionMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns specified connection.
+     * 
+ */ + public void getConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + responseObserver) { + asyncUnimplementedUnaryCall(getGetConnectionMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a list of connections in the given project.
+     * 
+ */ + public void listConnections( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListConnectionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the specified connection. For security reasons, also resets
+     * credential if connection properties are in the update field mask.
+     * 
+ */ + public void updateConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateConnectionMethod(), responseObserver); + } + + /** + * + * + *
+     * Sets the credential for the specified connection.
+     * 
+ */ + public void updateConnectionCredential( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateConnectionCredentialMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes connection and associated credential.
+     * 
+ */ + public void deleteConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteConnectionMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the access control policy for a resource.
+     * Returns an empty policy if the resource exists and does not have a policy
+     * set.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Sets the access control policy on the specified resource. Replaces any
+     * existing policy.
+     * Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getSetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns permissions that a caller has on the specified resource.
+     * If the resource does not exist, this will return an empty set of
+     * permissions, not a NOT_FOUND error.
+     * Note: This operation is designed to be used for building permission-aware
+     * UIs and command-line tools, not for authorization checking. This operation
+     * may "fail open" without warning.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getTestIamPermissionsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateConnectionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection>( + this, METHODID_CREATE_CONNECTION))) + .addMethod( + getGetConnectionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .GetConnectionRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection>( + this, METHODID_GET_CONNECTION))) + .addMethod( + getListConnectionsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse>(this, METHODID_LIST_CONNECTIONS))) + .addMethod( + getUpdateConnectionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection>( + this, METHODID_UPDATE_CONNECTION))) + .addMethod( + getUpdateConnectionCredentialMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest, + com.google.protobuf.Empty>(this, METHODID_UPDATE_CONNECTION_CREDENTIAL))) + .addMethod( + getDeleteConnectionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_CONNECTION))) + .addMethod( + getGetIamPolicyMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_GET_IAM_POLICY))) + .addMethod( + getSetIamPolicyMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_SET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + this, METHODID_TEST_IAM_PERMISSIONS))) + .build(); + } + } + + /** + * + * + *
+   * Manages external data source connections and credentials.
+   * 
+ */ + public static final class ConnectionServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private ConnectionServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConnectionServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConnectionServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new connection.
+     * 
+ */ + public void createConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateConnectionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns specified connection.
+     * 
+ */ + public void getConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetConnectionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a list of connections in the given project.
+     * 
+ */ + public void listConnections( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListConnectionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the specified connection. For security reasons, also resets
+     * credential if connection properties are in the update field mask.
+     * 
+ */ + public void updateConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + request, + io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateConnectionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Sets the credential for the specified connection.
+     * 
+ */ + public void updateConnectionCredential( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateConnectionCredentialMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes connection and associated credential.
+     * 
+ */ + public void deleteConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteConnectionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the access control policy for a resource.
+     * Returns an empty policy if the resource exists and does not have a policy
+     * set.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Sets the access control policy on the specified resource. Replaces any
+     * existing policy.
+     * Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns permissions that a caller has on the specified resource.
+     * If the resource does not exist, this will return an empty set of
+     * permissions, not a NOT_FOUND error.
+     * Note: This operation is designed to be used for building permission-aware
+     * UIs and command-line tools, not for authorization checking. This operation
+     * may "fail open" without warning.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Manages external data source connections and credentials.
+   * 
+ */ + public static final class ConnectionServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ConnectionServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConnectionServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConnectionServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new connection.
+     * 
+ */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection createConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + request) { + return blockingUnaryCall( + getChannel(), getCreateConnectionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns specified connection.
+     * 
+ */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest request) { + return blockingUnaryCall(getChannel(), getGetConnectionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a list of connections in the given project.
+     * 
+ */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + listConnections( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + request) { + return blockingUnaryCall(getChannel(), getListConnectionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified connection. For security reasons, also resets
+     * credential if connection properties are in the update field mask.
+     * 
+ */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection updateConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + request) { + return blockingUnaryCall( + getChannel(), getUpdateConnectionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sets the credential for the specified connection.
+     * 
+ */ + public com.google.protobuf.Empty updateConnectionCredential( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + request) { + return blockingUnaryCall( + getChannel(), getUpdateConnectionCredentialMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes connection and associated credential.
+     * 
+ */ + public com.google.protobuf.Empty deleteConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + request) { + return blockingUnaryCall( + getChannel(), getDeleteConnectionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the access control policy for a resource.
+     * Returns an empty policy if the resource exists and does not have a policy
+     * set.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return blockingUnaryCall(getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sets the access control policy on the specified resource. Replaces any
+     * existing policy.
+     * Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return blockingUnaryCall(getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns permissions that a caller has on the specified resource.
+     * If the resource does not exist, this will return an empty set of
+     * permissions, not a NOT_FOUND error.
+     * Note: This operation is designed to be used for building permission-aware
+     * UIs and command-line tools, not for authorization checking. This operation
+     * may "fail open" without warning.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return blockingUnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Manages external data source connections and credentials.
+   * 
+ */ + public static final class ConnectionServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ConnectionServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConnectionServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConnectionServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new connection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + createConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + request) { + return futureUnaryCall( + getChannel().newCall(getCreateConnectionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns specified connection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + getConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + request) { + return futureUnaryCall( + getChannel().newCall(getGetConnectionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a list of connections in the given project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse> + listConnections( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + request) { + return futureUnaryCall( + getChannel().newCall(getListConnectionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the specified connection. For security reasons, also resets
+     * credential if connection properties are in the update field mask.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + updateConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + request) { + return futureUnaryCall( + getChannel().newCall(getUpdateConnectionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Sets the credential for the specified connection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateConnectionCredential( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + request) { + return futureUnaryCall( + getChannel().newCall(getUpdateConnectionCredentialMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes connection and associated credential.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + request) { + return futureUnaryCall( + getChannel().newCall(getDeleteConnectionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the access control policy for a resource.
+     * Returns an empty policy if the resource exists and does not have a policy
+     * set.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Sets the access control policy on the specified resource. Replaces any
+     * existing policy.
+     * Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns permissions that a caller has on the specified resource.
+     * If the resource does not exist, this will return an empty set of
+     * permissions, not a NOT_FOUND error.
+     * Note: This operation is designed to be used for building permission-aware
+     * UIs and command-line tools, not for authorization checking. This operation
+     * may "fail open" without warning.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_CONNECTION = 0; + private static final int METHODID_GET_CONNECTION = 1; + private static final int METHODID_LIST_CONNECTIONS = 2; + private static final int METHODID_UPDATE_CONNECTION = 3; + private static final int METHODID_UPDATE_CONNECTION_CREDENTIAL = 4; + private static final int METHODID_DELETE_CONNECTION = 5; + private static final int METHODID_GET_IAM_POLICY = 6; + private static final int METHODID_SET_IAM_POLICY = 7; + private static final int METHODID_TEST_IAM_PERMISSIONS = 8; + + 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 ConnectionServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ConnectionServiceImplBase 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_CONNECTION: + serviceImpl.createConnection( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection>) + responseObserver); + break; + case METHODID_GET_CONNECTION: + serviceImpl.getConnection( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection>) + responseObserver); + break; + case METHODID_LIST_CONNECTIONS: + serviceImpl.listConnections( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse>) + responseObserver); + break; + case METHODID_UPDATE_CONNECTION: + serviceImpl.updateConnection( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection>) + responseObserver); + break; + case METHODID_UPDATE_CONNECTION_CREDENTIAL: + serviceImpl.updateConnectionCredential( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest) + request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_CONNECTION: + serviceImpl.deleteConnection( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest) + request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) 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 ConnectionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ConnectionServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ConnectionService"); + } + } + + private static final class ConnectionServiceFileDescriptorSupplier + extends ConnectionServiceBaseDescriptorSupplier { + ConnectionServiceFileDescriptorSupplier() {} + } + + private static final class ConnectionServiceMethodDescriptorSupplier + extends ConnectionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ConnectionServiceMethodDescriptorSupplier(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 (ConnectionServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ConnectionServiceFileDescriptorSupplier()) + .addMethod(getCreateConnectionMethod()) + .addMethod(getGetConnectionMethod()) + .addMethod(getListConnectionsMethod()) + .addMethod(getUpdateConnectionMethod()) + .addMethod(getUpdateConnectionCredentialMethod()) + .addMethod(getDeleteConnectionMethod()) + .addMethod(getGetIamPolicyMethod()) + .addMethod(getSetIamPolicyMethod()) + .addMethod(getTestIamPermissionsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java.header b/java.header new file mode 100644 index 00000000..3a9b503a --- /dev/null +++ b/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \*$ +^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ +^ \* you may not use this file except in compliance with the License\.$ +^ \* You may obtain a copy of the License at$ +^ \*$ +^ \*[ ]+https?://www.apache.org/licenses/LICENSE-2\.0$ +^ \*$ +^ \* Unless required by applicable law or agreed to in writing, software$ +^ \* distributed under the License is distributed on an "AS IS" BASIS,$ +^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$ +^ \* See the License for the specific language governing permissions and$ +^ \* limitations under the License\.$ +^ \*/$ diff --git a/license-checks.xml b/license-checks.xml new file mode 100644 index 00000000..6597fced --- /dev/null +++ b/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..e7a5fb01 --- /dev/null +++ b/pom.xml @@ -0,0 +1,186 @@ + + + 4.0.0 + com.google.cloud + google-cloud-bigquery-connection-parent + pom + 0.0.1-SNAPSHOT + Google Cloud BigQuery Connections Parent + https://github.com/googleapis/java-bigquery-connection + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.5.0 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-bigquery-connection.git + scm:git:git@github.com:googleapis/java-bigquery-connection.git + https://github.com/googleapis/java-bigquery-connection + HEAD + + + https://github.com/googleapis/java-bigquery-connection/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-bigquery-connection-parent + + + + + + com.google.cloud + google-cloud-bigquery-connection + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-bigquery-connection-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-bigquery-connection-v1beta1 + 0.0.1-SNAPSHOT + + + + com.google.cloud + google-cloud-shared-dependencies + 0.1.1 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + org.objenesis:objenesis + + + + + + + + google-cloud-bigquery-connection + proto-google-cloud-bigquery-connection-v1beta1 + grpc-google-cloud-bigquery-connection-v1beta1 + google-cloud-bigquery-connection-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + + html + + aggregate + javadoc + + + + + none + protected + true + ${project.build.directory}/javadoc + + + Test helpers packages + com.google.cloud.testing + + + SPI packages + com.google.cloud.spi* + + + + + https://grpc.io/grpc-java/javadoc/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://googleapis.dev/java/google-auth-library/latest/ + https://googleapis.dev/java/gax/latest/ + https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ + + + + + + \ No newline at end of file diff --git a/proto-google-cloud-bigquery-connection-v1beta1/pom.xml b/proto-google-cloud-bigquery-connection-v1beta1/pom.xml new file mode 100644 index 00000000..49919bf9 --- /dev/null +++ b/proto-google-cloud-bigquery-connection-v1beta1/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-bigquery-connection-v1beta1 + 0.0.1-SNAPSHOT + proto-google-cloud-bigquery-connection-v1beta1 + PROTO library for proto-google-cloud-bigquery-connection-v1beta1 + + com.google.cloud + google-cloud-bigquery-connection-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-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionName.java b/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionName.java new file mode 100644 index 00000000..2cbfc2f8 --- /dev/null +++ b/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR 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.bigquery.connection.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ConnectionName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/connections/{connection}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String connection; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getConnection() { + return connection; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ConnectionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + connection = Preconditions.checkNotNull(builder.getConnection()); + } + + public static ConnectionName of(String project, String location, String connection) { + return newBuilder().setProject(project).setLocation(location).setConnection(connection).build(); + } + + public static String format(String project, String location, String connection) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setConnection(connection) + .build() + .toString(); + } + + public static ConnectionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ConnectionName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("connection")); + } + + 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 (ConnectionName 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("connection", connection); + 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, "connection", connection); + } + + /** Builder for ConnectionName. */ + public static class Builder { + + private String project; + private String location; + private String connection; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getConnection() { + return connection; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setConnection(String connection) { + this.connection = connection; + return this; + } + + private Builder() {} + + private Builder(ConnectionName connectionName) { + project = connectionName.project; + location = connectionName.location; + connection = connectionName.connection; + } + + public ConnectionName build() { + return new ConnectionName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ConnectionName) { + ConnectionName that = (ConnectionName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.connection.equals(that.connection)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= connection.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionProto.java b/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionProto.java new file mode 100644 index 00000000..ac4e744f --- /dev/null +++ b/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionProto.java @@ -0,0 +1,13395 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1beta1/connection.proto + +package com.google.cloud.bigquery.connection.v1beta1; + +public final class ConnectionProto { + private ConnectionProto() {} + + 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 interface CreateConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.CreateConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Parent resource name.
+     * Must be in the 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. Parent resource name.
+     * Must be in the 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(); + + /** + * + * + *
+     * Optional. Connection id that should be assigned to the created connection.
+     * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The connectionId. + */ + java.lang.String getConnectionId(); + /** + * + * + *
+     * Optional. Connection id that should be assigned to the created connection.
+     * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for connectionId. + */ + com.google.protobuf.ByteString getConnectionIdBytes(); + + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + boolean hasConnection(); + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnection(); + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder + getConnectionOrBuilder(); + } + /** + * + * + *
+   * The request for [ConnectionService.CreateConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.CreateConnection].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.CreateConnectionRequest} + */ + public static final class CreateConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.CreateConnectionRequest) + CreateConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateConnectionRequest.newBuilder() to construct. + private CreateConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateConnectionRequest() { + parent_ = ""; + connectionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateConnectionRequest( + 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(); + + connectionId_ = s; + break; + } + case 26: + { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder + subBuilder = null; + if (connection_ != null) { + subBuilder = connection_.toBuilder(); + } + connection_ = + input.readMessage( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(connection_); + connection_ = 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.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + .Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+     * Required. Parent resource name.
+     * Must be in the 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) { + 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. Parent resource name.
+     * Must be in the 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 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 CONNECTION_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object connectionId_; + /** + * + * + *
+     * Optional. Connection id that should be assigned to the created connection.
+     * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The connectionId. + */ + public java.lang.String getConnectionId() { + java.lang.Object ref = connectionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionId_ = s; + return s; + } + } + /** + * + * + *
+     * Optional. Connection id that should be assigned to the created connection.
+     * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for connectionId. + */ + public com.google.protobuf.ByteString getConnectionIdBytes() { + java.lang.Object ref = connectionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONNECTION_FIELD_NUMBER = 3; + private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection connection_; + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + public boolean hasConnection() { + return connection_ != null; + } + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnection() { + return connection_ == null + ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + .getDefaultInstance() + : connection_; + } + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder + getConnectionOrBuilder() { + return getConnection(); + } + + 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 (!getConnectionIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, connectionId_); + } + if (connection_ != null) { + output.writeMessage(3, getConnection()); + } + 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 (!getConnectionIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, connectionId_); + } + if (connection_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getConnection()); + } + 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.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest other = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest) + obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getConnectionId().equals(other.getConnectionId())) return false; + if (hasConnection() != other.hasConnection()) return false; + if (hasConnection()) { + if (!getConnection().equals(other.getConnection())) 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) + CONNECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getConnectionId().hashCode(); + if (hasConnection()) { + hash = (37 * hash) + CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getConnection().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest + 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.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + 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 for [ConnectionService.CreateConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.CreateConnection].
+     * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.CreateConnectionRequest} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.CreateConnectionRequest) + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + .Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest.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_ = ""; + + connectionId_ = ""; + + if (connectionBuilder_ == null) { + connection_ = null; + } else { + connection_ = null; + connectionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + build() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + buildPartial() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + result = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest(this); + result.parent_ = parent_; + result.connectionId_ = connectionId_; + if (connectionBuilder_ == null) { + result.connection_ = connection_; + } else { + result.connection_ = connectionBuilder_.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.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest) { + return mergeFrom( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + other) { + if (other + == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getConnectionId().isEmpty()) { + connectionId_ = other.connectionId_; + onChanged(); + } + if (other.hasConnection()) { + mergeConnection(other.getConnection()); + } + 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.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+       * Required. Parent resource name.
+       * Must be in the 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. Parent resource name.
+       * Must be in the 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. Parent resource name.
+       * Must be in the 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. Parent resource name.
+       * Must be in the 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. Parent resource name.
+       * Must be in the 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 java.lang.Object connectionId_ = ""; + /** + * + * + *
+       * Optional. Connection id that should be assigned to the created connection.
+       * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The connectionId. + */ + public java.lang.String getConnectionId() { + java.lang.Object ref = connectionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Optional. Connection id that should be assigned to the created connection.
+       * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for connectionId. + */ + public com.google.protobuf.ByteString getConnectionIdBytes() { + java.lang.Object ref = connectionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Optional. Connection id that should be assigned to the created connection.
+       * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The connectionId to set. + * @return This builder for chaining. + */ + public Builder setConnectionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + connectionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Connection id that should be assigned to the created connection.
+       * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearConnectionId() { + + connectionId_ = getDefaultInstance().getConnectionId(); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Connection id that should be assigned to the created connection.
+       * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for connectionId to set. + * @return This builder for chaining. + */ + public Builder setConnectionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + connectionId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection connection_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> + connectionBuilder_; + /** + * + * + *
+       * Required. Connection to create.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + public boolean hasConnection() { + return connectionBuilder_ != null || connection_ != null; + } + /** + * + * + *
+       * Required. Connection to create.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + getConnection() { + if (connectionBuilder_ == null) { + return connection_ == null + ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + .getDefaultInstance() + : connection_; + } else { + return connectionBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Connection to create.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection value) { + if (connectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connection_ = value; + onChanged(); + } else { + connectionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. Connection to create.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder + builderForValue) { + if (connectionBuilder_ == null) { + connection_ = builderForValue.build(); + onChanged(); + } else { + connectionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. Connection to create.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection value) { + if (connectionBuilder_ == null) { + if (connection_ != null) { + connection_ = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.newBuilder( + connection_) + .mergeFrom(value) + .buildPartial(); + } else { + connection_ = value; + } + onChanged(); + } else { + connectionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. Connection to create.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConnection() { + if (connectionBuilder_ == null) { + connection_ = null; + onChanged(); + } else { + connection_ = null; + connectionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. Connection to create.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder + getConnectionBuilder() { + + onChanged(); + return getConnectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Connection to create.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder + getConnectionOrBuilder() { + if (connectionBuilder_ != null) { + return connectionBuilder_.getMessageOrBuilder(); + } else { + return connection_ == null + ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + .getDefaultInstance() + : connection_; + } + } + /** + * + * + *
+       * Required. Connection to create.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> + getConnectionFieldBuilder() { + if (connectionBuilder_ == null) { + connectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder>( + getConnection(), getParentForChildren(), isClean()); + connection_ = null; + } + return connectionBuilder_; + } + + @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.bigquery.connection.v1beta1.CreateConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.CreateConnectionRequest) + private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest(); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CreateConnectionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateConnectionRequest(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.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface GetConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.GetConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Name of the requested connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * Required. Name of the requested connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + } + /** + * + * + *
+   * The request for [ConnectionService.GetConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.GetConnection].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.GetConnectionRequest} + */ + public static final class GetConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.GetConnectionRequest) + GetConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetConnectionRequest.newBuilder() to construct. + private GetConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetConnectionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetConnectionRequest( + 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.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + .Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * Required. Name of the requested connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_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) { + 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. Name of the requested connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_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 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.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest other = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest) 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.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + 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.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + 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 for [ConnectionService.GetConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.GetConnection].
+     * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.GetConnectionRequest} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.GetConnectionRequest) + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + .Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest.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.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + build() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + buildPartial() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest result = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest( + 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.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest) { + return mergeFrom( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest other) { + if (other + == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + .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.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * Required. Name of the requested connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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. Name of the requested connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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. Name of the requested connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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. Name of the requested connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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. Name of the requested connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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.bigquery.connection.v1beta1.GetConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.GetConnectionRequest) + private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .GetConnectionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest(); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetConnectionRequest(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.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ListConnectionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.ListConnectionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Parent resource name.
+     * Must be in the form: `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. Parent resource name.
+     * Must be in the form: `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. Maximum number of results per page.
+     * 
+ * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the maxResults field is set. + */ + boolean hasMaxResults(); + /** + * + * + *
+     * Required. Maximum number of results per page.
+     * 
+ * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The maxResults. + */ + com.google.protobuf.UInt32Value getMaxResults(); + /** + * + * + *
+     * Required. Maximum number of results per page.
+     * 
+ * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.UInt32ValueOrBuilder getMaxResultsOrBuilder(); + + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + } + /** + * + * + *
+   * The request for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1beta1.ConnectionService.ListConnections].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.ListConnectionsRequest} + */ + public static final class ListConnectionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.ListConnectionsRequest) + ListConnectionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListConnectionsRequest.newBuilder() to construct. + private ListConnectionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListConnectionsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListConnectionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListConnectionsRequest( + 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.protobuf.UInt32Value.Builder subBuilder = null; + if (maxResults_ != null) { + subBuilder = maxResults_.toBuilder(); + } + maxResults_ = + input.readMessage(com.google.protobuf.UInt32Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(maxResults_); + maxResults_ = subBuilder.buildPartial(); + } + + 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.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + .Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+     * Required. Parent resource name.
+     * Must be in the form: `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) { + 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. Parent resource name.
+     * Must be in the form: `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 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 MAX_RESULTS_FIELD_NUMBER = 2; + private com.google.protobuf.UInt32Value maxResults_; + /** + * + * + *
+     * Required. Maximum number of results per page.
+     * 
+ * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the maxResults field is set. + */ + public boolean hasMaxResults() { + return maxResults_ != null; + } + /** + * + * + *
+     * Required. Maximum number of results per page.
+     * 
+ * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The maxResults. + */ + public com.google.protobuf.UInt32Value getMaxResults() { + return maxResults_ == null + ? com.google.protobuf.UInt32Value.getDefaultInstance() + : maxResults_; + } + /** + * + * + *
+     * Required. Maximum number of results per page.
+     * 
+ * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.UInt32ValueOrBuilder getMaxResultsOrBuilder() { + return getMaxResults(); + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (maxResults_ != null) { + output.writeMessage(2, getMaxResults()); + } + 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 (maxResults_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMaxResults()); + } + 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.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest other = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasMaxResults() != other.hasMaxResults()) return false; + if (hasMaxResults()) { + if (!getMaxResults().equals(other.getMaxResults())) 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(); + if (hasMaxResults()) { + hash = (37 * hash) + MAX_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getMaxResults().hashCode(); + } + 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.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest + 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.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + 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 for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1beta1.ConnectionService.ListConnections].
+     * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.ListConnectionsRequest} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.ListConnectionsRequest) + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + .Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest.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 (maxResultsBuilder_ == null) { + maxResults_ = null; + } else { + maxResults_ = null; + maxResultsBuilder_ = null; + } + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + build() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + buildPartial() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest result = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest( + this); + result.parent_ = parent_; + if (maxResultsBuilder_ == null) { + result.maxResults_ = maxResults_; + } else { + result.maxResults_ = maxResultsBuilder_.build(); + } + 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.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest) { + return mergeFrom( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + other) { + if (other + == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasMaxResults()) { + mergeMaxResults(other.getMaxResults()); + } + 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.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+       * Required. Parent resource name.
+       * Must be in the form: `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. Parent resource name.
+       * Must be in the form: `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. Parent resource name.
+       * Must be in the form: `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. Parent resource name.
+       * Must be in the form: `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. Parent resource name.
+       * Must be in the form: `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.protobuf.UInt32Value maxResults_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.UInt32Value, + com.google.protobuf.UInt32Value.Builder, + com.google.protobuf.UInt32ValueOrBuilder> + maxResultsBuilder_; + /** + * + * + *
+       * Required. Maximum number of results per page.
+       * 
+ * + * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the maxResults field is set. + */ + public boolean hasMaxResults() { + return maxResultsBuilder_ != null || maxResults_ != null; + } + /** + * + * + *
+       * Required. Maximum number of results per page.
+       * 
+ * + * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The maxResults. + */ + public com.google.protobuf.UInt32Value getMaxResults() { + if (maxResultsBuilder_ == null) { + return maxResults_ == null + ? com.google.protobuf.UInt32Value.getDefaultInstance() + : maxResults_; + } else { + return maxResultsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Maximum number of results per page.
+       * 
+ * + * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMaxResults(com.google.protobuf.UInt32Value value) { + if (maxResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxResults_ = value; + onChanged(); + } else { + maxResultsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. Maximum number of results per page.
+       * 
+ * + * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMaxResults(com.google.protobuf.UInt32Value.Builder builderForValue) { + if (maxResultsBuilder_ == null) { + maxResults_ = builderForValue.build(); + onChanged(); + } else { + maxResultsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. Maximum number of results per page.
+       * 
+ * + * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeMaxResults(com.google.protobuf.UInt32Value value) { + if (maxResultsBuilder_ == null) { + if (maxResults_ != null) { + maxResults_ = + com.google.protobuf.UInt32Value.newBuilder(maxResults_) + .mergeFrom(value) + .buildPartial(); + } else { + maxResults_ = value; + } + onChanged(); + } else { + maxResultsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. Maximum number of results per page.
+       * 
+ * + * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearMaxResults() { + if (maxResultsBuilder_ == null) { + maxResults_ = null; + onChanged(); + } else { + maxResults_ = null; + maxResultsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. Maximum number of results per page.
+       * 
+ * + * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.UInt32Value.Builder getMaxResultsBuilder() { + + onChanged(); + return getMaxResultsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Maximum number of results per page.
+       * 
+ * + * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.UInt32ValueOrBuilder getMaxResultsOrBuilder() { + if (maxResultsBuilder_ != null) { + return maxResultsBuilder_.getMessageOrBuilder(); + } else { + return maxResults_ == null + ? com.google.protobuf.UInt32Value.getDefaultInstance() + : maxResults_; + } + } + /** + * + * + *
+       * Required. Maximum number of results per page.
+       * 
+ * + * + * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.UInt32Value, + com.google.protobuf.UInt32Value.Builder, + com.google.protobuf.UInt32ValueOrBuilder> + getMaxResultsFieldBuilder() { + if (maxResultsBuilder_ == null) { + maxResultsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.UInt32Value, + com.google.protobuf.UInt32Value.Builder, + com.google.protobuf.UInt32ValueOrBuilder>( + getMaxResults(), getParentForChildren(), isClean()); + maxResults_ = null; + } + return maxResultsBuilder_; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+       * Page token.
+       * 
+ * + * 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; + } + } + /** + * + * + *
+       * Page token.
+       * 
+ * + * 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; + } + } + /** + * + * + *
+       * Page token.
+       * 
+ * + * 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; + } + /** + * + * + *
+       * Page token.
+       * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+       * Page token.
+       * 
+ * + * 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.bigquery.connection.v1beta1.ListConnectionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.ListConnectionsRequest) + private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest(); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListConnectionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListConnectionsRequest(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.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ListConnectionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 1; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 1; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + java.util.List + getConnectionsList(); + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnections( + int index); + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + int getConnectionsCount(); + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + java.util.List< + ? extends + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> + getConnectionsOrBuilderList(); + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder + getConnectionsOrBuilder(int index); + } + /** + * + * + *
+   * The response for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1beta1.ConnectionService.ListConnections].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse} + */ + public static final class ListConnectionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse) + ListConnectionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListConnectionsResponse.newBuilder() to construct. + private ListConnectionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListConnectionsResponse() { + nextPageToken_ = ""; + connections_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListConnectionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListConnectionsResponse( + 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(); + + nextPageToken_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + connections_ = + new java.util.ArrayList< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .Connection>(); + mutable_bitField0_ |= 0x00000001; + } + connections_.add( + input.readMessage( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + .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)) { + connections_ = java.util.Collections.unmodifiableList(connections_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + .Builder.class); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 1; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 1; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 1; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONNECTIONS_FIELD_NUMBER = 2; + private java.util.List + connections_; + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public java.util.List + getConnectionsList() { + return connections_; + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public java.util.List< + ? extends + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> + getConnectionsOrBuilderList() { + return connections_; + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public int getConnectionsCount() { + return connections_.size(); + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnections( + int index) { + return connections_.get(index); + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder + getConnectionsOrBuilder(int index) { + return connections_.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 (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, nextPageToken_); + } + for (int i = 0; i < connections_.size(); i++) { + output.writeMessage(2, connections_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, nextPageToken_); + } + for (int i = 0; i < connections_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, connections_.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.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse other = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse) + obj; + + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getConnectionsList().equals(other.getConnectionsList())) 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) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getConnectionsCount() > 0) { + hash = (37 * hash) + CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getConnectionsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse + 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.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + 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 for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1beta1.ConnectionService.ListConnections].
+     * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse) + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + .Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConnectionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + nextPageToken_ = ""; + + if (connectionsBuilder_ == null) { + connections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + connectionsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + build() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + buildPartial() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + result = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse(this); + int from_bitField0_ = bitField0_; + result.nextPageToken_ = nextPageToken_; + if (connectionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + connections_ = java.util.Collections.unmodifiableList(connections_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.connections_ = connections_; + } else { + result.connections_ = connectionsBuilder_.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.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse) { + return mergeFrom( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + other) { + if (other + == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + .getDefaultInstance()) return this; + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (connectionsBuilder_ == null) { + if (!other.connections_.isEmpty()) { + if (connections_.isEmpty()) { + connections_ = other.connections_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConnectionsIsMutable(); + connections_.addAll(other.connections_); + } + onChanged(); + } + } else { + if (!other.connections_.isEmpty()) { + if (connectionsBuilder_.isEmpty()) { + connectionsBuilder_.dispose(); + connectionsBuilder_ = null; + connections_ = other.connections_; + bitField0_ = (bitField0_ & ~0x00000001); + connectionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConnectionsFieldBuilder() + : null; + } else { + connectionsBuilder_.addAllMessages(other.connections_); + } + } + } + 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.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+       * Next page token.
+       * 
+ * + * string next_page_token = 1; + * + * @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; + } + } + /** + * + * + *
+       * Next page token.
+       * 
+ * + * string next_page_token = 1; + * + * @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; + } + } + /** + * + * + *
+       * Next page token.
+       * 
+ * + * string next_page_token = 1; + * + * @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; + } + /** + * + * + *
+       * Next page token.
+       * 
+ * + * string next_page_token = 1; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+       * Next page token.
+       * 
+ * + * string next_page_token = 1; + * + * @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; + } + + private java.util.List< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + connections_ = java.util.Collections.emptyList(); + + private void ensureConnectionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + connections_ = + new java.util.ArrayList< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection>( + connections_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> + connectionsBuilder_; + + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public java.util.List + getConnectionsList() { + if (connectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(connections_); + } else { + return connectionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public int getConnectionsCount() { + if (connectionsBuilder_ == null) { + return connections_.size(); + } else { + return connectionsBuilder_.getCount(); + } + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnections( + int index) { + if (connectionsBuilder_ == null) { + return connections_.get(index); + } else { + return connectionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public Builder setConnections( + int index, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.set(index, value); + onChanged(); + } else { + connectionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public Builder setConnections( + int index, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder + builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.set(index, builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public Builder addConnections( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.add(value); + onChanged(); + } else { + connectionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public Builder addConnections( + int index, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.add(index, value); + onChanged(); + } else { + connectionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public Builder addConnections( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder + builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public Builder addConnections( + int index, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder + builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(index, builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public Builder addAllConnections( + java.lang.Iterable< + ? extends com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + values) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, connections_); + onChanged(); + } else { + connectionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public Builder clearConnections() { + if (connectionsBuilder_ == null) { + connections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + connectionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public Builder removeConnections(int index) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.remove(index); + onChanged(); + } else { + connectionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder + getConnectionsBuilder(int index) { + return getConnectionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder + getConnectionsOrBuilder(int index) { + if (connectionsBuilder_ == null) { + return connections_.get(index); + } else { + return connectionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public java.util.List< + ? extends + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> + getConnectionsOrBuilderList() { + if (connectionsBuilder_ != null) { + return connectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(connections_); + } + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder + addConnectionsBuilder() { + return getConnectionsFieldBuilder() + .addBuilder( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + .getDefaultInstance()); + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder + addConnectionsBuilder(int index) { + return getConnectionsFieldBuilder() + .addBuilder( + index, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + .getDefaultInstance()); + } + /** + * + * + *
+       * List of connections.
+       * 
+ * + * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; + */ + public java.util.List< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder> + getConnectionsBuilderList() { + return getConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> + getConnectionsFieldBuilder() { + if (connectionsBuilder_ == null) { + connectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder>( + connections_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + connections_ = null; + } + return connectionsBuilder_; + } + + @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.bigquery.connection.v1beta1.ListConnectionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse) + private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse(); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ListConnectionsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListConnectionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListConnectionsResponse(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.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface UpdateConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.UpdateConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Name of the connection to update, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * Required. Name of the connection to update, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + boolean hasConnection(); + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnection(); + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder + getConnectionOrBuilder(); + + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + } + /** + * + * + *
+   * The request for [ConnectionService.UpdateConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.UpdateConnection].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.UpdateConnectionRequest} + */ + public static final class UpdateConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.UpdateConnectionRequest) + UpdateConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateConnectionRequest.newBuilder() to construct. + private UpdateConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateConnectionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateConnectionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder + subBuilder = null; + if (connection_ != null) { + subBuilder = connection_.toBuilder(); + } + connection_ = + input.readMessage( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(connection_); + connection_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + .Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * Required. Name of the connection to update, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_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) { + 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. Name of the connection to update, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_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 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 CONNECTION_FIELD_NUMBER = 2; + private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection connection_; + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + public boolean hasConnection() { + return connection_ != null; + } + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnection() { + return connection_ == null + ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + .getDefaultInstance() + : connection_; + } + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder + getConnectionOrBuilder() { + return getConnection(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (connection_ != null) { + output.writeMessage(2, getConnection()); + } + if (updateMask_ != null) { + output.writeMessage(3, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (connection_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getConnection()); + } + 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.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest other = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest) + obj; + + if (!getName().equals(other.getName())) return false; + if (hasConnection() != other.hasConnection()) return false; + if (hasConnection()) { + if (!getConnection().equals(other.getConnection())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasConnection()) { + hash = (37 * hash) + CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getConnection().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.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest + 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.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + 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 for [ConnectionService.UpdateConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.UpdateConnection].
+     * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.UpdateConnectionRequest} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.UpdateConnectionRequest) + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + .Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (connectionBuilder_ == null) { + connection_ = null; + } else { + connection_ = null; + connectionBuilder_ = 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.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + build() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + buildPartial() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + result = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest(this); + result.name_ = name_; + if (connectionBuilder_ == null) { + result.connection_ = connection_; + } else { + result.connection_ = connectionBuilder_.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.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest) { + return mergeFrom( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + other) { + if (other + == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasConnection()) { + mergeConnection(other.getConnection()); + } + 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.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * Required. Name of the connection to update, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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. Name of the connection to update, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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. Name of the connection to update, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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. Name of the connection to update, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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. Name of the connection to update, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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 com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection connection_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> + connectionBuilder_; + /** + * + * + *
+       * Required. Connection containing the updated fields.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + public boolean hasConnection() { + return connectionBuilder_ != null || connection_ != null; + } + /** + * + * + *
+       * Required. Connection containing the updated fields.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + getConnection() { + if (connectionBuilder_ == null) { + return connection_ == null + ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + .getDefaultInstance() + : connection_; + } else { + return connectionBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Connection containing the updated fields.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection value) { + if (connectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connection_ = value; + onChanged(); + } else { + connectionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. Connection containing the updated fields.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder + builderForValue) { + if (connectionBuilder_ == null) { + connection_ = builderForValue.build(); + onChanged(); + } else { + connectionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. Connection containing the updated fields.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConnection( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection value) { + if (connectionBuilder_ == null) { + if (connection_ != null) { + connection_ = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.newBuilder( + connection_) + .mergeFrom(value) + .buildPartial(); + } else { + connection_ = value; + } + onChanged(); + } else { + connectionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. Connection containing the updated fields.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConnection() { + if (connectionBuilder_ == null) { + connection_ = null; + onChanged(); + } else { + connection_ = null; + connectionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. Connection containing the updated fields.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder + getConnectionBuilder() { + + onChanged(); + return getConnectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Connection containing the updated fields.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder + getConnectionOrBuilder() { + if (connectionBuilder_ != null) { + return connectionBuilder_.getMessageOrBuilder(); + } else { + return connection_ == null + ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + .getDefaultInstance() + : connection_; + } + } + /** + * + * + *
+       * Required. Connection containing the updated fields.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> + getConnectionFieldBuilder() { + if (connectionBuilder_ == null) { + connectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder>( + getConnection(), getParentForChildren(), isClean()); + connection_ = null; + } + return connectionBuilder_; + } + + 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. Update mask for the connection fields to be updated.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+       * Required. Update mask for the connection fields to be updated.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.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. Update mask for the connection fields to be updated.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.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. Update mask for the connection fields to be updated.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.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. Update mask for the connection fields to be updated.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.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. Update mask for the connection fields to be updated.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. Update mask for the connection fields to be updated.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Update mask for the connection fields to be updated.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.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. Update mask for the connection fields to be updated.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.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.bigquery.connection.v1beta1.UpdateConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.UpdateConnectionRequest) + private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest(); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateConnectionRequest(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.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface UpdateConnectionCredentialRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.UpdateConnectionCredentialRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Name of the connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * Required. Name of the connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * Required. Credential to use with the connection.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the credential field is set. + */ + boolean hasCredential(); + /** + * + * + *
+     * Required. Credential to use with the connection.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The credential. + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + getCredential(); + /** + * + * + *
+     * Required. Credential to use with the connection.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredentialOrBuilder + getCredentialOrBuilder(); + } + /** + * + * + *
+   * The request for [ConnectionService.UpdateConnectionCredential][google.cloud.bigquery.connection.v1beta1.ConnectionService.UpdateConnectionCredential].
+   * 
+ * + * Protobuf type {@code + * google.cloud.bigquery.connection.v1beta1.UpdateConnectionCredentialRequest} + */ + public static final class UpdateConnectionCredentialRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.UpdateConnectionCredentialRequest) + UpdateConnectionCredentialRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateConnectionCredentialRequest.newBuilder() to construct. + private UpdateConnectionCredentialRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateConnectionCredentialRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateConnectionCredentialRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateConnectionCredentialRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .Builder + subBuilder = null; + if (credential_ != null) { + subBuilder = credential_.toBuilder(); + } + credential_ = + input.readMessage( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ConnectionCredential.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(credential_); + credential_ = 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.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest.class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * Required. Name of the connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+     * Required. Name of the connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREDENTIAL_FIELD_NUMBER = 2; + private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + credential_; + /** + * + * + *
+     * Required. Credential to use with the connection.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the credential field is set. + */ + public boolean hasCredential() { + return credential_ != null; + } + /** + * + * + *
+     * Required. Credential to use with the connection.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The credential. + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + getCredential() { + return credential_ == null + ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .getDefaultInstance() + : credential_; + } + /** + * + * + *
+     * Required. Credential to use with the connection.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ConnectionCredentialOrBuilder + getCredentialOrBuilder() { + return getCredential(); + } + + 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 (credential_ != null) { + output.writeMessage(2, getCredential()); + } + 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 (credential_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCredential()); + } + 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.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionCredentialRequest + other = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest) + obj; + + if (!getName().equals(other.getName())) return false; + if (hasCredential() != other.hasCredential()) return false; + if (hasCredential()) { + if (!getCredential().equals(other.getCredential())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasCredential()) { + hash = (37 * hash) + CREDENTIAL_FIELD_NUMBER; + hash = (53 * hash) + getCredential().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + 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.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + 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 for [ConnectionService.UpdateConnectionCredential][google.cloud.bigquery.connection.v1beta1.ConnectionService.UpdateConnectionCredential].
+     * 
+ * + * Protobuf type {@code + * google.cloud.bigquery.connection.v1beta1.UpdateConnectionCredentialRequest} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.UpdateConnectionCredentialRequest) + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest.class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest.Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionCredentialRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (credentialBuilder_ == null) { + credential_ = null; + } else { + credential_ = null; + credentialBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + build() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + buildPartial() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + result = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest(this); + result.name_ = name_; + if (credentialBuilder_ == null) { + result.credential_ = credential_; + } else { + result.credential_ = credentialBuilder_.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.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest) { + return mergeFrom( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + other) { + if (other + == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCredential()) { + mergeCredential(other.getCredential()); + } + 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.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * Required. Name of the connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
+       * 
+ * + * 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. Name of the connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
+       * 
+ * + * 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. Name of the connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
+       * 
+ * + * 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. Name of the connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Name of the connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + credential_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ConnectionCredentialOrBuilder> + credentialBuilder_; + /** + * + * + *
+       * Required. Credential to use with the connection.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the credential field is set. + */ + public boolean hasCredential() { + return credentialBuilder_ != null || credential_ != null; + } + /** + * + * + *
+       * Required. Credential to use with the connection.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The credential. + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + getCredential() { + if (credentialBuilder_ == null) { + return credential_ == null + ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .getDefaultInstance() + : credential_; + } else { + return credentialBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Credential to use with the connection.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCredential( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential value) { + if (credentialBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + credential_ = value; + onChanged(); + } else { + credentialBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. Credential to use with the connection.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCredential( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential.Builder + builderForValue) { + if (credentialBuilder_ == null) { + credential_ = builderForValue.build(); + onChanged(); + } else { + credentialBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. Credential to use with the connection.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCredential( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential value) { + if (credentialBuilder_ == null) { + if (credential_ != null) { + credential_ = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .newBuilder(credential_) + .mergeFrom(value) + .buildPartial(); + } else { + credential_ = value; + } + onChanged(); + } else { + credentialBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. Credential to use with the connection.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCredential() { + if (credentialBuilder_ == null) { + credential_ = null; + onChanged(); + } else { + credential_ = null; + credentialBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. Credential to use with the connection.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .Builder + getCredentialBuilder() { + + onChanged(); + return getCredentialFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Credential to use with the connection.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ConnectionCredentialOrBuilder + getCredentialOrBuilder() { + if (credentialBuilder_ != null) { + return credentialBuilder_.getMessageOrBuilder(); + } else { + return credential_ == null + ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .getDefaultInstance() + : credential_; + } + } + /** + * + * + *
+       * Required. Credential to use with the connection.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ConnectionCredentialOrBuilder> + getCredentialFieldBuilder() { + if (credentialBuilder_ == null) { + credentialBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ConnectionCredentialOrBuilder>( + getCredential(), getParentForChildren(), isClean()); + credential_ = null; + } + return credentialBuilder_; + } + + @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.bigquery.connection.v1beta1.UpdateConnectionCredentialRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.UpdateConnectionCredentialRequest) + private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest(); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateConnectionCredentialRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateConnectionCredentialRequest(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.bigquery.connection.v1beta1.ConnectionProto + .UpdateConnectionCredentialRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DeleteConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.DeleteConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Name of the deleted connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * Required. Name of the deleted connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + } + /** + * + * + *
+   * The request for [ConnectionService.DeleteConnectionRequest][].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.DeleteConnectionRequest} + */ + public static final class DeleteConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.DeleteConnectionRequest) + DeleteConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteConnectionRequest.newBuilder() to construct. + private DeleteConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteConnectionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteConnectionRequest( + 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.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + .Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * Required. Name of the deleted connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_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) { + 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. Name of the deleted connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_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 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.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest other = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest) + 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.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest + 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.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + 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 for [ConnectionService.DeleteConnectionRequest][].
+     * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.DeleteConnectionRequest} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.DeleteConnectionRequest) + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + .Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest.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.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + build() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + buildPartial() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + result = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest(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.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest) { + return mergeFrom( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + other) { + if (other + == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + .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.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * Required. Name of the deleted connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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. Name of the deleted connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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. Name of the deleted connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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. Name of the deleted connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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. Name of the deleted connection, for example:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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.bigquery.connection.v1beta1.DeleteConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.DeleteConnectionRequest) + private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest(); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .DeleteConnectionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteConnectionRequest(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.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConnectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.Connection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The resource name of the connection in the form of:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * The resource name of the connection in the form of:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * User provided display name for the connection.
+     * 
+ * + * string friendly_name = 2; + * + * @return The friendlyName. + */ + java.lang.String getFriendlyName(); + /** + * + * + *
+     * User provided display name for the connection.
+     * 
+ * + * string friendly_name = 2; + * + * @return The bytes for friendlyName. + */ + com.google.protobuf.ByteString getFriendlyNameBytes(); + + /** + * + * + *
+     * User provided description.
+     * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+     * User provided description.
+     * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + * + * @return Whether the cloudSql field is set. + */ + boolean hasCloudSql(); + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + * + * @return The cloudSql. + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties getCloudSql(); + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlPropertiesOrBuilder + getCloudSqlOrBuilder(); + + /** + * + * + *
+     * Output only. The creation timestamp of the connection.
+     * 
+ * + * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The creationTime. + */ + long getCreationTime(); + + /** + * + * + *
+     * Output only. The last update timestamp of the connection.
+     * 
+ * + * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The lastModifiedTime. + */ + long getLastModifiedTime(); + + /** + * + * + *
+     * Output only. True, if credential is configured for this connection.
+     * 
+ * + * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hasCredential. + */ + boolean getHasCredential(); + + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.PropertiesCase + getPropertiesCase(); + } + /** + * + * + *
+   * Configuration parameters to establish connection with an external data
+   * source, except the credential attributes.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.Connection} + */ + public static final class Connection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.Connection) + ConnectionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Connection.newBuilder() to construct. + private Connection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Connection() { + name_ = ""; + friendlyName_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Connection(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Connection( + 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(); + + friendlyName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: + { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .Builder + subBuilder = null; + if (propertiesCase_ == 4) { + subBuilder = + ((com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlProperties) + properties_) + .toBuilder(); + } + properties_ = + input.readMessage( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlProperties.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlProperties) + properties_); + properties_ = subBuilder.buildPartial(); + } + propertiesCase_ = 4; + break; + } + case 40: + { + creationTime_ = input.readInt64(); + break; + } + case 48: + { + lastModifiedTime_ = input.readInt64(); + break; + } + case 56: + { + hasCredential_ = 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.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_Connection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_Connection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder + .class); + } + + private int propertiesCase_ = 0; + private java.lang.Object properties_; + + public enum PropertiesCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CLOUD_SQL(4), + PROPERTIES_NOT_SET(0); + private final int value; + + private PropertiesCase(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 PropertiesCase valueOf(int value) { + return forNumber(value); + } + + public static PropertiesCase forNumber(int value) { + switch (value) { + case 4: + return CLOUD_SQL; + case 0: + return PROPERTIES_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PropertiesCase getPropertiesCase() { + return PropertiesCase.forNumber(propertiesCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * The resource name of the connection in the form of:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+     * The resource name of the connection in the form of:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FRIENDLY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object friendlyName_; + /** + * + * + *
+     * User provided display name for the connection.
+     * 
+ * + * string friendly_name = 2; + * + * @return The friendlyName. + */ + public java.lang.String getFriendlyName() { + java.lang.Object ref = friendlyName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + friendlyName_ = s; + return s; + } + } + /** + * + * + *
+     * User provided display name for the connection.
+     * 
+ * + * string friendly_name = 2; + * + * @return The bytes for friendlyName. + */ + public com.google.protobuf.ByteString getFriendlyNameBytes() { + java.lang.Object ref = friendlyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + friendlyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+     * User provided description.
+     * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+     * User provided description.
+     * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLOUD_SQL_FIELD_NUMBER = 4; + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + * + * @return Whether the cloudSql field is set. + */ + public boolean hasCloudSql() { + return propertiesCase_ == 4; + } + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + * + * @return The cloudSql. + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + getCloudSql() { + if (propertiesCase_ == 4) { + return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) + properties_; + } + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .getDefaultInstance(); + } + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlPropertiesOrBuilder + getCloudSqlOrBuilder() { + if (propertiesCase_ == 4) { + return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) + properties_; + } + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .getDefaultInstance(); + } + + public static final int CREATION_TIME_FIELD_NUMBER = 5; + private long creationTime_; + /** + * + * + *
+     * Output only. The creation timestamp of the connection.
+     * 
+ * + * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The creationTime. + */ + public long getCreationTime() { + return creationTime_; + } + + public static final int LAST_MODIFIED_TIME_FIELD_NUMBER = 6; + private long lastModifiedTime_; + /** + * + * + *
+     * Output only. The last update timestamp of the connection.
+     * 
+ * + * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The lastModifiedTime. + */ + public long getLastModifiedTime() { + return lastModifiedTime_; + } + + public static final int HAS_CREDENTIAL_FIELD_NUMBER = 7; + private boolean hasCredential_; + /** + * + * + *
+     * Output only. True, if credential is configured for this connection.
+     * 
+ * + * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hasCredential. + */ + public boolean getHasCredential() { + return hasCredential_; + } + + 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 (!getFriendlyNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, friendlyName_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (propertiesCase_ == 4) { + output.writeMessage( + 4, + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) + properties_); + } + if (creationTime_ != 0L) { + output.writeInt64(5, creationTime_); + } + if (lastModifiedTime_ != 0L) { + output.writeInt64(6, lastModifiedTime_); + } + if (hasCredential_ != false) { + output.writeBool(7, hasCredential_); + } + 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 (!getFriendlyNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, friendlyName_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (propertiesCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) + properties_); + } + if (creationTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, creationTime_); + } + if (lastModifiedTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, lastModifiedTime_); + } + if (hasCredential_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, hasCredential_); + } + 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.bigquery.connection.v1beta1.ConnectionProto.Connection)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection other = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection) obj; + + if (!getName().equals(other.getName())) return false; + if (!getFriendlyName().equals(other.getFriendlyName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (getCreationTime() != other.getCreationTime()) return false; + if (getLastModifiedTime() != other.getLastModifiedTime()) return false; + if (getHasCredential() != other.getHasCredential()) return false; + if (!getPropertiesCase().equals(other.getPropertiesCase())) return false; + switch (propertiesCase_) { + case 4: + if (!getCloudSql().equals(other.getCloudSql())) 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) + FRIENDLY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFriendlyName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + CREATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCreationTime()); + hash = (37 * hash) + LAST_MODIFIED_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getLastModifiedTime()); + hash = (37 * hash) + HAS_CREDENTIAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getHasCredential()); + switch (propertiesCase_) { + case 4: + hash = (37 * hash) + CLOUD_SQL_FIELD_NUMBER; + hash = (53 * hash) + getCloudSql().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection 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.bigquery.connection.v1beta1.ConnectionProto.Connection 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 parameters to establish connection with an external data
+     * source, except the credential attributes.
+     * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.Connection} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.Connection) + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_Connection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_Connection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder + .class); + } + + // Construct using + // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.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_ = ""; + + friendlyName_ = ""; + + description_ = ""; + + creationTime_ = 0L; + + lastModifiedTime_ = 0L; + + hasCredential_ = false; + + propertiesCase_ = 0; + properties_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_Connection_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection build() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + buildPartial() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection result = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection(this); + result.name_ = name_; + result.friendlyName_ = friendlyName_; + result.description_ = description_; + if (propertiesCase_ == 4) { + if (cloudSqlBuilder_ == null) { + result.properties_ = properties_; + } else { + result.properties_ = cloudSqlBuilder_.build(); + } + } + result.creationTime_ = creationTime_; + result.lastModifiedTime_ = lastModifiedTime_; + result.hasCredential_ = hasCredential_; + result.propertiesCase_ = propertiesCase_; + 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.bigquery.connection.v1beta1.ConnectionProto.Connection) { + return mergeFrom( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection other) { + if (other + == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getFriendlyName().isEmpty()) { + friendlyName_ = other.friendlyName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.getCreationTime() != 0L) { + setCreationTime(other.getCreationTime()); + } + if (other.getLastModifiedTime() != 0L) { + setLastModifiedTime(other.getLastModifiedTime()); + } + if (other.getHasCredential() != false) { + setHasCredential(other.getHasCredential()); + } + switch (other.getPropertiesCase()) { + case CLOUD_SQL: + { + mergeCloudSql(other.getCloudSql()); + break; + } + case PROPERTIES_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.bigquery.connection.v1beta1.ConnectionProto.Connection parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int propertiesCase_ = 0; + private java.lang.Object properties_; + + public PropertiesCase getPropertiesCase() { + return PropertiesCase.forNumber(propertiesCase_); + } + + public Builder clearProperties() { + propertiesCase_ = 0; + properties_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * The resource name of the connection in the form of:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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 resource name of the connection in the form of:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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 resource name of the connection in the form of:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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 resource name of the connection in the form of:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+       * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The resource name of the connection in the form of:
+       * `projects/{project_id}/locations/{location_id}/connections/{connection_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 friendlyName_ = ""; + /** + * + * + *
+       * User provided display name for the connection.
+       * 
+ * + * string friendly_name = 2; + * + * @return The friendlyName. + */ + public java.lang.String getFriendlyName() { + java.lang.Object ref = friendlyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + friendlyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * User provided display name for the connection.
+       * 
+ * + * string friendly_name = 2; + * + * @return The bytes for friendlyName. + */ + public com.google.protobuf.ByteString getFriendlyNameBytes() { + java.lang.Object ref = friendlyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + friendlyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * User provided display name for the connection.
+       * 
+ * + * string friendly_name = 2; + * + * @param value The friendlyName to set. + * @return This builder for chaining. + */ + public Builder setFriendlyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + friendlyName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * User provided display name for the connection.
+       * 
+ * + * string friendly_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearFriendlyName() { + + friendlyName_ = getDefaultInstance().getFriendlyName(); + onChanged(); + return this; + } + /** + * + * + *
+       * User provided display name for the connection.
+       * 
+ * + * string friendly_name = 2; + * + * @param value The bytes for friendlyName to set. + * @return This builder for chaining. + */ + public Builder setFriendlyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + friendlyName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+       * User provided description.
+       * 
+ * + * 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; + } + } + /** + * + * + *
+       * User provided description.
+       * 
+ * + * 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; + } + } + /** + * + * + *
+       * User provided description.
+       * 
+ * + * 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; + } + /** + * + * + *
+       * User provided description.
+       * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+       * User provided description.
+       * 
+ * + * 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.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlPropertiesOrBuilder> + cloudSqlBuilder_; + /** + * + * + *
+       * Cloud SQL properties.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + * + * @return Whether the cloudSql field is set. + */ + public boolean hasCloudSql() { + return propertiesCase_ == 4; + } + /** + * + * + *
+       * Cloud SQL properties.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + * + * @return The cloudSql. + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + getCloudSql() { + if (cloudSqlBuilder_ == null) { + if (propertiesCase_ == 4) { + return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) + properties_; + } + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .getDefaultInstance(); + } else { + if (propertiesCase_ == 4) { + return cloudSqlBuilder_.getMessage(); + } + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Cloud SQL properties.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + */ + public Builder setCloudSql( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties value) { + if (cloudSqlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + properties_ = value; + onChanged(); + } else { + cloudSqlBuilder_.setMessage(value); + } + propertiesCase_ = 4; + return this; + } + /** + * + * + *
+       * Cloud SQL properties.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + */ + public Builder setCloudSql( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties.Builder + builderForValue) { + if (cloudSqlBuilder_ == null) { + properties_ = builderForValue.build(); + onChanged(); + } else { + cloudSqlBuilder_.setMessage(builderForValue.build()); + } + propertiesCase_ = 4; + return this; + } + /** + * + * + *
+       * Cloud SQL properties.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + */ + public Builder mergeCloudSql( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties value) { + if (cloudSqlBuilder_ == null) { + if (propertiesCase_ == 4 + && properties_ + != com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .getDefaultInstance()) { + properties_ = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .newBuilder( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlProperties) + properties_) + .mergeFrom(value) + .buildPartial(); + } else { + properties_ = value; + } + onChanged(); + } else { + if (propertiesCase_ == 4) { + cloudSqlBuilder_.mergeFrom(value); + } + cloudSqlBuilder_.setMessage(value); + } + propertiesCase_ = 4; + return this; + } + /** + * + * + *
+       * Cloud SQL properties.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + */ + public Builder clearCloudSql() { + if (cloudSqlBuilder_ == null) { + if (propertiesCase_ == 4) { + propertiesCase_ = 0; + properties_ = null; + onChanged(); + } + } else { + if (propertiesCase_ == 4) { + propertiesCase_ = 0; + properties_ = null; + } + cloudSqlBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Cloud SQL properties.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties.Builder + getCloudSqlBuilder() { + return getCloudSqlFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Cloud SQL properties.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlPropertiesOrBuilder + getCloudSqlOrBuilder() { + if ((propertiesCase_ == 4) && (cloudSqlBuilder_ != null)) { + return cloudSqlBuilder_.getMessageOrBuilder(); + } else { + if (propertiesCase_ == 4) { + return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) + properties_; + } + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Cloud SQL properties.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlPropertiesOrBuilder> + getCloudSqlFieldBuilder() { + if (cloudSqlBuilder_ == null) { + if (!(propertiesCase_ == 4)) { + properties_ = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .getDefaultInstance(); + } + cloudSqlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlPropertiesOrBuilder>( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) + properties_, + getParentForChildren(), + isClean()); + properties_ = null; + } + propertiesCase_ = 4; + onChanged(); + ; + return cloudSqlBuilder_; + } + + private long creationTime_; + /** + * + * + *
+       * Output only. The creation timestamp of the connection.
+       * 
+ * + * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The creationTime. + */ + public long getCreationTime() { + return creationTime_; + } + /** + * + * + *
+       * Output only. The creation timestamp of the connection.
+       * 
+ * + * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The creationTime to set. + * @return This builder for chaining. + */ + public Builder setCreationTime(long value) { + + creationTime_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The creation timestamp of the connection.
+       * 
+ * + * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearCreationTime() { + + creationTime_ = 0L; + onChanged(); + return this; + } + + private long lastModifiedTime_; + /** + * + * + *
+       * Output only. The last update timestamp of the connection.
+       * 
+ * + * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The lastModifiedTime. + */ + public long getLastModifiedTime() { + return lastModifiedTime_; + } + /** + * + * + *
+       * Output only. The last update timestamp of the connection.
+       * 
+ * + * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The lastModifiedTime to set. + * @return This builder for chaining. + */ + public Builder setLastModifiedTime(long value) { + + lastModifiedTime_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The last update timestamp of the connection.
+       * 
+ * + * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearLastModifiedTime() { + + lastModifiedTime_ = 0L; + onChanged(); + return this; + } + + private boolean hasCredential_; + /** + * + * + *
+       * Output only. True, if credential is configured for this connection.
+       * 
+ * + * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hasCredential. + */ + public boolean getHasCredential() { + return hasCredential_; + } + /** + * + * + *
+       * Output only. True, if credential is configured for this connection.
+       * 
+ * + * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The hasCredential to set. + * @return This builder for chaining. + */ + public Builder setHasCredential(boolean value) { + + hasCredential_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. True, if credential is configured for this connection.
+       * 
+ * + * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearHasCredential() { + + hasCredential_ = 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.bigquery.connection.v1beta1.Connection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.Connection) + private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection(); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Connection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Connection(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.bigquery.connection.v1beta1.ConnectionProto.Connection + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConnectionCredentialOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.ConnectionCredential) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Credential for Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + * + * @return Whether the cloudSql field is set. + */ + boolean hasCloudSql(); + /** + * + * + *
+     * Credential for Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + * + * @return The cloudSql. + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential getCloudSql(); + /** + * + * + *
+     * Credential for Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredentialOrBuilder + getCloudSqlOrBuilder(); + + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .CredentialCase + getCredentialCase(); + } + /** + * + * + *
+   * Credential to use with a connection.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.ConnectionCredential} + */ + public static final class ConnectionCredential extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.ConnectionCredential) + ConnectionCredentialOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConnectionCredential.newBuilder() to construct. + private ConnectionCredential(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectionCredential() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectionCredential(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ConnectionCredential( + 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.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .Builder + subBuilder = null; + if (credentialCase_ == 1) { + subBuilder = + ((com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlCredential) + credential_) + .toBuilder(); + } + credential_ = + input.readMessage( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlCredential.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlCredential) + credential_); + credential_ = subBuilder.buildPartial(); + } + credentialCase_ = 1; + 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.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .Builder.class); + } + + private int credentialCase_ = 0; + private java.lang.Object credential_; + + public enum CredentialCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CLOUD_SQL(1), + CREDENTIAL_NOT_SET(0); + private final int value; + + private CredentialCase(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 CredentialCase valueOf(int value) { + return forNumber(value); + } + + public static CredentialCase forNumber(int value) { + switch (value) { + case 1: + return CLOUD_SQL; + case 0: + return CREDENTIAL_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public CredentialCase getCredentialCase() { + return CredentialCase.forNumber(credentialCase_); + } + + public static final int CLOUD_SQL_FIELD_NUMBER = 1; + /** + * + * + *
+     * Credential for Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + * + * @return Whether the cloudSql field is set. + */ + public boolean hasCloudSql() { + return credentialCase_ == 1; + } + /** + * + * + *
+     * Credential for Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + * + * @return The cloudSql. + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + getCloudSql() { + if (credentialCase_ == 1) { + return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) + credential_; + } + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .getDefaultInstance(); + } + /** + * + * + *
+     * Credential for Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredentialOrBuilder + getCloudSqlOrBuilder() { + if (credentialCase_ == 1) { + return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) + credential_; + } + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .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 (credentialCase_ == 1) { + output.writeMessage( + 1, + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) + credential_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (credentialCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) + credential_); + } + 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.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential other = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential) obj; + + if (!getCredentialCase().equals(other.getCredentialCase())) return false; + switch (credentialCase_) { + case 1: + if (!getCloudSql().equals(other.getCloudSql())) 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 (credentialCase_) { + case 1: + hash = (37 * hash) + CLOUD_SQL_FIELD_NUMBER; + hash = (53 * hash) + getCloudSql().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + 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.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + 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; + } + /** + * + * + *
+     * Credential to use with a connection.
+     * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.ConnectionCredential} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.ConnectionCredential) + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredentialOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential.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(); + credentialCase_ = 0; + credential_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + build() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + buildPartial() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential result = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential( + this); + if (credentialCase_ == 1) { + if (cloudSqlBuilder_ == null) { + result.credential_ = credential_; + } else { + result.credential_ = cloudSqlBuilder_.build(); + } + } + result.credentialCase_ = credentialCase_; + 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.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential) { + return mergeFrom( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential other) { + if (other + == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + .getDefaultInstance()) return this; + switch (other.getCredentialCase()) { + case CLOUD_SQL: + { + mergeCloudSql(other.getCloudSql()); + break; + } + case CREDENTIAL_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.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int credentialCase_ = 0; + private java.lang.Object credential_; + + public CredentialCase getCredentialCase() { + return CredentialCase.forNumber(credentialCase_); + } + + public Builder clearCredential() { + credentialCase_ = 0; + credential_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlCredentialOrBuilder> + cloudSqlBuilder_; + /** + * + * + *
+       * Credential for Cloud SQL database.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + * + * @return Whether the cloudSql field is set. + */ + public boolean hasCloudSql() { + return credentialCase_ == 1; + } + /** + * + * + *
+       * Credential for Cloud SQL database.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + * + * @return The cloudSql. + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + getCloudSql() { + if (cloudSqlBuilder_ == null) { + if (credentialCase_ == 1) { + return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) + credential_; + } + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .getDefaultInstance(); + } else { + if (credentialCase_ == 1) { + return cloudSqlBuilder_.getMessage(); + } + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Credential for Cloud SQL database.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + */ + public Builder setCloudSql( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential value) { + if (cloudSqlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + credential_ = value; + onChanged(); + } else { + cloudSqlBuilder_.setMessage(value); + } + credentialCase_ = 1; + return this; + } + /** + * + * + *
+       * Credential for Cloud SQL database.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + */ + public Builder setCloudSql( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential.Builder + builderForValue) { + if (cloudSqlBuilder_ == null) { + credential_ = builderForValue.build(); + onChanged(); + } else { + cloudSqlBuilder_.setMessage(builderForValue.build()); + } + credentialCase_ = 1; + return this; + } + /** + * + * + *
+       * Credential for Cloud SQL database.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + */ + public Builder mergeCloudSql( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential value) { + if (cloudSqlBuilder_ == null) { + if (credentialCase_ == 1 + && credential_ + != com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .getDefaultInstance()) { + credential_ = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .newBuilder( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlCredential) + credential_) + .mergeFrom(value) + .buildPartial(); + } else { + credential_ = value; + } + onChanged(); + } else { + if (credentialCase_ == 1) { + cloudSqlBuilder_.mergeFrom(value); + } + cloudSqlBuilder_.setMessage(value); + } + credentialCase_ = 1; + return this; + } + /** + * + * + *
+       * Credential for Cloud SQL database.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + */ + public Builder clearCloudSql() { + if (cloudSqlBuilder_ == null) { + if (credentialCase_ == 1) { + credentialCase_ = 0; + credential_ = null; + onChanged(); + } + } else { + if (credentialCase_ == 1) { + credentialCase_ = 0; + credential_ = null; + } + cloudSqlBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Credential for Cloud SQL database.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential.Builder + getCloudSqlBuilder() { + return getCloudSqlFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Credential for Cloud SQL database.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlCredentialOrBuilder + getCloudSqlOrBuilder() { + if ((credentialCase_ == 1) && (cloudSqlBuilder_ != null)) { + return cloudSqlBuilder_.getMessageOrBuilder(); + } else { + if (credentialCase_ == 1) { + return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) + credential_; + } + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Credential for Cloud SQL database.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlCredentialOrBuilder> + getCloudSqlFieldBuilder() { + if (cloudSqlBuilder_ == null) { + if (!(credentialCase_ == 1)) { + credential_ = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .getDefaultInstance(); + } + cloudSqlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlCredentialOrBuilder>( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) + credential_, + getParentForChildren(), + isClean()); + credential_ = null; + } + credentialCase_ = 1; + onChanged(); + ; + return cloudSqlBuilder_; + } + + @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.bigquery.connection.v1beta1.ConnectionCredential) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.ConnectionCredential) + private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .ConnectionCredential + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential(); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionCredential parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConnectionCredential(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.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CloudSqlPropertiesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.CloudSqlProperties) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Cloud SQL instance ID in the form `project:location:instance`.
+     * 
+ * + * string instance_id = 1; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + /** + * + * + *
+     * Cloud SQL instance ID in the form `project:location:instance`.
+     * 
+ * + * string instance_id = 1; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+     * Database name.
+     * 
+ * + * string database = 2; + * + * @return The database. + */ + java.lang.String getDatabase(); + /** + * + * + *
+     * Database name.
+     * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+     * Type of the Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+     * Type of the Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; + * + * + * @return The type. + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties.DatabaseType + getType(); + + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the credential field is set. + */ + boolean hasCredential(); + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The credential. + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential getCredential(); + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredentialOrBuilder + getCredentialOrBuilder(); + } + /** + * + * + *
+   * Connection properties specific to the Cloud SQL.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.CloudSqlProperties} + */ + public static final class CloudSqlProperties extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.CloudSqlProperties) + CloudSqlPropertiesOrBuilder { + private static final long serialVersionUID = 0L; + // Use CloudSqlProperties.newBuilder() to construct. + private CloudSqlProperties(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CloudSqlProperties() { + instanceId_ = ""; + database_ = ""; + type_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CloudSqlProperties(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CloudSqlProperties( + 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(); + + instanceId_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + database_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 34: + { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .Builder + subBuilder = null; + if (credential_ != null) { + subBuilder = credential_.toBuilder(); + } + credential_ = + input.readMessage( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlCredential.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(credential_); + credential_ = 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.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties.class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .Builder.class); + } + + /** + * + * + *
+     * Supported Cloud SQL database types.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType} + */ + public enum DatabaseType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified database type.
+       * 
+ * + * DATABASE_TYPE_UNSPECIFIED = 0; + */ + DATABASE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * Cloud SQL for PostgreSQL.
+       * 
+ * + * POSTGRES = 1; + */ + POSTGRES(1), + /** + * + * + *
+       * Cloud SQL for MySQL.
+       * 
+ * + * MYSQL = 2; + */ + MYSQL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified database type.
+       * 
+ * + * DATABASE_TYPE_UNSPECIFIED = 0; + */ + public static final int DATABASE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Cloud SQL for PostgreSQL.
+       * 
+ * + * POSTGRES = 1; + */ + public static final int POSTGRES_VALUE = 1; + /** + * + * + *
+       * Cloud SQL for MySQL.
+       * 
+ * + * MYSQL = 2; + */ + public static final int MYSQL_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 DatabaseType 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 DatabaseType forNumber(int value) { + switch (value) { + case 0: + return DATABASE_TYPE_UNSPECIFIED; + case 1: + return POSTGRES; + case 2: + return MYSQL; + 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 DatabaseType findValueByNumber(int number) { + return DatabaseType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final DatabaseType[] VALUES = values(); + + public static DatabaseType 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 DatabaseType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType) + } + + public static final int INSTANCE_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object instanceId_; + /** + * + * + *
+     * Cloud SQL instance ID in the form `project:location:instance`.
+     * 
+ * + * string instance_id = 1; + * + * @return The instanceId. + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } + } + /** + * + * + *
+     * Cloud SQL instance ID in the form `project:location:instance`.
+     * 
+ * + * string instance_id = 1; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_FIELD_NUMBER = 2; + private volatile java.lang.Object database_; + /** + * + * + *
+     * Database name.
+     * 
+ * + * string database = 2; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + /** + * + * + *
+     * Database name.
+     * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 3; + private int type_; + /** + * + * + *
+     * Type of the Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; + * + * + * @return The enum numeric value on the wire for type. + */ + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Type of the Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; + * + * + * @return The type. + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .DatabaseType + getType() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties.DatabaseType + result = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .DatabaseType.valueOf(type_); + return result == null + ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .DatabaseType.UNRECOGNIZED + : result; + } + + public static final int CREDENTIAL_FIELD_NUMBER = 4; + private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + credential_; + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the credential field is set. + */ + public boolean hasCredential() { + return credential_ != null; + } + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The credential. + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + getCredential() { + return credential_ == null + ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .getDefaultInstance() + : credential_; + } + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredentialOrBuilder + getCredentialOrBuilder() { + return getCredential(); + } + + 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 (!getInstanceIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, instanceId_); + } + if (!getDatabaseBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, database_); + } + if (type_ + != com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .DatabaseType.DATABASE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, type_); + } + if (credential_ != null) { + output.writeMessage(4, getCredential()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getInstanceIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, instanceId_); + } + if (!getDatabaseBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, database_); + } + if (type_ + != com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .DatabaseType.DATABASE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_); + } + if (credential_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCredential()); + } + 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.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties other = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) obj; + + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (!getDatabase().equals(other.getDatabase())) return false; + if (type_ != other.type_) return false; + if (hasCredential() != other.hasCredential()) return false; + if (hasCredential()) { + if (!getCredential().equals(other.getCredential())) 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) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + if (hasCredential()) { + hash = (37 * hash) + CREDENTIAL_FIELD_NUMBER; + hash = (53 * hash) + getCredential().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + 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.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties 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; + } + /** + * + * + *
+     * Connection properties specific to the Cloud SQL.
+     * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.CloudSqlProperties} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.CloudSqlProperties) + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlPropertiesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties.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(); + instanceId_ = ""; + + database_ = ""; + + type_ = 0; + + if (credentialBuilder_ == null) { + credential_ = null; + } else { + credential_ = null; + credentialBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + build() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + buildPartial() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties result = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties( + this); + result.instanceId_ = instanceId_; + result.database_ = database_; + result.type_ = type_; + if (credentialBuilder_ == null) { + result.credential_ = credential_; + } else { + result.credential_ = credentialBuilder_.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.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) { + return mergeFrom( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties other) { + if (other + == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .getDefaultInstance()) return this; + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + onChanged(); + } + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.hasCredential()) { + mergeCredential(other.getCredential()); + } + 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.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object instanceId_ = ""; + /** + * + * + *
+       * Cloud SQL instance ID in the form `project:location:instance`.
+       * 
+ * + * string instance_id = 1; + * + * @return The instanceId. + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Cloud SQL instance ID in the form `project:location:instance`.
+       * 
+ * + * string instance_id = 1; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Cloud SQL instance ID in the form `project:location:instance`.
+       * 
+ * + * string instance_id = 1; + * + * @param value The instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + instanceId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Cloud SQL instance ID in the form `project:location:instance`.
+       * 
+ * + * string instance_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + + instanceId_ = getDefaultInstance().getInstanceId(); + onChanged(); + return this; + } + /** + * + * + *
+       * Cloud SQL instance ID in the form `project:location:instance`.
+       * 
+ * + * string instance_id = 1; + * + * @param value The bytes for instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + instanceId_ = value; + onChanged(); + return this; + } + + private java.lang.Object database_ = ""; + /** + * + * + *
+       * Database name.
+       * 
+ * + * string database = 2; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Database name.
+       * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Database name.
+       * 
+ * + * string database = 2; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + database_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Database name.
+       * 
+ * + * string database = 2; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + + database_ = getDefaultInstance().getDatabase(); + onChanged(); + return this; + } + /** + * + * + *
+       * Database name.
+       * 
+ * + * string database = 2; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + database_ = value; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+       * Type of the Cloud SQL database.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; + * + * + * @return The enum numeric value on the wire for type. + */ + public int getTypeValue() { + return type_; + } + /** + * + * + *
+       * Type of the Cloud SQL database.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Type of the Cloud SQL database.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; + * + * + * @return The type. + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .DatabaseType + getType() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties.DatabaseType + result = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .DatabaseType.valueOf(type_); + return result == null + ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .DatabaseType.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Type of the Cloud SQL database.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + .DatabaseType + value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Type of the Cloud SQL database.
+       * 
+ * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + credential_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlCredentialOrBuilder> + credentialBuilder_; + /** + * + * + *
+       * Input only. Cloud SQL credential.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the credential field is set. + */ + public boolean hasCredential() { + return credentialBuilder_ != null || credential_ != null; + } + /** + * + * + *
+       * Input only. Cloud SQL credential.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The credential. + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + getCredential() { + if (credentialBuilder_ == null) { + return credential_ == null + ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .getDefaultInstance() + : credential_; + } else { + return credentialBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Input only. Cloud SQL credential.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setCredential( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential value) { + if (credentialBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + credential_ = value; + onChanged(); + } else { + credentialBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Input only. Cloud SQL credential.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setCredential( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential.Builder + builderForValue) { + if (credentialBuilder_ == null) { + credential_ = builderForValue.build(); + onChanged(); + } else { + credentialBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Input only. Cloud SQL credential.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder mergeCredential( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential value) { + if (credentialBuilder_ == null) { + if (credential_ != null) { + credential_ = + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .newBuilder(credential_) + .mergeFrom(value) + .buildPartial(); + } else { + credential_ = value; + } + onChanged(); + } else { + credentialBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Input only. Cloud SQL credential.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder clearCredential() { + if (credentialBuilder_ == null) { + credential_ = null; + onChanged(); + } else { + credential_ = null; + credentialBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Input only. Cloud SQL credential.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential.Builder + getCredentialBuilder() { + + onChanged(); + return getCredentialFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Input only. Cloud SQL credential.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlCredentialOrBuilder + getCredentialOrBuilder() { + if (credentialBuilder_ != null) { + return credentialBuilder_.getMessageOrBuilder(); + } else { + return credential_ == null + ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .getDefaultInstance() + : credential_; + } + } + /** + * + * + *
+       * Input only. Cloud SQL credential.
+       * 
+ * + * + * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlCredentialOrBuilder> + getCredentialFieldBuilder() { + if (credentialBuilder_ == null) { + credentialBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .Builder, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlCredentialOrBuilder>( + getCredential(), getParentForChildren(), isClean()); + credential_ = null; + } + return credentialBuilder_; + } + + @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.bigquery.connection.v1beta1.CloudSqlProperties) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.CloudSqlProperties) + private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlProperties + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties(); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudSqlProperties parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CloudSqlProperties(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.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CloudSqlCredentialOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.CloudSqlCredential) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The username for the credential.
+     * 
+ * + * string username = 1; + * + * @return The username. + */ + java.lang.String getUsername(); + /** + * + * + *
+     * The username for the credential.
+     * 
+ * + * string username = 1; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * + * + *
+     * The password for the credential.
+     * 
+ * + * string password = 2; + * + * @return The password. + */ + java.lang.String getPassword(); + /** + * + * + *
+     * The password for the credential.
+     * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + } + /** + * + * + *
+   * Credential info for the Cloud SQL.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.CloudSqlCredential} + */ + public static final class CloudSqlCredential extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.CloudSqlCredential) + CloudSqlCredentialOrBuilder { + private static final long serialVersionUID = 0L; + // Use CloudSqlCredential.newBuilder() to construct. + private CloudSqlCredential(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CloudSqlCredential() { + username_ = ""; + password_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CloudSqlCredential(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CloudSqlCredential( + 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(); + + username_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + password_ = 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.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential.class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .Builder.class); + } + + public static final int USERNAME_FIELD_NUMBER = 1; + private volatile java.lang.Object username_; + /** + * + * + *
+     * The username for the credential.
+     * 
+ * + * string username = 1; + * + * @return The username. + */ + 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 username for the credential.
+     * 
+ * + * string username = 1; + * + * @return The bytes for username. + */ + 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 = 2; + private volatile java.lang.Object password_; + /** + * + * + *
+     * The password for the credential.
+     * 
+ * + * string password = 2; + * + * @return The password. + */ + 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 the credential.
+     * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + 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; + } + } + + 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 (!getUsernameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, username_); + } + if (!getPasswordBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUsernameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, username_); + } + if (!getPasswordBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); + } + 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.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential other = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) obj; + + if (!getUsername().equals(other.getUsername())) return false; + if (!getPassword().equals(other.getPassword())) 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) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + 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.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential 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; + } + /** + * + * + *
+     * Credential info for the Cloud SQL.
+     * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.CloudSqlCredential} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.CloudSqlCredential) + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredentialOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .class, + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .Builder.class); + } + + // Construct using + // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential.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(); + username_ = ""; + + password_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + build() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + buildPartial() { + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential result = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential( + this); + result.username_ = username_; + result.password_ = password_; + 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.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) { + return mergeFrom( + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential other) { + if (other + == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + .getDefaultInstance()) return this; + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + 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.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object username_ = ""; + /** + * + * + *
+       * The username for the credential.
+       * 
+ * + * string username = 1; + * + * @return The username. + */ + 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 username for the credential.
+       * 
+ * + * string username = 1; + * + * @return The bytes for username. + */ + 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 username for the credential.
+       * 
+ * + * string username = 1; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + username_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The username for the credential.
+       * 
+ * + * string username = 1; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + + username_ = getDefaultInstance().getUsername(); + onChanged(); + return this; + } + /** + * + * + *
+       * The username for the credential.
+       * 
+ * + * string username = 1; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + 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 the credential.
+       * 
+ * + * string password = 2; + * + * @return The password. + */ + 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 the credential.
+       * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + 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 the credential.
+       * 
+ * + * string password = 2; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + password_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The password for the credential.
+       * 
+ * + * string password = 2; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + + password_ = getDefaultInstance().getPassword(); + onChanged(); + return this; + } + /** + * + * + *
+       * The password for the credential.
+       * 
+ * + * string password = 2; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + password_ = 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.bigquery.connection.v1beta1.CloudSqlCredential) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.CloudSqlCredential) + private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto + .CloudSqlCredential + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential(); + } + + public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudSqlCredential parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CloudSqlCredential(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.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1beta1_Connection_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1beta1_Connection_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_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/bigquery/connection/v1bet" + + "a1/connection.proto\022(google.cloud.bigque" + + "ry.connection.v1beta1\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\036google/iam/v1/iam_poli" + + "cy.proto\032\032google/iam/v1/policy.proto\032\033go" + + "ogle/protobuf/empty.proto\032 google/protob" + + "uf/field_mask.proto\032\036google/protobuf/wra" + + "ppers.proto\"\277\001\n\027CreateConnectionRequest\022" + + "9\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations.googl" + + "eapis.com/Location\022\032\n\rconnection_id\030\002 \001(" + + "\tB\003\340A\001\022M\n\nconnection\030\003 \001(\01324.google.clou" + + "d.bigquery.connection.v1beta1.Connection" + + "B\003\340A\002\"Z\n\024GetConnectionRequest\022B\n\004name\030\001 " + + "\001(\tB4\340A\002\372A.\n,bigqueryconnection.googleap" + + "is.com/Connection\"\237\001\n\026ListConnectionsReq" + + "uest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations." + + "googleapis.com/Location\0226\n\013max_results\030\002" + + " \001(\0132\034.google.protobuf.UInt32ValueB\003\340A\002\022" + + "\022\n\npage_token\030\003 \001(\t\"}\n\027ListConnectionsRe" + + "sponse\022\027\n\017next_page_token\030\001 \001(\t\022I\n\013conne" + + "ctions\030\002 \003(\01324.google.cloud.bigquery.con" + + "nection.v1beta1.Connection\"\342\001\n\027UpdateCon" + + "nectionRequest\022B\n\004name\030\001 \001(\tB4\340A\002\372A.\n,bi" + + "gqueryconnection.googleapis.com/Connecti" + + "on\022M\n\nconnection\030\002 \001(\01324.google.cloud.bi" + + "gquery.connection.v1beta1.ConnectionB\003\340A" + + "\002\0224\n\013update_mask\030\003 \001(\0132\032.google.protobuf" + + ".FieldMaskB\003\340A\002\"\217\001\n!UpdateConnectionCred" + + "entialRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022W\n\ncred" + + "ential\030\002 \001(\0132>.google.cloud.bigquery.con" + + "nection.v1beta1.ConnectionCredentialB\003\340A" + + "\002\"]\n\027DeleteConnectionRequest\022B\n\004name\030\001 \001" + + "(\tB4\340A\002\372A.\n,bigqueryconnection.googleapi" + + "s.com/Connection\"\366\002\n\nConnection\022\014\n\004name\030" + + "\001 \001(\t\022\025\n\rfriendly_name\030\002 \001(\t\022\023\n\013descript" + + "ion\030\003 \001(\t\022Q\n\tcloud_sql\030\004 \001(\0132<.google.cl" + + "oud.bigquery.connection.v1beta1.CloudSql" + + "PropertiesH\000\022\032\n\rcreation_time\030\005 \001(\003B\003\340A\003" + + "\022\037\n\022last_modified_time\030\006 \001(\003B\003\340A\003\022\033\n\016has" + + "_credential\030\007 \001(\010B\003\340A\003:s\352Ap\n,bigquerycon" + + "nection.googleapis.com/Connection\022@proje" + + "cts/{project}/locations/{location}/conne" + + "ctions/{connection}B\014\n\nproperties\"w\n\024Con" + + "nectionCredential\022Q\n\tcloud_sql\030\001 \001(\0132<.g" + + "oogle.cloud.bigquery.connection.v1beta1." + + "CloudSqlCredentialH\000B\014\n\ncredential\"\263\002\n\022C" + + "loudSqlProperties\022\023\n\013instance_id\030\001 \001(\t\022\020" + + "\n\010database\030\002 \001(\t\022W\n\004type\030\003 \001(\0162I.google." + + "cloud.bigquery.connection.v1beta1.CloudS" + + "qlProperties.DatabaseType\022U\n\ncredential\030" + + "\004 \001(\0132<.google.cloud.bigquery.connection" + + ".v1beta1.CloudSqlCredentialB\003\340A\004\"F\n\014Data" + + "baseType\022\035\n\031DATABASE_TYPE_UNSPECIFIED\020\000\022" + + "\014\n\010POSTGRES\020\001\022\t\n\005MYSQL\020\002\"8\n\022CloudSqlCred" + + "ential\022\020\n\010username\030\001 \001(\t\022\020\n\010password\030\002 \001" + + "(\t2\230\020\n\021ConnectionService\022\367\001\n\020CreateConne" + + "ction\022A.google.cloud.bigquery.connection" + + ".v1beta1.CreateConnectionRequest\0324.googl" + + "e.cloud.bigquery.connection.v1beta1.Conn" + + "ection\"j\202\323\344\223\002B\"4/v1beta1/{parent=project" + + "s/*/locations/*}/connections:\nconnection" + + "\332A\037parent,connection,connection_id\022\312\001\n\rG" + + "etConnection\022>.google.cloud.bigquery.con" + + "nection.v1beta1.GetConnectionRequest\0324.g" + + "oogle.cloud.bigquery.connection.v1beta1." + + "Connection\"C\202\323\344\223\0026\0224/v1beta1/{name=proje" + + "cts/*/locations/*/connections/*}\332A\004name\022" + + "\351\001\n\017ListConnections\022@.google.cloud.bigqu" + + "ery.connection.v1beta1.ListConnectionsRe" + + "quest\032A.google.cloud.bigquery.connection" + + ".v1beta1.ListConnectionsResponse\"Q\202\323\344\223\0026" + + "\0224/v1beta1/{parent=projects/*/locations/" + + "*}/connections\332A\022parent,max_results\022\363\001\n\020" + + "UpdateConnection\022A.google.cloud.bigquery" + + ".connection.v1beta1.UpdateConnectionRequ" + + "est\0324.google.cloud.bigquery.connection.v" + + "1beta1.Connection\"f\202\323\344\223\002B24/v1beta1/{nam" + + "e=projects/*/locations/*/connections/*}:" + + "\nconnection\332A\033name,connection,update_mas" + + "k\022\350\001\n\032UpdateConnectionCredential\022K.googl" + + "e.cloud.bigquery.connection.v1beta1.Upda" + + "teConnectionCredentialRequest\032\026.google.p" + + "rotobuf.Empty\"e\202\323\344\223\002M2?/v1beta1/{name=pr" + + "ojects/*/locations/*/connections/*/crede" + + "ntial}:\ncredential\332A\017name,credential\022\262\001\n" + + "\020DeleteConnection\022A.google.cloud.bigquer" + + "y.connection.v1beta1.DeleteConnectionReq" + + "uest\032\026.google.protobuf.Empty\"C\202\323\344\223\0026*4/v" + + "1beta1/{name=projects/*/locations/*/conn" + + "ections/*}\332A\004name\022\256\001\n\014GetIamPolicy\022\".goo" + + "gle.iam.v1.GetIamPolicyRequest\032\025.google." + + "iam.v1.Policy\"c\202\323\344\223\002J\"E/v1beta1/{resourc" + + "e=projects/*/locations/*/connections/*}:" + + "getIamPolicy:\001*\332A\020resource,options\022\255\001\n\014S" + + "etIamPolicy\022\".google.iam.v1.SetIamPolicy" + + "Request\032\025.google.iam.v1.Policy\"b\202\323\344\223\002J\"E" + + "/v1beta1/{resource=projects/*/locations/" + + "*/connections/*}:setIamPolicy:\001*\332A\017resou" + + "rce,policy\022\330\001\n\022TestIamPermissions\022(.goog" + + "le.iam.v1.TestIamPermissionsRequest\032).go" + + "ogle.iam.v1.TestIamPermissionsResponse\"m" + + "\202\323\344\223\002P\"K/v1beta1/{resource=projects/*/lo" + + "cations/*/connections/*}:testIamPermissi" + + "ons:\001*\332A\024resource,permissions\032~\312A!bigque" + + "ryconnection.googleapis.com\322AWhttps://ww" + + "w.googleapis.com/auth/bigquery,https://w" + + "ww.googleapis.com/auth/cloud-platformB\276\001" + + "\n,com.google.cloud.bigquery.connection.v" + + "1beta1B\017ConnectionProtoZRgoogle.golang.o" + + "rg/genproto/googleapis/cloud/bigquery/co" + + "nnection/v1beta1;connection\252\002(Google.Clo" + + "ud.BigQuery.Connection.V1Beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + }); + internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_descriptor, + new java.lang.String[] { + "Parent", "ConnectionId", "Connection", + }); + internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_descriptor, + new java.lang.String[] { + "Parent", "MaxResults", "PageToken", + }); + internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_descriptor, + new java.lang.String[] { + "NextPageToken", "Connections", + }); + internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_descriptor, + new java.lang.String[] { + "Name", "Connection", "UpdateMask", + }); + internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_descriptor, + new java.lang.String[] { + "Name", "Credential", + }); + internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_bigquery_connection_v1beta1_Connection_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_bigquery_connection_v1beta1_Connection_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1beta1_Connection_descriptor, + new java.lang.String[] { + "Name", + "FriendlyName", + "Description", + "CloudSql", + "CreationTime", + "LastModifiedTime", + "HasCredential", + "Properties", + }); + internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_descriptor, + new java.lang.String[] { + "CloudSql", "Credential", + }); + internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_descriptor, + new java.lang.String[] { + "InstanceId", "Database", "Type", "Credential", + }); + internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_descriptor, + new java.lang.String[] { + "Username", "Password", + }); + 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.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/LocationName.java b/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/LocationName.java new file mode 100644 index 00000000..d400af32 --- /dev/null +++ b/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/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.bigquery.connection.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class 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-bigquery-connection-v1beta1/src/main/proto/google/cloud/bigquery/connection/v1beta1/connection.proto b/proto-google-cloud-bigquery-connection-v1beta1/src/main/proto/google/cloud/bigquery/connection/v1beta1/connection.proto new file mode 100644 index 00000000..5b6d05df --- /dev/null +++ b/proto-google-cloud-bigquery-connection-v1beta1/src/main/proto/google/cloud/bigquery/connection/v1beta1/connection.proto @@ -0,0 +1,306 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.bigquery.connection.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.Connection.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/connection/v1beta1;connection"; +option java_outer_classname = "ConnectionProto"; +option java_package = "com.google.cloud.bigquery.connection.v1beta1"; + +// Manages external data source connections and credentials. +service ConnectionService { + option (google.api.default_host) = "bigqueryconnection.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new connection. + rpc CreateConnection(CreateConnectionRequest) returns (Connection) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/connections" + body: "connection" + }; + option (google.api.method_signature) = "parent,connection,connection_id"; + } + + // Returns specified connection. + rpc GetConnection(GetConnectionRequest) returns (Connection) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/connections/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns a list of connections in the given project. + rpc ListConnections(ListConnectionsRequest) returns (ListConnectionsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/connections" + }; + option (google.api.method_signature) = "parent,max_results"; + } + + // Updates the specified connection. For security reasons, also resets + // credential if connection properties are in the update field mask. + rpc UpdateConnection(UpdateConnectionRequest) returns (Connection) { + option (google.api.http) = { + patch: "/v1beta1/{name=projects/*/locations/*/connections/*}" + body: "connection" + }; + option (google.api.method_signature) = "name,connection,update_mask"; + } + + // Sets the credential for the specified connection. + rpc UpdateConnectionCredential(UpdateConnectionCredentialRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + patch: "/v1beta1/{name=projects/*/locations/*/connections/*/credential}" + body: "credential" + }; + option (google.api.method_signature) = "name,credential"; + } + + // Deletes connection and associated credential. + rpc DeleteConnection(DeleteConnectionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/connections/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the access control policy for a resource. + // Returns an empty policy if the resource exists and does not have a policy + // set. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1beta1/{resource=projects/*/locations/*/connections/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,options"; + } + + // Sets the access control policy on the specified resource. Replaces any + // existing policy. + // + // Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1beta1/{resource=projects/*/locations/*/connections/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Returns permissions that a caller has on the specified resource. + // If the resource does not exist, this will return an empty set of + // permissions, not a NOT_FOUND error. + // + // Note: This operation is designed to be used for building permission-aware + // UIs and command-line tools, not for authorization checking. This operation + // may "fail open" without warning. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1beta1/{resource=projects/*/locations/*/connections/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } +} + +// The request for [ConnectionService.CreateConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.CreateConnection]. +message CreateConnectionRequest { + // Required. Parent resource name. + // Must be in the format `projects/{project_id}/locations/{location_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Connection id that should be assigned to the created connection. + string connection_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Connection to create. + Connection connection = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for [ConnectionService.GetConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.GetConnection]. +message GetConnectionRequest { + // Required. Name of the requested connection, for example: + // `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryconnection.googleapis.com/Connection" + } + ]; +} + +// The request for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1beta1.ConnectionService.ListConnections]. +message ListConnectionsRequest { + // Required. Parent resource name. + // Must be in the form: `projects/{project_id}/locations/{location_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Maximum number of results per page. + google.protobuf.UInt32Value max_results = 2 [(google.api.field_behavior) = REQUIRED]; + + // Page token. + string page_token = 3; +} + +// The response for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1beta1.ConnectionService.ListConnections]. +message ListConnectionsResponse { + // Next page token. + string next_page_token = 1; + + // List of connections. + repeated Connection connections = 2; +} + +// The request for [ConnectionService.UpdateConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.UpdateConnection]. +message UpdateConnectionRequest { + // Required. Name of the connection to update, for example: + // `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryconnection.googleapis.com/Connection" + } + ]; + + // Required. Connection containing the updated fields. + Connection connection = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Update mask for the connection fields to be updated. + google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for [ConnectionService.UpdateConnectionCredential][google.cloud.bigquery.connection.v1beta1.ConnectionService.UpdateConnectionCredential]. +message UpdateConnectionCredentialRequest { + // Required. Name of the connection, for example: + // `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Credential to use with the connection. + ConnectionCredential credential = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for [ConnectionService.DeleteConnectionRequest][]. +message DeleteConnectionRequest { + // Required. Name of the deleted connection, for example: + // `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryconnection.googleapis.com/Connection" + } + ]; +} + +// Configuration parameters to establish connection with an external data +// source, except the credential attributes. +message Connection { + option (google.api.resource) = { + type: "bigqueryconnection.googleapis.com/Connection" + pattern: "projects/{project}/locations/{location}/connections/{connection}" + }; + + // The resource name of the connection in the form of: + // `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + string name = 1; + + // User provided display name for the connection. + string friendly_name = 2; + + // User provided description. + string description = 3; + + // Properties specific to the underlying data source. + oneof properties { + // Cloud SQL properties. + CloudSqlProperties cloud_sql = 4; + } + + // Output only. The creation timestamp of the connection. + int64 creation_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of the connection. + int64 last_modified_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. True, if credential is configured for this connection. + bool has_credential = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Credential to use with a connection. +message ConnectionCredential { + // Credential specific to the underlying data source. + oneof credential { + // Credential for Cloud SQL database. + CloudSqlCredential cloud_sql = 1; + } +} + +// Connection properties specific to the Cloud SQL. +message CloudSqlProperties { + // Supported Cloud SQL database types. + enum DatabaseType { + // Unspecified database type. + DATABASE_TYPE_UNSPECIFIED = 0; + + // Cloud SQL for PostgreSQL. + POSTGRES = 1; + + // Cloud SQL for MySQL. + MYSQL = 2; + } + + // Cloud SQL instance ID in the form `project:location:instance`. + string instance_id = 1; + + // Database name. + string database = 2; + + // Type of the Cloud SQL database. + DatabaseType type = 3; + + // Input only. Cloud SQL credential. + CloudSqlCredential credential = 4 [(google.api.field_behavior) = INPUT_ONLY]; +} + +// Credential info for the Cloud SQL. +message CloudSqlCredential { + // The username for the credential. + string username = 1; + + // The password for the credential. + string password = 2; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..12ed9b48 --- /dev/null +++ b/renovate.json @@ -0,0 +1,80 @@ +{ + "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-bigquery-connection", + "^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 +} \ 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 00000000..78abcc75 --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + bigquery-connection-install-without-bom + jar + Google Cloud BigQuery Connections Install Without Bom + https://github.com/googleapis/java-bigquery-connection + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-bigquery-connection + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/samples/pom.xml b/samples/pom.xml new file mode 100644 index 00000000..e1753f87 --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-bigquery-connection-samples + 0.0.1-SNAPSHOT + pom + Google Cloud BigQuery Connections Samples Parent + https://github.com/googleapis/java-bigquery-connection + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.0.15 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + + true + + + + + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml new file mode 100644 index 00000000..141ab918 --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + bigquery-connection-snapshot + jar + Google Cloud BigQuery Connections Snapshot Samples + https://github.com/googleapis/java-bigquery-connection + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-bigquery-connection + 0.0.0 + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + \ No newline at end of file diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml new file mode 100644 index 00000000..bf0c93f3 --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + com.google.cloud + bigquery-connection-snippets + jar + Google Cloud BigQuery Connections Snippets + https://github.com/googleapis/java-bigquery-connection + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + + com.google.cloud + libraries-bom + 5.1.0 + pom + import + + + + + + + com.google.cloud + google-cloud-bigquery-connection + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + diff --git a/synth.metadata b/synth.metadata new file mode 100644 index 00000000..d59f8f8c --- /dev/null +++ b/synth.metadata @@ -0,0 +1,37 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "sso://devrel/cloud/libraries/java/repo-splitter", + "sha": "18903c5fe1ce7568617af82de4cbd34ca5df159d" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "1d520eaa7bbd8b40f53942ff03b5496fff887b53", + "internalRef": "307849529" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "716f741f2d307b48cbe8a5bc3bc883571212344a" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "bigquery-connection", + "apiVersion": "v1beta1", + "language": "java", + "generator": "bazel" + } + } + ] +} \ No newline at end of file diff --git a/synth.py b/synth.py new file mode 100644 index 00000000..b95e50d4 --- /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 = 'bigquery-connection' +versions = ['v1beta1'] + +for version in versions: + java.bazel_library( + service=service, + version=version, + proto_path=f'google/cloud/bigquery/connection/{version}', + bazel_target=f'//google/cloud/bigquery/connection/{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 00000000..bbc1967d --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-bigquery-connection:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-bigquery-connection-v1beta1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-bigquery-connection-v1beta1:0.0.0:0.0.1-SNAPSHOT \ No newline at end of file